• 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: Folder Action to create Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Folder Action to create Archive


  • Subject: Re: Folder Action to create Archive
  • From: yvan-koenig <email@hidden>
  • Date: Sun, 13 Mar 2005 19:34:48 +0100


Le 11 mars 2005 , à 21:33, Todd Geist a écrit :


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


--

 Todd Geist
 ______________________________________
 G e i s t   i n t e r a c t i v e

Hello Todd

I'm a bit surprised.

I simply copy-pasted the passed script in the Apple's Script Editor, saved it as a Compiled script (not an application) and stored it in the "Folder Actions" folder.

I attached it to a folder and it works perfectly on my machine under Mac OS X 10.3.8

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: This email sent to email@hidden
References: 
 >Re: Folder Action to create Archive (From: Todd Geist <email@hidden>)

  • Prev by Date: Re: Folder Action to create Archive
  • Next by Date: Re: Folder Action to create Archive
  • Previous by thread: Re: Folder Action to create Archive
  • Next by thread: Re: Folder Action to create Archive
  • Index(es):
    • Date
    • Thread