AppleScript to remove a folder action
AppleScript to remove a folder action
- Subject: AppleScript to remove a folder action
- From: Steve Suranie <email@hidden>
- Date: Wed, 08 Dec 2004 08:41:29 -0500
I have a folder action that reports (via email) whenever something is added
to the folder, if a folder is added to the folder then the folder action is
also attached to that folder. (Hope that was clear).
I'm trying to add to the script a means, if someone removes a folder from
the hierarchy of the main folder (once again I hope that was clear, see my
brilliant diagram below) the folder action is also removed.
Um, something like this:
Main Folder - reporting script
Level One Folder - gets reporting script attached
Level Two Folder - gets reporting script attached
Main Folder
Level One Folder
Level Two Folder (removed from Main Folder hierarchy, script should be
removed as well.
I tried this but it wouldn't compile:
on removing folder items from thisFolder after losing theseItems
try
set scriptPath to "Macintosh HD:Library:Scripts:Folder Action
Scripts:gettingItems.scpt"
repeat with i from 1 to (count of every item of theseItems)
set thisItemPath to item i of theseItems as string
tell application "Finder"
set itemType to kind of alias thisItemPath
if itemType = "Folder" then
tell application "System Events" to remove action alias
scriptPath from thisItemPath
end if
end tell
end repeat
on error errMsg
display dialog errMsg
end try
end removing folder items from
Assistance, as always, is greatly appreciated.
_______________________________________________
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