Re: Using the 'Create Archive' - File Menu Command
Re: Using the 'Create Archive' - File Menu Command
- Subject: Re: Using the 'Create Archive' - File Menu Command
- From: KOENIG Yvan <email@hidden>
- Date: Tue, 24 Apr 2007 17:26:49 +0200
Le 24 avr. 07 à 16:47:18, revDAVE a écrit :
On Tiger 10.4.9...
I know in Tiger - under the file menu - that there is a 'create
archive'
command - where you can .zip what ever folder is currently
highlighted...
Assuming my desired folder =
set target of Finder window 1 to folder "thisOne" of disk "myDisk"
... Is there a way to get AppleScript to trigger the 'create archive'
command and .zip this folder?
Hello
I got the tip some months ago on a forum:
set a_Folder to "Macintosh HD:Users:yvankoenig:Desktop:ƒ dates
ƒ:AW_panther.pdf"
-- ... In the body of your script ...
set aFolder to a_Folder as alias
-- This folder must exist
set myZippedPath to fileZipper(aFolder)
-- myZippedPath is now the path to the zipped file.
-- ... After the body of your script ...
-- File Zipper
-- Creates zipped file in same folder
-- Pass file/folder path to this handler
-- Returns path to zipped file
on fileZipper(myFile)
if (myFile as text) ends with ":" then set myFile to text 1 thru -2
of (myFile as text)
set zipFile to (myFile & ".zip") as text
do shell script "/usr/bin/ditto -c -k -rsrc --keepParent " & (quoted
form of (POSIX path of myFile)) & " " & (quoted form of (POSIX path
of zipFile))
return zipFile
end fileZipper
Yvan KOENIG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden