• 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: Problems with folder actions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with folder actions


  • Subject: Re: Problems with folder actions
  • From: Axel Luttgens <email@hidden>
  • Date: Wed, 07 Sep 2011 23:10:44 +0200

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

 _______________________________________________
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

  • Follow-Ups:
    • Re: Problems with folder actions
      • From: Robert Poland <email@hidden>
References: 
 >Problems with folder actions (From: Robert Poland <email@hidden>)
 >Re: Problems with folder actions (From: Axel Luttgens <email@hidden>)
 >Re: Problems with folder actions (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: Problems with folder actions
  • Next by Date: Re: a stationery is not a stationary
  • Previous by thread: Re: Problems with folder actions
  • Next by thread: Re: Problems with folder actions
  • Index(es):
    • Date
    • Thread