简体   繁体   中英

Applescript droplet that executes shell script

I'd like to make an Applescript droplet with Automator that does the following: when I drop "Application.app" in the droplet, the script runs

./upx.out -d [the binary contained in the MacOS subfolder of Application.app]

where "Application.app" and the binary are variables, and where upx.out is contained in the Resources subfolder of the Automator droplet.

on open myItem
    set pathtobinary to [you'll need to figure out how to get the path to the binary inserted here as a function of myItem]
    do shell script "./upx.out -d " & quoted form of pathtobinary
end open

Then save the script as an application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM