• 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: How do I set folder action in Yosemite, please?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I set folder action in Yosemite, please?


  • Subject: Re: How do I set folder action in Yosemite, please?
  • From: Yvan KOENIG <email@hidden>
  • Date: Sun, 30 Nov 2014 11:53:38 +0100


Le 29/11/2014 à 22:27, Brian Christmas <email@hidden> a écrit :

G’day Yvan

As far as I can remember, it used to be a Dictionary command used for Folder Actions about 7 years ago, or even as far back as 9 years, when I first wrote my Mail Manager application, which (in part) relies on Folder Actions to respond to automated ftp downloads from an ftp Client called Interarchy.

I just found a reference going back to 2005,  https://discussions.apple.com/thread/133373?start=0&tstart=0

Quote…
It can be done via System Events:

tell application "System Events"

    attach action to (alias "HD:path:to:folder:") using ":Library:Scripts:Folder Action Scripts:FA.scpt"

end tell
end Quote

It’s one of those search items that you cannot seem to find unless you already know the correct  terminology.

The only thing that’s added now is that a mere alias is no longer any good, but requires 'folder (alias)'.

I think Apple are getting pretty slack with updating their Dictionaries.

I hope you can put ‘attach action’ to good use.

Regards

Santa


Hello

As you may guess, the pig headed user which I am was not satisfied to read that the dictionaries were probably out of date.
So I asked EasyFind to scan the contents of the System folder for the string "attach action".
It returned several entries :
SystemEvents.sdef
Hidden.scriptTerminology
Folder_Actions_Suite.pyo (twice)
Folder_Actions_Suite.pyc (twice)
Folder_Actions_Suite.py (twice)

Of course seeing SystemEvents.sdef here was puzzling because when I ask the Script Editor to display System Events dictionary I see no "attach action" command.

I opened SystemEvents.sdef and saw :

<suite name="Hidden Suite" code="tpnm" description="Hidden Terms and Events for controlling the System Events application" hidden="yes">
<class-extension extends="folder" description="The Folder Actions specific extensions to the folder class" hidden="yes">
<responds-to command="attach action to">
   <cocoa method="attachActionVerb:" />
</responds-to>
<responds-to command="attached scripts">
   <cocoa method="attachedScriptsVerb:" />
</responds-to>
<responds-to command="edit action of">
   <cocoa method="editActionVerb:" />
</responds-to>
<responds-to command="remove action from">
   <cocoa method="removeActionVerb:" />
</responds-to>
</class-extension>
<class-extension extends="folder action" description="An action attached to a folder in the file system">
   <property name="has new changes" code="hnch" type="boolean" access="r" description="Used to check if there have been files added or removed since the action was disabled or created." />
</class-extension>
<command name="attach action to" code="facoatfa" description="Attach an action to a folder" hidden="yes">
<cocoa class="AttachActionVerb" />
<direct-parameter type="specifier" description="the object for the command" />
<parameter name="using" code="faal" type="text" description="a file containing the script to attach">
<cocoa key="using" />
</parameter>
<result type="folder action" />
</command>
<command name="attached scripts" code="facolact" description="List the actions attached to a folder" hidden="yes">
<cocoa class="AttachedScriptsVerb" />
<direct-parameter type="specifier" description="the object for the command" />
<result>
   <type type="any" list="yes" />
   </result>
</command>
<command name="cancel" code="prcscncl" description="cause the target process to behave as if the UI element were cancelled" hidden="yes">
<direct-parameter type="specifier" description="the object for the command" />
<result type="UI element" />
</command>
<command name="confirm" code="prcscnfm" description="cause the target process to behave as if the UI element were confirmed" hidden="yes">
<direct-parameter type="specifier" description="the object for the command" />
<result type="UI element" />
</command>
<command name="decrement" code="prcsdecr" description="cause the target process to behave as if the UI element were decremented" hidden="yes">
<direct-parameter type="specifier" description="the object for the command" />
<result type="UI element" />
</command>
<command name="do folder action" code="facofola" description="Send a folder action code to a folder action script" hidden="yes">
<direct-parameter type="specifier" description="the object for the command" />
<parameter name="folder action code" code="actn" type="actn" description="the folder action message to process">
<cocoa key="code" />
</parameter>
<parameter name="with item list" code="flst" type="any" optional="yes" description="a list of items for the folder action message to process">
<cocoa key="itemList" />
</parameter>
<parameter name="with window size" code="fnsz" type="rectangle" optional="yes" description="the new window size for the folder action message to process">
<cocoa key="windowSize" />
</parameter>
</command>
<command name="do script" code="miscdosc" description="Execute an OSA script." hidden="yes">
<cocoa class="DoScriptVerb" />
<direct-parameter description="the object for the command">
<type type="alias" />
<type type="file" />
<type type="text" />
</direct-parameter>
<result type="any" />
</command>
<command name="edit action of" code="facoedfa" description="Edit an action of a folder" hidden="yes">
   <cocoa class="EditActionVerb" />
<direct-parameter type="specifier" description="the object for the command" />
<parameter name="using action name" code="snam" type="text" optional="yes" description="...or the name of the action to edit">
<cocoa key="usingName" />
</parameter>
<parameter name="using action number" code="indx" type="integer" optional="yes" description="the index number of the action to edit...">
<cocoa key="usingNumber" />
</parameter>
<result type="file" />
</command>
<command name="increment" code="prcsincE" description="cause the target process to behave as if the UI element were incremented" hidden="yes">
<direct-parameter type="specifier" description="the object for the command" />
<result type="UI element" />
</command>
<command name="key down" code="prcskeyF" description="cause the target process to behave as if keys were held down" hidden="yes">
   <cocoa class="KeyDownVerb" />
<direct-parameter type="any" description="the object for the command" />
</command>
<command name="key up" code="prcskeyU" description="cause the target process to behave as if keys were released" hidden="yes">
   <cocoa class="KeyUpVerb" />
<direct-parameter type="any" description="the object for the command" />
</command>
<command name="pick" code="prcspick" description="cause the target process to behave as if the UI element were picked" hidden="yes">
<direct-parameter type="specifier" description="the object for the command" />
<result type="UI element" />
</command>
<command name="remove action from" code="facormfa" description="Remove a folder action from a folder" hidden="yes">
   <cocoa class="RemoveActionVerb" />
<direct-parameter type="specifier" description="the object for the command" />
<parameter name="using action name" code="snam" type="text" optional="yes" description="...or the name of the action to remove">
<cocoa key="usingName" />
</parameter>
<parameter name="using action number" code="indx" type="integer" optional="yes" description="the index number of the action to remove...">
<cocoa key="usingNumber" />
</parameter>
<result type="folder action" />
</command>
<enumeration name="actn" code="actn" hidden="yes">
<enumerator name="items added" code="fget" description="items added" />
<enumerator name="items removed" code="flos" description="items removed" />
<enumerator name="window closed" code="fclo" description="window closed" />
<enumerator name="window moved" code="fsiz" description="window moved" />
<enumerator name="window opened" code="fopn" description="window opened" />
</enumeration>
</suite>

So, now things are clear.
The command is defined but who knows why, Apple decided to hide this definition (and some other ones).


Yvan KOENIG (VALLAURIS, France) dimanche 30 novembre 2014 11:53:30


 _______________________________________________
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: How do I set folder action in Yosemite, please?
      • From: Bill Cheeseman <email@hidden>
    • Re: How do I set folder action in Yosemite, please?
      • From: Yvan KOENIG <email@hidden>
References: 
 >How do I set folder action in Yosemite, please? (From: Brian Christmas <email@hidden>)
 >Re: How do I set folder action in Yosemite, please? (From: Yvan KOENIG <email@hidden>)
 >Re: How do I set folder action in Yosemite, please? (From: Brian Christmas <email@hidden>)
 >Re: How do I set folder action in Yosemite, please? (From: Yvan KOENIG <email@hidden>)
 >Re: How do I set folder action in Yosemite, please? (From: Brian Christmas <email@hidden>)

  • Prev by Date: Re: How do I set folder action in Yosemite, please?
  • Next by Date: Re: How do I set folder action in Yosemite, please?
  • Previous by thread: Re: How do I set folder action in Yosemite, please?
  • Next by thread: Re: How do I set folder action in Yosemite, please?
  • Index(es):
    • Date
    • Thread