• 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 in download folder...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Folder action in download folder...


  • Subject: Re: Folder action in download folder...
  • From: Michelle Steiner <email@hidden>
  • Date: Wed, 8 Jun 2005 17:32:17 -0700


On Jun 8, 2005, at 5:00 PM, David Crowe wrote:

If someone has a working example I'd love to see it.

(* ADD - NEW ITEM ALERT ©2002 Apple Computer

This Folder Action script is designed for use with Mac OS X version 10.2 and higher.

This Folder Action handler is triggered whenever items are added to the attached folder. The script will display an alert containing the number of items added and offering the user the option to reveal the added items in Finder.
*)


property dialog_timeout : 30 -- set the amount of time before dialogs auto-answer.

on adding folder items to this_folder after receiving added_items
    try
        tell application "Finder"
            --get the name of the folder
            set the folder_name to the name of this_folder
        end tell

-- find out how many new items have been placed in the folder
set the item_count to the number of items in the added_items
--create the alert string
set alert_message to ("Folder Actions Alert:" & return & return) as Unicode text
if the item_count is greater than 1 then
set alert_message to alert_message & (the item_count as text) & " new items have "
else
set alert_message to alert_message & "One new item has "
end if
set alert_message to alert_message & "been placed in folder " & "\"" & the folder_name & "\"" & "."
set the alert_message to (the alert_message & return & return & "Would you like to view the added items?")


display dialog the alert_message buttons {"Yes", "No"} default button 2 with icon 1 giving up after dialog_timeout
set the user_choice to the button returned of the result


        if user_choice is "Yes" then
            tell application "Finder"
                --go to the desktop
                activate
                --open the folder
                open this_folder
                --select the items
                reveal the added_items
            end tell
        end if
    end try
end adding folder items to

--
A great Idea!  That's what we need--a great idea.
 --Pesudolous, (A Funny Thing Happened on the way to the forum)

_______________________________________________
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: 
 >Folder action in download folder... (From: David Crowe <email@hidden>)
 >Re: Folder action in download folder... (From: Simon Forster <email@hidden>)
 >Re: Folder action in download folder... (From: David Crowe <email@hidden>)

  • Prev by Date: Re: OT: Re: Shit - it's all true
  • Next by Date: Re: OT & Overlong: The Future of Orphaned Files...
  • Previous by thread: Re: Folder action in download folder...
  • Next by thread: Re: Folder action in download folder...
  • Index(es):
    • Date
    • Thread