Re: Problems with folder actions
Re: Problems with folder actions
- Subject: Re: Problems with folder actions
- From: Robert Poland <email@hidden>
- Date: Wed, 07 Sep 2011 16:06:25 -0600
Thanks Axel, Yvan, Ron and Chris,
In hind sight it looks like I would have solved this long ago if I had any idea just how slow this operation would be. The last removal test took just under three minutes.
On Sep 7, 2011, at 3:10 PM, Axel Luttgens wrote:
>
> Le 7 sept. 2011 à 19:07, Robert Poland a écrit :
>
>> Thanks Axel,
>>
>> Apparently the script I'm creating is wrong. Could you send me the script that works?
>>
>> TIA,
>
> Hello Robert,
>
> Well, it was very similar to the one Ron already has posted:
>
> on adding folder items to TargetFolder after receiving AddedItems
> tell application "Finder"
> set label index of TargetFolder to 3
> end tell
> end adding folder items to
>
> on removing folder items from TargetFolder after losing RemovedItems
> tell application "Finder"
> if items of TargetFolder is {} then
> set label index of TargetFolder to 0
> else
> set label index of TargetFolder to 3
> end if
> end tell
> end removing folder items from
>
> Notwithstanding the value of the label index (I thought 0 should mean "empty folder"), I took the opportunity provided by the "removing folder" event to somehow ensure that the folder's color really reflects its contents (empty or not).
> I'm not sure, but it could well be that events handled thru folder actions may sometimes collapse for efficiency purposes, so that one may miss the global effect of a sequence of events.
> More generally, for your purpose, it could well be that some kind of periodic task could be better suited.
>
> HTH,
> Axel
Robert Poland - Fort Collins, CO
_______________________________________________
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