• 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: Folder action script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Folder action script


  • Subject: Re: Folder action script
  • From: kai <email@hidden>
  • Date: Tue, 28 Feb 2006 02:58:13 +0000


On 25 Feb 2006, at 13:10, Serge Ségu wrote:

It is possible to attach a script to a folder by script
but, is it possible to activate 'folder action script' by script ?
without using GUI scripting

I meant to throw in one or two examples in response to this, Serge - but was distracted (and then promptly forgot).


Specified folder action:
----------------
tell application "System Events" to set enabled of ¬
	folder action "some folder" to true
----------------

Contiguous folder actions:
----------------
tell application "System Events" to set enabled of ¬
	folder actions 1 thru 3 to true
----------------

Non-contiguous folder actions:
----------------
tell application "System Events" to set enabled of ¬
	folder actions whose name is "some folder" or ¬
	name is "some other folder" to true
----------------

Every folder action:
----------------
tell application "System Events" to set enabled of ¬
	folder actions to true
----------------
================

Specified script attached to specified folder:
----------------
tell application "System Events" to set enabled of script ¬
	"some script.scpt" of folder action "some folder" to true
----------------

Contiguous scripts attached to specified folder:
----------------
tell application "System Events" to set enabled of scripts ¬
	"some script.scpt" thru "some other script.scpt" of ¬
	folder action "some folder" to true
----------------

Non-contiguous scripts attached to specified folder:
----------------
tell application "System Events" to set enabled of ¬
	scripts of folder action "some folder" whose ¬
	name is "some script.scpt" or name is ¬
	"some other script.scpt" to true
----------------

Every script attached to specified folder:
----------------
tell application "System Events" to set enabled of scripts ¬
	of folder action "some folder" to true
----------------
================

Every script attached to every folder:
----------------
tell application "System Events" to set enabled of ¬
	scripts of folder actions to true
----------------

Referencing by name or index is generally interchangeable - apart from when filtering (using a 'whose'/'where' clause).

---
kai


_______________________________________________ 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
References: 
 >Folder action script (From: Serge Ségu <email@hidden>)

  • Prev by Date: Re: Referencing "unknowns" with UI scripting
  • Next by Date: Folder Action - duplicating files
  • Previous by thread: Re: Folder action script
  • Next by thread: list syntax
  • Index(es):
    • Date
    • Thread