Previous 1 2 3 Next 41 Replies Latest reply: Mar 11, 2014 4:41 PM by KindnessIsNiceDuh -K.I.N.D.- Go to original post
  • KindnessIsNiceDuh -K.I.N.D.- Level 1 Level 1 (15 points)

    Oh I just got it to work!

    Here's what I did, if it helps anyone.

     

    Before I start with the steps, please note that I had previously changed the permissions on my username folder (and all subfolders) to this:

     

         Me   (Read and Write)

         staff (Write only)

         everyone (No Access)

     

    I believe that this may have caused some of the issues (see step 2 below).

     

     

    1) After I finished trying to modify those two plist files (as I described earlier), I deleted them and restored the originals from my backups.

     

    2) I reverted the permissions on my entire Username folder (aka. the home directory) to their default settings, such as

     

         Me (Read and Write)

         staff (Read only)

         everyone (Read only)

     

    3.a) I went to the Folder Actions Setup menu, and removed all of the actions and folders, by unticking each check mark and then pressing the minus signs.

     

    3.b) I also unticked the Enable Folder Actions check box.

     

    4) I think this is really important: I completely shut down my computer, (this was my attempt to allow the plist files to be recached or something, as I was describing in the above post).

     

    5) I turned the computer on again, and from the Folder Actions Setup menu I manually assigned the desired script to my folder. BUT I did not try running the script yet.

     

    6) I shut down my computer again, because adding the scripts meant that the plist files were updated agian, and I wanted to make sure that everything that uses those plists had the chance to see/recatch the changes.

     

    7) When I turned my computer back on, everything worked.

     

    Hope this helps,

     

     

     

     

     

    Edit: Oh, if it makes a difference, I did this on OSX 10.8.4 mountain lion.

  • KindnessIsNiceDuh -K.I.N.D.- Level 1 Level 1 (15 points)

    As I just now found out from http://hints.binaryage.com/change-the-file-location-of-screenshots-on-mac-os-x/

     

    The thing that I was talking about related to the plist catching or something, can be solved simply by typing this command into the terminal:

     

         killall SystemUIServer

     

    If you read the post above, I believe this command line will be the same as (or better than) shutting down the entire computer. But Please Please Please make sure to save any open files before running that command, since it may close your programs.

     

    Shout out to red_menace for pointing out the page where I read this tip. Thanks

  • Warwick Teale Level 3 Level 3 (580 points)

    HI guys, I read a recent post on this thread concerning workaround and fixes to the original issue of applescripts with handlers on adding folder items to ... after receiving ("FolderActions not working" or in other cases NOT responding or erratically responding / stalling , or performing erraticlly or generally problematic when invoked under OSX 10.8.x to folders.

     

    From my research, diagnosis and experimentation I have resolved a simple procedure and change to the method of implementing FOLDER ACTIONS on OSX 10.8 and beyond, that does NOT involve directly adding FOLDER action scripts through the FINDER and also NOT the "ADD FOLDER ACTION" service or the applescript directive eg

     

    attach action to (action_01_folder as string) using (script_01 as string) -- attach the folder action script to the folder

     

    Here's why

    ... and what you might try before reaching for a welder, a hammer and a scalpel (and many other things in this thread and many others in these forums) to perform some kind of low level change to stage information parms. You definately DONT need to....

     

    Franky this stuff should work reliably and in fact it does quite well.

    Background:

    I have  several workflows that Ive developed over many years that rely on FOLDER ACTIONS for producing VFX and videos etc. Compressor, , Shake etc that rely on apple scripts that we rely on for production work.

     

    What fails:

    you will see a great deal of messages (and strings) for FOLDER ACTIONS in the /var/log such as:


    .....  20:12:47 mac-mini-i7 com.apple.launchd.peruser.501[xxx] (com.apple.FolderActions.folders): Throttling respawn: Will start in 7 seconds


    ... some is "is deprecated " .. etc etc

     

    Symptoms:

    Fundamentally your applescripts are slow to repsond/trigger to an adde or removed items and in additoin a long running script completes but will not continue its iteration through a loop (repeat with items in ..) for example. Attempts to trigger it remain allusive other than loggng in and out and then local ~/Library/scripts will be enabled somehow through Launchd and they can be started.


    Basically its all erratic.

    Remedy/ Solution/ How to fix in MAC OSX 10.8?

    1) Use Automator.app FOLDER ACTIONS to add folder actions applescript to a folder.

    automator_folder_action.png

     

    2) DONT use the FINDER "add folder actions" service and DONT use the applescript directive "attach action to" in applescript

    finder_folder_actions.png

     

    3) use Automator to add your applecript to a folder as a "Folder Action" workflow:

      • add you VERY SLIGHLY modified (change the handler) to the "run applescript" workflow node in Automator
      • direct the folder action node to the FOLDER that you want the event/trigger to happer.
      • change the legacy applescript event hander from "on adding folder items to ... after receiving" to the default "on run {list_if_added_items, some_parms} .... .... end run" that is used in the Automator.app "Run Applescript" workflow node.
      • the first paramater thats passed is a LIST of pointers to the items tha were added to the folder. same as usual
      • parmeter 2 is a list of the TEXT script commands code and other details he was passed to this handler... 
      • whats missing ?..... add this line of applescript to DERIVE the path of the folder where the folder action workflow is attachedtell application "System Events" to set my_hot_action_folder to the path of the container of the first item of list_of_added_items as alias
      • simple!

    automator_folder_action_script.png

     

    Why is this better in OSX 10.8 (why I reckon you should try it).

    1. Is well documented (Aple dev doc I recall) and these forums that launchd is the preferred method such several verisons back for kicking over folder action projects. In addition the stability of Automator.app and its interation with launchd is very solid.
    2. It (this) IS very stable and VERY VERY resposive compared with the legacy "on adding folder items to nnnnn after receiving yyyy" handler method as far as I have experienced.
    3. Automator "on run" handler from the Automator setup LAuchagents  (see ~/Library/Workflows/Applications/Folder Actions" for these Folder Actions created by Automator.
    4. You wont see any of the "deprecated" call messages in the log unless you have some thing very old and unsupported in your applescript.
    5. you won't see (very much) iterative (loop /repetive contsructs) stop or pause in a long running script (say a transcoder app in a shell (do shell) or such).. the folder action script willcomplete to the end and not stall

     

    Errors in Automator Applescripts logged to /var/log:

    1. you MUST develop some kind of external logging and use ERROR recovery "try .. on error .. end try" constructs to catch errors. Else it very very difficult to debug these.
    2. DONT have any carriage returns or "blank lines" at the start of the script else you will get messages such as
      • "AppleScript Runner[nnnn]: Incorrect NSStringEncoding value 0x8000100 detected. Assuming NSStringEncodingASCII. Will stop this compatiblity mapping behavior in the near future." or
      • "AppleScript Runner[nnnnn]: CPSGetFrontProcess(): This call is deprecated and should not be called anymore."

     

    Summary:

    This approach to using Automator.app to develop FOLDER ACTIONS workflow nodes on folders is very stable and very responsive compared to the legacy method.


    We've converted all our workflow using FOLDER ACTION applescripts to using this method with 100% success.

     

    Post your results for others to see.

     

    Warwick

    Hong Kong

  • louis_phb Level 1 Level 1 (10 points)

    A year ago on another system (which has now been migrated from 10.7 to my new one running 10.8), I renamed my user account (short name) from "louis" to "lpfb". I've since created a new Folder Action which deals within my Home folder (~/Downloads) and I find the following error in the console.

     

    9/8/13 3:24:25.252 PM Folder Actions Dispatcher[288]: AppleEvents failed to encode extension for /Users/louis/Downloads, err=No such file or directory/2

     

    So my question is...should I try and get these plist files straightened out by using the actions highlighted above? I'm wondering if there's a broken link in there looking for my old home folder?

  • KindnessIsNiceDuh -K.I.N.D.- Level 1 Level 1 (15 points)

    Hey Louis, if understand correctly what you're trying to do. I think I would suggest trying the following befor you try any of the more intense suggestion on this forum:

     

    1) Open to your Finder and try to go to ~/Users/louis/Downloads

     

    2) If that folder doesn't exist, make one yourself. Don't exit the Finder though.

     

    3) Click on the Apple Logo in the upper left and choose "Force Quit..."

     

    4) In the pop up window click on Finder and press the "Relaunch" button.

     

    5) Now right click the Download folder and select "Move to Trash".   Go to the trash and empty it, don't use the "rm -r" command in the Terminal.  Warning: this will delete everything in the Trash,   and everything in the Downloads folder. Make sure you moved anything you want to keep to a safe loation.

     

    6) After emptying the trash, make sure your Finder is still open to where the Downloads folder used to be, and repeat steps 3 and 4.

     

    7) Ok everything should be fine now. But if your problem still persists, I would recomend making sure you're wrote everything correctly in you Automator script, or just simply setting your name back to the way it was before.

     

    Best,

    Vlad:)

  • louis_phb Level 1 Level 1 (10 points)

    This appears to have resolved the issue. Thanks, Vlad.

     

    If you have nothing better to do, if you can share a 30 000 ft perspective on what the refreshes did... I'd love to learn.

     

    Otherwise, thanks.

  • KindnessIsNiceDuh -K.I.N.D.- Level 1 Level 1 (15 points)

    Great! Glad to hear that.

     

     

     

     

    The relaunch is basicly a feature spesically designed for the Finder app (you'll notice that all the other apps say "Force Quit").

    All it really does is assumes that if the user pressed it then "something must be wrong," so it closes the Finder and reopens it. The key is that when it reopen the Finder, it doesn't use the plist copies from virtual memory, but rather it goes to the actuall .plist files on the harddrive and loads from those.

     

    The reason this helps, is sometime the OS or some app makes a change to the .plist files but forgets to update their copies in the memory. This can cause issues like you were having, where the computer thinks a folder still exists even though it really doesn't.   Refreshing the finder forces the computer to use the most resent versions of the .plist.

     

    Or at least that's the way I see it...

     

     

    Hope that was an ok explination

    Bye,

    Vlad

  • Ohms238 Level 1 Level 1 (0 points)

    Does anyone know how I would accomplisht the following?

     

    Create an "application" using applescript or automator that would do the following:

    User double clicks "application"

    User is asked to select folder

    User selects folder

    Any images dropped into that folder would be scaled to specified pixel site.  This should take place for life (or until user removes folder action from folder)

    It should also apply to the subfolders if any are created to that folder.

     

    I tried do it on automator and it didn't work.

    The folder is empty at the start and it gives me an error.  It works on folder action. 

     

    Any help would be greatly appreciated!

  • KindnessIsNiceDuh -K.I.N.D.- Level 1 Level 1 (15 points)

    I'm not sure about first three requirnments:

                  User double clicks "application"

                 User is asked to select folder

                 User selects folder

     

    But the rest of it sounds like they should be a pretty simple folder action.

    Although, I'll be honest, I looked the other day and I didn't see a photo resize option in the Automator.

     

    I would suggest though that you start a new thread about it since this is a little "off topic". You'll probably get more help that way.

     

    Once you start that thread, please either private message me or post the link to it on here since I have serval suggestions that I think will work well for you.

  • Magictom42 Level 1 Level 1 (0 points)

    I had the problem with folder actions for 5 years now - and I bought a new iMac a year ago. The problem seemed to be migrated with my user account to the new machine.

     

    Anyway, after a lot of tests, I just found a solution which worked for me. I made some experiments with the files and folders in the $HOME/Library folder. And I found that the solution was to simply delete $HOME/Library/LaunchAgents. After a reboot, folder actions were working - and this was really a great success at the end of all my tries.

     

    Hope, this helps anybody.

  • KindnessIsNiceDuh -K.I.N.D.- Level 1 Level 1 (15 points)

    Magictom42 wrote:

     

    ... the solution was to simply delete $HOME/Library/LaunchAgents ...

     

    Sounds pretty reasonable, but I would highly recommend that you save a zipped file of any system related folder/file you delete. I do similar things all the time, but I always make a zip of it before deleting, and keep the zipped file in the same folder as the original so it be easy to find if I destroy my computer on accident .

  • KindnessIsNiceDuh -K.I.N.D.- Level 1 Level 1 (15 points)

    Also, my LaunchAgents folder seems to have a lot of other important stuff in it, so perhaps deleting the whole folder might not be a good idea, unless those files are just auto-regenerated on system startup. I would recommend only deleting the files you think are causing the problem.

     

    But either way, I would still suggest saving the whole folder in a zipefile before messing with it.

Previous 1 2 3 Next