on open thefile
tell application "StuffIt Expander"
expand thefile
quit -- This is added to quit Stuffit, otherwise it will stay open.
end tell
end open
Save this as an application and drag and drop files on it. Just curious… Why not just double click the file to expand it ?!?
on open theFiles
tell application "StuffIt Expander"
expand theFile
end tell
end open
The only things that I added were the Open handler, which is what you need to have in a droplet.
You need to save the above code as an application for it to work as a droplet.
If you haven’t already, make sure you take a gander at the AppleScript Language Guide. It’s a bit dated, but it has most of what you need to get started – plus it’s free.
Thanks to both of you.
One friend given me this code
on open (theFile)
tell application "StuffIt Expander" to activate
tell application "StuffIt Expander" to open theFile
tell application "StuffIt Expander" to quit
end open
my PostError("Don't click on me!
I'm an AppleScript Droplet.
Only drag and drop files on me.")
my PostError
to PostError(theMessage)
beep
display dialog theMessage ¬
buttons {"Sorry!"} default button "Sorry!" with icon 1 giving up after 12
end PostError
Now I need a program for Stuffing folders and files. Does any one have.
To see an application’s AppleScript dictionary, either drag the application’s icon to Script Editor’s icon or while in Script Editor go to File → Open Dictionary…
Once you do that you will see the commands that you are looking for: stuff, zip, tar.
Here’s a modified script that will work:
on open thefiles
tell application "DropStuff"
stuff thefiles
quit
end tell
end open