• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Creating Zip file via Create Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating Zip file via Create Archive


  • Subject: Re: Creating Zip file via Create Archive
  • From: Philip Aker <email@hidden>
  • Date: Mon, 23 Feb 2009 15:47:44 -0800

On 2009-02-23, at 15:05:42, Rosemary Cantrell wrote:

Thank you Philip, I'll try to figure that one out.  Where would you have referenced that in a library, or wait, would it be under shell?

I so wish I could just learn scripting "matrix" style so I'd just "get it!"

Ha! On my Leopard setup, I open up Terminal and type tab, tab and then I get asked: "Display all 1475 possibilities? (y or n)". 

So I think it's better to learn them on an as needed basis.

There's an example of a folder action quite similar to what I think you need in the Folder Actions Reference of the AppleScript Language Guide: <http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_folder_actions.html#//apple_ref/doc/uid/TP40000983-CH219-SW2>.

on adding folder items to this_folder after receiving these_items
tell application "Finder"
if not (exists folder "Done" of this_folder) then
make new folder at this_folder with properties {name:"Done"}
end if
set the destination_folder to folder "Done" of this_folder as alias
set the destination_directory to POSIX path of the destination_folder
end tell
repeat with i from 1 to number of items in these_items
set this_item to item i of these_items
set the item_info to info for this_item
if this_item is not the destination_folder and the name extension of the item_info is not in {"zip", "sit"} then
set the item_path to the quoted form of the POSIX path of this_item
set the destination_path to the quoted form of (destination_directory & (name of the item_info) & ".zip")
do shell script ("/usr/bin/ditto -c -k -rsrc --keepParent " & item_path & " " & destination_path)
end if
end repeat
end adding folder items to


Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

 _______________________________________________
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

References: 
 >Creating Zip file via Create Archive (From: Rosemary Cantrell <email@hidden>)
 >Re: Creating Zip file via Create Archive (From: Pat Cannon <email@hidden>)
 >Re: Creating Zip file via Create Archive (From: Pat Cannon <email@hidden>)
 >Re: Creating Zip file via Create Archive (From: Rosemary Cantrell <email@hidden>)

  • Prev by Date: Re: Creating Zip file via Create Archive
  • Next by Date: email@hidden
  • Previous by thread: Re: Creating Zip file via Create Archive
  • Next by thread: Re: Creating Zip file via Create Archive
  • Index(es):
    • Date
    • Thread