My employer has some amazing security on both the Macs and PCs. Unfortunately it seems to just get in the way for me and my scripts. I know that I can zip a file through ‘do shell script’, but I cannot access the terminal. We also do not have StuffIt for anything but opening zip files. I’m in the process of speaking with the IT team about getting one of these functionalities, or at least installing something like ZipIt, for now though, is there any way to zip a file using only applescript?
Model: Dual 2GHz G5, 2 GB
AppleScript: 2.1.1
Browser: Safari 419.3
Operating System: Mac OS X (10.4)
For the record though restricting access to the terminal application does not stop
do shell script "blah"
from working as that does not acctually use the terminal app itself. I know this because I lock my users out of the terminal as well, but my scripts which utilize do shell script work without any problems.
without StuffIt or the terminal it’s only possible with GUI scripting.
I assigned the keyboard shortcut ctrl-cmd-A to “Create Archive” in the Finder’s file menu,
(you can do this in System Preferences > Keyboard & Mouse > Keyboard Shortcuts)
This script creates an archive from the selected files/folders using that shortcut
tell application "Finder"
activate
set sel to selection
end tell
tell application "System Events"
tell process "Finder" to keystroke "a" using {command down, control down}
end tell
Thanks. Odd though…the volume on my desktop is called “NewsPaper” and other applescripts access it using that name of course, however, when I ‘do shell script,’ I have to call it “NewsPaper-1” – any clue why that is?