Re: Folder Actions Question
Re: Folder Actions Question
- Subject: Re: Folder Actions Question
- From: Philip Aker <email@hidden>
- Date: Fri, 5 Sep 2008 13:00:33 -0700
On Sep 5, 2008, at 8:07 AM, Stuart Milliken wrote:
> Depending on how you coded it, it's highly possible that is
happening.
However, unless you post the code, it is difficult to say for sure.
The script is as follows. Thanks for looking.
Stuart
on adding folder items to thisFolder after receiving someItems
tell application "Finder"
set label index of thisFolder to 4 --blue
end tell
end adding folder items to
on removing folder items from thisFolder after losing someItems
tell application "System Events"
set filesInFolder to every file of thisFolder whose visible is true
set n to count filesInFolder
set foldersInFolder to every folder of thisFolder whose visible is
true
set n to n + (count foldersInFolder)
end tell
tell application "Finder"
if n = 0 then
set label index of thisFolder to 7 --gray
else
set label index of thisFolder to 4 --blue
end if
end tell
end removing folder items from
I don't know about the vagaries of Folder Actions but in general,
you'll get a faster result if you're only sending events to one
application. Since you can ask the Finder for the same file and folder
count, I think that's one area which could be optimized.
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