Sync folders in folder actions

I'll explain :
Is there a way to tell acions folder to copy files over whenever a file is modified ?
Thanks
MJ

A folder action is triggered when something is added (or removed) from the attached folder - there isn't a variation that will activate when a file is modified. Another option would be to schedule a periodic script that uses the rsync shell utility.

Similar Messages

  • Managing and distributing Folders with folder actions to a group of users?

    I want to set up a server for a camera club on a SnowLeo Server running on a MacMini. We want to collect images every month from users who want to participate in a club competition and are looking into the FileSharing service on the server to collect the images.
    My initial idea was to find a way of letting the Administrator automatically create folders with folder actions in every users home folder (i.e. "2010-April-Portraits"). After the user had uploaded images into it, the folder action would then rename, reformat and transport images into a central location to be processed further.
    Is this a good way of collecting data, and if yes - how do I let the Admin create and distribute these folders with the appropriate actions?
    Best regards,
    Kjell Are Refsvik
    Norway

    Hi,
    I want to purchase a Macmini with SL Server and create a photo competition solution for a camera club. The solution needs to be able to accept uploaded images and the solution needs to let the user associate a set of images to a competition and from there the solution needs to make sure that the filename, format, size and embedded metadata is correct before storing and processing them further. Friends I have talked to say I need a classic CMS solution so I may need to investigate instead of my planned AppleScript/Automator solution.
    Also - thank you for offering to develop, but I had kinda planned to do this myself to build some knowledge and also get to know the server better.
    Anyone else using the SnowLeo server for a solution like this?
    Kjell Are Refsvik
    Norway

  • Folder actions folder, what is the right one in 10.8?

    I have 2 folders in:
    MacHD:Library:Scripts:
    one called Folder Action Scripts and one called Folder Action.  Which one is the one the OS uses?  I supposed one came across as a result of importing users form 10.6 to 10.8.
    Ta

    one called Folder Action Scripts and one called Folder Action.  Which one is the one the OS uses?
    They are both used and address different purposes:
    "Folder Action Scripts" contains  example scripts to be used with folders.
    "Folder Action" contains scripts to manage folder actions and to attach or remove actions from folders. These scripts are availabe from the scripts menu. 
    -- Léonie

  • How to monitor contents of sub-folders in a Folder Action?

    Hello. I am wondering how I might read a folder's contentModDate within Terminal, i.e. from the command line and/or within a Folder Action.
    This is the situation: I am running Periscope Pro (PP) for motion-detected videos, which by default, places them within the user's ~/Movies/com.zipzapmac.Periscope-Pro folder. Within that folder, PP creates a folder with it's name based upon (a) machine name and (b) primary MAC address. For example, we'll pretend this folder is called MacPro(001122334455). Then within that folder, as PP is running in motion-detection mode, it creates a new folder based on the current date and then, within that, places videos when motion is detected. Very straight-forward and it works just fine.
    What I would like to do is have a folder action that (a) detects when any new folder or file is created within MacPro(001122334455) and (b) sends me a text-message via Apple Mail.
    If the MacPro(001122334455) folder is empty, I can create a Folder Action that will detect the creation of a sub-folder when the first motion-detected video is created and that successfully sends me a text-message, BUT if a second video is created later within the same date-named folder, I will not get a message. I would get a text-message on the following day as a new folder is created within MacPro(001122334455) that signals the first motion-detected video of the day, but again not subsequent videos on the same day.
    The text-message via Apple Mail I have easily scripted via Applescript and it works flawlessly.
    Since Folder Actions only work upon a single pre-defined folder and not on sub-folders, I can never get automatically notified via text-message of second/third/fourth/etc. motion-detected videos as they're created... only the first one of each day.
    So, I'm wondering whether there's a different way, perhaps through launchd that I might script this process. I'm thinking that if the contentModDate value of the MacPro(001122334455) folder could be read, compared with the last known value, and then---if different---execute the Applescript. OR PERHAPS I'm going about this all wrong and you might have another, better idea?
    I'm open to suggestions.
    -- David (da2357)

    Well, I found a solution that does not use a Folder Action. Since Folder Actions will only work upon the specified folder and not upon the contents of any sub-folders, I needed a different solution.
    First, I launched Terminal and created a new file called monitorPeriscope. I set executable permissions (chmod 700 monitorPeriscope). The contents of the file:
    #!/bin/bash
    # monitor the size of a specified folder and
    # when the size increases, run an applescript
    # copyright 2013, david dot allie at me dot com
    # you are welcome to use this script, but please attribute authorship.
    # CONSTANTS
    WATCHFOLDER="/users/xadmin/movies/com.zipzapmac.Periscope-Pro"
    SIZEFILEONE="/users/xadmin/.bin/foldersizeone"
    SIZEFILETWO="/users/xadmin/.bin/foldersizetwo"
    MYAPPLESCRIPT="/users/xadmin/documents/dropbox/programming/applescript/motion_de tected_text.scpt"
    # START
    # calculates current size of watchfolder, saves to sizefiletwo, then
    # performs a diff operation, result which is evaluated in if statement,
    # and if different, runs applescript, and copy sizefiletwo to sizefileone
    du -h -k -d3 -c $WATCHFOLDER | awk 'END{print}' | awk '{print $1}' > $SIZEFILETWO
    diff --brief $SIZEFILEONE $SIZEFILETWO
    if [ $? -eq 1 ]
      then
        osascript $MYAPPLESCRIPT
        cp -f $SIZEFILETWO $SIZEFILEONE
    fi
    exit 0
    Next, I created the following Applescript, replacing Some User, [email protected] and the text address of [email protected] below with my real values.
    using terms from application "Mail"
    tell application "Mail"
    set theName to "Some User"
    set theAddress to "[email protected]"
    set theContent to "Motion detected in OFFICE."
    set newMessage to make new outgoing message
    tell newMessage
    make new to recipient at end of to recipients with properties {name:theName, address:theAddress}
    set visible to true
    set sender to "[email protected]"
    set subject to "ALERT "
    set content to theContent
    send newMessage
    end tell
    end tell
    end using terms from
    Next, using the touch command, I created /users/xadmin/.bin/foldersizetwo and /users/xadmin/.bin/foldersizetwo as needed for the bash shell script (touch /users/xadmin/.bin/foldersizeone and touch /users/xadmin/.bin/foldersizetwo).
    Next, still in Terminal, I navigated to ~/Library/LaunchAgents and created the following plist using nano, which I named com.xadmin.monitorPeriscope.plist:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
              <key>Disabled</key>
              <false/>
              <key>Label</key>
              <string>com.xadmin.monitorPeriscope</string>
              <key>ProgramArguments</key>
              <array>
              <string>/users/xadmin/.bin/monitorPeriscope</string>
              </array>
              <key>RunAtLoad</key>
              <true/>
              <key>StartInterval</key>
              <integer>900</integer>
    </dict>
    </plist>
    Finally, all that was needed was to log out and then log back in. Once I launched the Periscope Pro app and started the motion-detection mode, I left my office... and within fifteen minutes I received a text message indicating that motion had been detected in my office. In the plist above, I set a StartInterval of 900 seconds, which corresponds to 15 minutes. I can reduce it down to 300 seconds (5 minutes) without it adversely affecting performance, but I'm going to leave the setting where it is for now.
    So, I solved my own problem and I'm pleased with the results.
    -- David

  • Need help creating a folder action for creating folders based on filenames.

    I want to create a folder action that will monitor a folder and every time a file is added to the folder it will create a directory using the filename (minus the extension) and move the file the that directory

    on run {input, parameters} -- create folders from file names and move
      set output to {} -- this will be a list of the moved files
      repeat with anItem in the input -- step through each item in the input
        set {theContainer, theName, theExtension} to (getTheNames from anItem)
        try
          set destination to (makeNewFolder for theName at theContainer)
          tell application "Finder"
            move anItem to destination
            set the end of the output to the result as alias -- success
          end tell
        on error errorMessage -- duplicate name, permissions, etc
          log errorMessage
          # handle errors if desired - just skip for now
        end try
      end repeat
      return the output -- pass on the results to following actions
    end run
    to getTheNames from someItem -- get a container, name, and extension from a file item
      tell application "System Events" to tell disk item (someItem as text)
        set theContainer to the path of the container
        set {theName, theExtension} to {name, name extension}
      end tell
      if theExtension is not "" then
        set theName to text 1 thru -((count theExtension) + 2) of theName -- just the name part
        set theExtension to "." & theExtension
      end if
      return {theContainer, theName, theExtension}
    end getTheNames
    to makeNewFolder for theChild at theParent -- make a new child folder at the parent location if it doesn't already exist
      set theParent to theParent as text
      if theParent begins with "/" then set theParent to theParent as POSIX file as text
      try
        return (theParent & theChild) as alias
      on error errorMessage -- no folder
        log errorMessage
        tell application "Finder" to make new folder at theParent with properties {name:theChild}
        return the result as alias
      end try
    end makeNewFolder
    This script almost does what I need except for the fact that it screws up on files with periods in them
    for example
    1.2.3.4.txt
    will create the directorys 1, 2, 3, and 4 instead of 1.2.3.4

  • Applying a folder action to thousands of folders?

    I am pulling my hair out with this; I need to know the best way to do this. My client said he had "a thousand or so" eps files that he wanted bundled into specific groups, then duplicated as pdf, jpg, png and tif files, each group in its own subfolder with an excel file that lists each of the file names for each bundle. So, essentially, the structure would look something like this:
    Archive of Files (all of them)Bundles (ie., singles or multiples)Type of Bundles (ie, 5, 10, 25, 50, 100, 200)Groups and excel file (ie, "62697200376 - 62697200380")Filename Folder (ie, "62697200376", "62697200377", "62697200378", etc)
    filename.eps
    filename.tif
    filename.pdf
    filename.jpg
    filename.png
    Insane.
    Anyway, what he actually sent me was 99,997 files - not "a thousand or so". So now, thanks to applescripts and automator, I have managed to:
    - separate the archive of files into bundles
    - set up the types of bundles
    - Group the files (no excel file just yet, that'll be last)
    - run applescript to create a folder for each eps file and move that eps file into it's folder
    - have a working (and tested) workflow that will duplicate and convert each eps file to a pdf and save that pdf to the same folder.
    I also have folder actions that will duplicate the pdf files as tif, jpg, and png once the pdf file is saved.
    How can I attach these folder actions to these folders? Specifically the filename folders? I know that you're supposed to select each folder one at a time and then click on "Folder Actions Setup" to choose the actions, but there are nearly 100,000 folders that I need to get these three actions attached to before I can run the workflow. I don't think I will survive the eminent implosion that I will suffer if I have to attach these folder actions to each of the 99,997 folders one at a time (and I definitely wouldn't meet my deadline of having all this done).

    Thank you all for the replies.
    So, I know I'm doing something wrong, but I just can't seem to see it. In applescript editor, I have this (based on Camelot's script above):
    tell application "Finder"
        set theFolders to every folder of (choose folder) as alias list
    end tell
    tell application "System Events"
        repeat with eachFolder in theFolders
            try
                attach action to eachFolder using "/Library/Scripts/Folder Action Scripts/Image - Duplicate as PNG.scpt"
            end try
            try
                attach action to eachFolder using "/Library/Scripts/Folder Action Scripts/Image - Duplicate as JPG.scpt"
            end try
            try
                attach action to eachFolder using "/Library/Scripts/Folder Action Scripts/Image - Duplicate as TIFF.scpt"
            end try
        end repeat
    end tell
    First, I tried it without the try / end try but it kept telling me that it didn't understand the attach action message. After I added the try / end try, it goes through but the actions do not get attached and I get an error number -1708 like this:
    tell application "System Events"
        attach action to alias "[removed]:Bundles:5:first copy:62697200376 - 62697200380:UPC (A).62697200376:" using "/Library/Scripts/Folder Action Scripts/Image - Duplicate as PNG.scpt"
            --> error number -1708
        attach action to alias "[removed]:Bundles:5:first copy:62697200376 - 62697200380:UPC (A).62697200376:" using "/Library/Scripts/Folder Action Scripts/Image - Duplicate as JPG.scpt"
            --> error number -1708
        attach action to alias "[removed]:Bundles:5:first copy:62697200376 - 62697200380:UPC (A).62697200376:" using "/Library/Scripts/Folder Action Scripts/Image - Duplicate as TIFF.scpt"
            --> error number -1708
    The folder "First Copy" is a backup I made of some of the files; there are 200 folders in there, each containing 5 subfolders, and in the subfolder is the actual eps file. I figure if I can make something work on this small backup I can make it work on the actual folders / subfolders.

  • Folder action delay until done

    I run a video encoding software called Episode Engine, and what it does is while encoding a video, it kicks out a temporary file in the output folder with a file size of 0. It does not actually update the filesize until encoding is complete.
    What I want to do is set a folder action to an output folder (which receives up to 5 videos at a time from encoding) that uploads the file automatically to a Transmit (FTP Client) favorite. I also want to account for the fact that I may drop large files in this folder as well, which could take time, but dont stay at 0 file size until the transfer is done. The part I'm having trouble with is delaying the transmit action until the file is done encoding. What I currently have does not work. And I dont know any way to monitor a folder action workflow, so I'm not sure where it's failing. Any recommendations?
    p.s. We're still running 10.6.8 on this computer (I know, I know...)
    property DELAY_TIME_SECONDS : 5 -- How long to wait between checking file size.
    on adding folder items to thisFolder after receiving theItems
         repeat with f in theItems
                             set currSize to 0
                             set oldSize to 0
                             set newSize to -1
                             repeat while currSize is 0
                                            delay 2
                                            set currSize to size of (info for f)
                             end repeat
                             repeat while newSize is not equal to oldSize
                                            -- Get the file size.
                set oldSize to size of (info for f)
                delay DELAY_TIME_SECONDS
                 -- Sample the size again after delay for comparison.
                                            set newSize to size of (info for f)
                             end repeat
         end repeat
    end adding folder items to

    Folder Actions has some built in support for recognizing 'busy' files, but it's not too intelligent.  It works well with Finder moves and copies, not so well with other things.  There are three ways I can think of to solve this problem.
    Tweak your script with a test for temp files so that it skips them.  This may cause secondary headaches (e.g. you skip a temp file, but Lightroom finishes the job in the ten second throttle period so the creation of the the file(s) you want to move is missed by folder actions), but there's no way to tell unless you try.
    Drop Folder Actions and set up a QueueDirectories launch agent.  This would wait for items to be added to the folder then move and delete them - you write the script to idle until temp files are done processing.
    Forget about immediate gratification and write a LaunchAgent that will sync the folders hourly using rsync.
    Which would you prefer?

  • Syncing folders with automator

    Hello,
    I would like to sync two folder and tried it with that http://www.apple.com/downloads/macosx/automator/syncfolders.html
    This works fine, but I need that the contents of these two folders is checked regarding certain file extensions and then sync it.
    How could I do this?
    Thanks in advance
    Christian

    Terence Devlin wrote:
    You can use
    1. Folder Actions and AppleScript
    or
    2. Automator Actions
    or
    3. an app like Hazel
    to watch a folder and perform certain tasks when a change is detected - like importing to Aperture.
    Thank you. That is helpful. Where can I get these scripts?
    However, matching versions is another matter. There is no file for a version, it's simply an entry in the database. Do you really want to export every version as a jpeg/tiff ?
    Sometimes, I would like to export the versions to have them as JPEGs. I know that Aperture was designed to manage versions in an incremental fashion. But sometime, I would like to have this option (For my PS3 to see the files [I know that you can sync your aperture library] or for my wife's Windows laptop to see the files etc...).
    Rather defeats the purpose of Aperture.
    Regards
    TD
    You can use
    1. Folder Actions and AppleScript
    or
    2. Automator Actions
    or
    3. an app like Hazel
    to watch a folder and perform certain tasks when a change is detected - like importing to Aperture.
    However, matching versions is another matter. There is no file for a version, it's simply an entry in the database. Do you really want to export every version as a jpeg/tiff ?
    Rather defeats the purpose of Aperture.
    Regards
    TD

  • How to fix Folder Actions Dispatcher quit unexpectedly error?

    Immediately after installing OS X Yosemite on my iMac, I have kept receiving the above error message before doing anything and although I ignore or cancel it continuously keeps coming back. I can't find any settings for 'folder actions' at all...javascript:;javascript:;

    Control-Click on Any Folder -> Service -> Folder Action Setup
    Click on [Cancel] to dismiss the "Choose a Script to Attach:"
    That will leave you with the Folder Action Setup, which should list all the folders that you have Folder Actions set on (Note: Dropbox or some other file syncing service may be using Folder Actions.
    I do not have any Folder actions, which is why my screen shot does not show anything

  • Folder Actions still unreliable in Snow Leopard

    Hello everybody,
    I used to give folder actions a try in Tiger, then in Leopard and now in Snow Leopard I still see that in terms of reliability, folder actions still seem to be useless - at least to me.
    Yesterday I created a folder action in Automator which is intended to just *move files* that have been downloaded with Safari in the Downloads folder, to another folder, nested in the Downloads folder itself.
    So for example when I download a file with a .rar .dmg .iso .zip extension, it should move it to the next folder "archives" where a similar folder action awaits the files to be moved according to their "type" in the next folders (rar, dmg, iso and zip). The same thing for images, music and movies.
    It works for a few files, but then for some reason (the holy Apple gods know why) it gets picky or lazy if you like : it just doesn't work 100%. I can manually drag out the files it didn't "act upon" and redrop them in the folder - still no joy.
    And I noticed a flickering or blinking of the finder window. Really weird....
    So I fire this out in hope that some of you share the same frustration
    Maybe somebody knows how to fix this.
    Or maybe I'm doing something wrong..
    cheers
    X
    Message was edited by: xanvertin

    Thanks for the quick and helpful reply!
    I also thought that incomplete files downloaded through Safari could mess up things, but it seems to be a general issue the way the folder script "asks for the files". I tried the same folder action in a different folder, where I manually drag 'n dropped several files manually in it - still no joy. 49 out of 100 files just stayed put. It's so frustrating.
    And I believe such thing as folder actions is tremendously useful if it "just works" - I download so many files on daily basis at my University - wether it is PDFs, photos, music whatever - that after a while the whole idea of "Stacks" and Coverflow in the Downloads folder just becomes a real useless pain. You just can't find anything through browsing. Sure you could search - if you know what to search for - but almost every file nowadays in the Net has a cryptic file name. So if I look for "applepie" the real file turns out to be "3934iiijpjfedi923.jpg
    folder actions could at least help us get things more "organized"
    but..
    nope.
    I just found out that my folder action has a problem with "hidden extensions"...
    oh dear...
    i think I'll stick to my wasted hours of cleaning up my mac on sundays...

  • Syncing a moved folder is not bringing back all the photos to Lightroom

    I have moved and renamed a folder in the external harddrive. Syncing that moved folder in lightroom is not working in bringing back all the photos to Lightroom - Although all the photos exist in that folder as I have confirmed through windows explorer.
    Another Option: If I choose "import photos to this folder option" in LR and browse to the source to that folder - the missing photos are shown as shaded back and the import button (bottom right corner) is not highlighted. Therefore I cannot select these missing photos and hence cannot import them to the folder.
    PLEASE ADVISE!

    In the Folders Panel, the original folder should be listed with a "?" mark, because Lightroom can no longer find it. Right-click on it, select "Find Missing Folder", then browse to and select the renamed folder in its new location.
    Note....these type of problems will continue to happen if you continue to rename and/or move folders or files outside of Lightroom. Do it using Lightroom and no such problems will arise.

  • Unzip/Unstuff Folder Action

    I wanted to set up a folder in which a file would automatically unzip/unstuff once it is done downloading from an FTP site, and V.K. in the Automator board showed me this applescript:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #ADD8E6;
    overflow: auto;" title="this text can be pasted into the Script Editor">
    property DELAYTIMESECONDS : 5 -- How long to wait between checking file size.
    on adding folder items to thisFolder after receiving theItems
    repeat with f in theItems
    set oldSize to 0
    set newSize to -1
    -- When newSize equals oldSize, it means the copy is complete because the size hasn't changed.
    repeat while newSize ≠ oldSize
    -- Get the file size.
    set oldSize to size of (info for f)
    delay DELAYTIMESECONDS
    -- Sample the size again after delay for comparison.
    set newSize to size of (info for f)
    end repeat
    -- Do your processing here on file f.
    tell application "Finder" to open f
    -- thats where my processing should start for each file
    end repeat
    -- Or start processing here to wait for all files to be complete.
    end adding folder items to</pre>
    I attached it to a folder, and it works, but only on the first file. If I let multiple files download concurrently, the script never kicks in for the second, third, etc. file. Can the applescript be modified so that it hits every file that is, eventually, saved to the folder?

    The problem is that the folder action gets triggered the minute something gets added to the folder. This works when everything is added at once, but if there is much of a time delay between adding items there can be a problem, since repeatedly firing off the same folder action script on the same folder with different items doesn't seem to work very well.
    Another thing to try would be to just look at the folder itself to stop changing size. After the folder has stopped changing size (presumably because the files have finished downloading), all of the files would then be processed. The items would need to be moved somewhere during the processing, so that the next time the folder action is triggered, it would just be processing the new items (if the processing just gets all of the files, a sub folder could be used).
    The following folder action is similar to what you were using, it just looks at the folder size.
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #FFEE80;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    on adding folder items to thisFolder after receiving theItems
    if (WaitForFilesToCopy into thisFolder for 60) then
    tell application "Finder"
    set theItems to (files of thisFolder) as alias list -- get a new item list
    end tell
    repeat with anItem in theItems
    -- do stuff with anItem
    end repeat
    else
    -- the downloads didn't happen in time
    end if
    end adding folder items to
    to WaitForFilesToCopy into TheFolder for TimeToWait
    waits up to the TimeToWait for files to be copied/downloaded to TheFolder
    the test is based on the size of the folder not changing after several seconds
    the rough TimeToWait may need to be adjusted if copying several files/folders
    parameters - TheFolder [mixed]: the folder to check
    TimeToWait [integer]: a maximum timeout value in seconds
    returns [boolean]: true if copy/download finished, false if timeout
    set {Possible, Interval} to {false, 3} -- change the check interval as desired
    set CurrentSize to size of (info for TheFolder) -- get initial size
    repeat (TimeToWait div Interval) times -- check every Interval seconds
    delay Interval
    set NewSize to size of (info for TheFolder) -- recheck size
    if (NewSize is equal to CurrentSize) then
    if Possible then -- no change since last time
    return true -- success
    else -- one more time...
    set Possible to true
    end if
    else -- update size & Possible switch
    set {CurrentSize, Possible} to {NewSize, false}
    end if
    end repeat
    return false -- fail (timeout)
    end WaitForFilesToCopy
    </pre>

  • Creating a simple Folder Action

    Hello, I am trying to make a simple folder action.
    Well first off I have all my applications stored in the "application" folder (Mac MD>Applications) and I have aliases to all the apps stored in a separate application folder in which I have arranged the apps by type. One folder I have is called "new apps" (Mac HD>Users>Me>Applications>New Apps) it contains obviously new applications I have downloaded and have yet to try out.
    *What I want to do is whenever I drag a new application to the new apps folder I want it to 1) make an alias of that application and then 2) move the application to my actual "applications" folder.
    I went to automator and selected "New Aliases" and selected the new apps folder for its location to be made, and then followed it by "Move Finder Item" and selected my applications folder. I then saved it as a folder action attached to my new apps folder... It doesn't work. Yes folder actions are enabled. Is there something else I need to do for the folder action to actually pass the new files added into the folder into the script? thank you much
    Sean

    Spotlight can search for a color label but you must make that an active search criterion. Open a new Smart Folder in the Finder. Click on the + button to the right of the Save button. From the drop down menu that displays "Kind" select Other. Scroll down the list until you find the "File label" entry and then check the box to the right of the item. Click Close button. Now you should see the drop down menu has the "File label" selection followed by the color options. Select the "Green" color.
    Now, Spotlight will find files with a green label, but it may not display folders with the green label. I've not tested that. If it does not locate folders with a green label, then you will need to set the color of the files in the green labeled folders to the green label.

  • Folder actions no longer works after migration

    The script below was working perfectly on an iMac G4. I use it as a type of print spooler for a DOS application that runs in Dosbox for OS X (also works for OS9 apps). I just send the file to the monitored folder and the script prints the contents and deletes the file from the folder.
    I moved to an iMac G5 and used Setup Assistant to transfer my system (no lectures please...). Configure Folder Actions indicates that the script is enabled for the particular folder. However the Folder Action is no longer triggered when I add files to the monitored folder. I have tried repairing permissions, recompiling the script, deleting the folder and creating a new one...
    Is this a quirk of migration?
    on adding folder items to this_folder after receiving added_items
    delay 20 -- time for job to finish?
    repeat with each_item in added_items
    tell application "Printer Setup Utility" to open each_item
    delay 40 -- time before file is deleted from folder
    tell application "Finder" to delete each_item
    tell application "Printer Setup Utility"
    quit
    end tell
    end repeat
    end adding folder items to

    Michael,
    That script seems to work here.
    You could check whether the script is actually attached by using the Folder Actions Setup utility which is located here:
    ~/Applications/AppleScript
    This utility gives you all the folders and their attached scripts in one window.
    You might also want to check to see whether locating your script in the following location helps:
    ~/Library/Scripts/FolderActions
    as that is where the utility wants them to go when you are attaching a folder action script to a folder.

  • Folder Actions will not work - tried everything

    Recently Folder Actions simply stopped working on 10.6.4. They worked fine before then recently just stopped working.
    I've tried everything I can think of, including:
    1. completely removing enabling & disabling & enabling folder actions through the setup app.
    2. trashing folder actions plist files in user domain and relaunching
    3. disabling related launchd processes with lingon
    4. trashing launch agents in user domain and also trying to unload them in terminal
    5. trying to kill the folder actions dispatcher process in activity monitor (just relaunches, as it should)
    6. emptying system caches including dyld shared cache using cocktail
    7. doing most of the above and restarting
    It's driving me nuts. Any other ideas?
    here's some entries from syslog:
    8/2/10 9:31:37 AM com.apple.launchd.peruser.501[269] (com.apple.FolderActions.folders) Throttling respawn: Will start in 6 seconds
    8/2/10 9:37:29 AM Folder Actions Setup[4403] * WARNING: Method selectedRowEnumerator in class NSTableView is deprecated. It will be removed in a future release and should no longer be used.
    8/2/10 9:43:37 AM com.apple.launchd.peruser.501[269] (com.apple.FolderActions.enabled[309]) Exited: Killed
    8/2/10 9:46:23 AM [0x0-0x3a03a].com.apple.systemevents[360] com.apple.FolderActions.enabled: Already loaded
    8/2/10 9:52:07 AM Folder Actions Setup[1083] * WARNING: Method selectedRowEnumerator in class NSTableView is deprecated. It will be removed in a future release and should no longer be used.
    8/2/10 9:52:16 AM com.apple.launchd.peruser.501[269] (com.apple.FolderActions.folders) Throttling respawn: Will start in 7 seconds
    8/2/10 9:53:02 AM com.apple.launchd.peruser.501[269] (com.apple.FolderActions.folders) Throttling respawn: Will start in 1 seconds
    8/2/10 9:56:18 AM com.apple.launchd.peruser.501[269] (com.apple.FolderActions.folders) Throttling respawn: Will start in 10 seconds
    8/2/10 10:00:58 AM Folder Actions Setup[2190] * WARNING: Method selectedRowEnumerator in class NSTableView is deprecated. It will be removed in a future release and should no longer be used.
    8/2/10 10:01:01 AM com.apple.FolderActions.enabled[2236] launchctl: Error unloading: com.apple.FolderActions.folders
    8/2/10 10:01:30 AM com.apple.launchd.peruser.501[269] (com.apple.FolderActions.folders) Throttling respawn: Will start in 10 seconds
    8/2/10 10:01:42 AM com.apple.launchd.peruser.501[269] (com.apple.FolderActions.folders) Throttling respawn: Will start in 9 seconds
    8/2/10 10:05:03 AM sudo[2622] lryter : TTY=ttys000 ; PWD=/Users/lryter ; USER=root ; COMMAND=/bin/launchctl unload -w /Users/lryter/Library/LaunchAgents/com.apple.FolderActions.enabled.plist
    8/2/10 10:10:25 AM Folder Actions Setup[676] * WARNING: Method selectedRowEnumerator in class NSTableView is deprecated. It will be removed in a future release and should no longer be used.
    8/2/10 10:10:27 AM com.apple.FolderActions.enabled[680] launchctl: Couldn't stat("/Users/lryter/Library/LaunchAgents/com.apple.FolderActions.folders.plist"): No such file or directory
    8/2/10 10:10:27 AM com.apple.FolderActions.enabled[680] nothing found to unload
    8/2/10 10:10:38 AM com.apple.launchd.peruser.501[268] (com.apple.FolderActions.folders) Throttling respawn: Will start in 8 seconds
    8/2/10 10:13:17 AM sudo[943] lryter : TTY=ttys000 ; PWD=/Users/lryter ; USER=root ; COMMAND=/bin/launchctl unload -w /Users/lryter/Library/LaunchAgents/com.apple.FolderActions.enabled.plist
    8/2/10 10:14:01 AM com.apple.launchd.peruser.501[268] (com.apple.FolderActions.folders) Throttling respawn: Will start in 4 seconds
    8/2/10 10:14:14 AM com.apple.launchd.peruser.501[268] (com.apple.FolderActions.folders) Throttling respawn: Will start in 1 seconds

    I finally go Folders Action to work, after being unable to use it even for a simple beep for years now.
    Here is what I did:
    1. Changed permissions to 755 for the following folder and two contained files (note that 775 didn't work for me)
    ~/Library/LaunchAgents/
    ~/Library/LaunchAgents/com.apple.FolderActions.enabled.plist
    ~/Library/LaunchAgents/com.apple.FolderActions.folders.plist
    2. Changed the following lines within ~/Library/LaunchAgents/com.apple.FolderActions.enabled.plist (using TextWrangler)
    from:
    <key>OnDemand</key>
    <false/>
    to:
    <key>OnDemand</key>
    <true/>
    Prior to the permissions changes within #1 above, the value of <true/> kept getting changed back to <false/> by something in the system... and though
    there was improvement by the permissions changes, the following console message appeared until false was changed to true.
    com.apple.FolderActions.enabled[4127] launchctl: Error unloading: com.apple.FolderActions.folders
    At this point true is staying true, and not being changed by unknown forces to false, and the above message is not appearing.
    3. The only other thing I did prior to #1 and #2 above, was to run the script (unsaved),
    tell application "/System/Library/CoreServices/Folder Actions Dispatcher.app" to tick
    This little tell line caused something to occur where my Folder Action surprised me and worked for the first time though it took about 30 seconds and was erratic,
    sometimes performing, sometimes not, though if I would do move something into the folder to trigger the action that should occur, and did not occur, then at the point
    running the above tell line or script would cause the action to occur.
    4. At this point I don't fool with the tell line or script from #3, and it seems that systemevents has gotten involved, as well as launchd, and with my simple Folder Action script
    I'm getting the folder action within 10 seconds compared to 30 to 45 if ever seconds.
    5. This is still too early to tell if this is the wonder pill I've needed since Leopard, and now Snow Leopard (and maybe Tiger as well: I forget when I even tried Folder Actions).
    There was a time when I moved things around, so that the items normally found in the former AppleScript folder, were placed elsewhere in subfolders, so I don't know if that lead to this...
    because I could get Folder Actions to work on Macs in the Applestore, but not my own Mac. Watching the console messages was helpful. I don't think it's a big concern that
    deprecated messages are found sometimes. That's a just a normal part of the constantly rebuilding of things that goes on. It's more like a reminder that we've got an upgraded
    OEM part were going to start using, and the older part won't be available after such and such date, so program accordingly, and in the meantime drive.

Maybe you are looking for

  • How do I fix game resolution error?

    I recently bought the Lego Lord of the Rings game from the app store, but everytime I try to play it my screen goes black and gives the message "This resolution is not supported" . I can't change the resolution, because I can't see the menu. I have t

  • Daisy-chaining a ethernet hub to the time capsule

    I am using all three of my wired ethernet ports on the time capsule, and I need a fourth.  Current set up is 1) Vonage VoIP adapter; 2) printer w/o wireless option; and 3) connection to a EoPL adapter. I was wondering if I can buy a cheap ethernet hu

  • ComboBox Highlighting

    Hi Guys, Is it possible to highlight a JComboBox even when an item is not selected? I need to show focus within the JComboBox when a user tabs to it. -Sri :)

  • Test O365 with a few users..

    Hi We are a high school which will soon go for a complete O365 E3 rollout.  But I would like to test the setup and test the features in a small environment first.  We have our current web site in Joomla with our ISP and don't plan to move that over t

  • Server Preferences - Services buttons grayed out

    Hi, I have 10.6 server. In the Server Preferences window under the tab "Services" I have the list of services available on my computer (File Sharing, Address Book, iCal, etc.) For some reason, all radio buttons are selected and grayed out with the ex