Modify - add items alert script

Hi all - need to modify the ‘add new items’ to folder action script.

I am trying to instruct script to display the ‘file_name’ of added item in the alert dialog box in place of the ‘one new item’ and to display a new dialog box for each item added from different network locations, also successfully modified script to leave dialog on screen until ‘user_choice’ is returned by clicking ‘yes/no’ button but to repeat action for each item subsequently added. Context: need to alert operator to files being available for viewing after being added to several scripted folders held in their network folder, operator away from computer for periods so hence dialog needs to be on screen until button selected.

Hope someone can help - apologies if in the wrong place

Model: iMac 2.4ghz
AppleScript: 1.10.7
Browser: Safari 523.12.2
Operating System: Mac OS X (10.4)

I have a script that does just this but uses Growl, unfortunately I wrote it for and at work.
I can get it when I am next in and post it.

The growl notifications can be set to sticky, which mean thay stay on the screen until the users click them.

Each notifications when set to a network folder will display the name of the files and the network folder they are in.
If two or more items hit the folder at the same time, they will appear in on dialogue as a list.

Found a version at home…


on adding folder items to this_folder after receiving added_items
	set appName to "New item in Error"
	set notificationName to "New Items"
	set notifs to {notificationName}
	tell application "GrowlHelperApp"
		register as application appName all notifications notifs default notifications notifs
	end tell
	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
	set item_name to ""
	repeat with i from 1 to number of items in added_items
		set this_item to item i of added_items
		tell application "Finder"
			set item_name to item_name & "[ " & displayed name of this_item & " ]" & return as Unicode text
		end tell
	end repeat
	--create the alert string
	tell application "Finder"
		--get the name of the containing folder of the folder
		set Contaner_name to name of container of this_folder
	end tell
	--set alert_message to (Contaner_name & return) as Unicode text
	if the item_count is greater than 1 then
		set alert_message to "( " & (the item_count as text) & "  ) new items IN "
		set alert_message to "( 1 )  new item IN"
	end if
	set alert_message to alert_message & " folder " & «data utxt201C» & the folder_name & «data utxt201D» & "." & return & item_name
	tell application "GrowlHelperApp"
		notify with name notificationName title Contaner_name & " ERROR" description alert_message application name appName icon of application "finder" with sticky
	end tell
end adding folder items to

Mark - many thanks for this will try it at work.

Thanks again much appreciated.

For info - tried the script works well with Growl -
is there a way to set the sticky dialog to display interactive ‘buttons’ as per applescript version
to enable user to ‘click’ and reveal items in the specified folder.

The applescript does this nicely but won’t display a dialog for each subsequent item added to
any other folder as the Growl version does so well!
Amalgamation of the 2 scripts would be brilliant if it’s possible.

Thanks again for the advice offered.

I have not looked for a while on the growl site, but had the same thought when I wrote the original script.
I think they where talking about setting up some sort of hook to reveal items ( don’t quote me ) I got the impression that it was not the easiest thing for them…
You may want to look there to see if they have moved on with it,

I will look around also, It would make a good addition to the scripts I use like this.

Glade the script helped some.


For ease of reading for future others (and me),:slight_smile: , Can we refer to the non-growl script as : The display dialog Alert applescript
And the growl one as : The Growl Display Alert Applescript.