Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Folder action script




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: http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden
References: 
 >Folder action script (From: Serge Ségu <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.