Create folder action in automator

I want to create a folder action that will move downloaded website backups into a specific folder.
I cribbed the automator folder action shown below from Macworld
The Folder Action appears not to work when left to just monitor the folder.
However, if I force the Action to run from within automator it works, albeit with an error message at the beginning saying that you can't execute the action from within Automator. Still it finds the file and moves it to the intended destination.
By way of checking this I looked at the "Set Up Folder Action" by right clicking on the downloads folder. After clicking there is a long delay but when the panel opens there is no content, see second image below. I tried clicking the + button to add the "Downloads" folder but after a long delay the "Open" dialog closes and nothing has appeared in the panel. I assume that any folder action should show up in this panel, but I've no experience in using it.
Any suggestions as to a problem with the Action or why the panel is blank and why I can't attach the Action using this setup panel?
Thanks
Folder Action
Note: Path and File have been omitted.
Note: OS X 10.10.2
Folder Action Setup

I'm confused. You showed two Automator actions with the same name, one was a folder action one wasn't.
Are you sure the correct Automator action (the one that is a folder action) is attached to the folder?
If when the Folders Action setup window is opened and you select Articles_Folder.workflow and then edit script are you getting the right workflow?
Assuming you do I would start off very simply. Try this:
It will label green screen shot image files saved to the Desktop.
See if this works for you.

Similar Messages

  • System Events create Folder Actions stop suddenly

    Hello
    I has implemented a applescript in order to backup files to a external HD using folder actions
    This script attaches the same script in each new folder recusively, and it adds a new one Folder Action with the same name of the folder.
    1 - When a use the Finder to copy around 4000 files and 500 folder, the folder action list increases slowly, but i did not had so much patience to wait the proceeding to complete.
    2- When i use the automator with  shell script action execution, to copy the files and folder, the process finalizes with success, but the folder action list stops with 10 items instead of 569, that is the number of folders and subfolders. So i do not know what is happening...
    3- So I changed the automator action to execute a applescript that executes a shell script, the folder action list stops with 200 folder action approximately. So i do not know what happen too.
    What can i solve this backwardness problem?
    There are a limit of amount to create of folder action  ?

    There are another user with tha same problems: BookOfPower
    https://discussions.apple.com/thread/1233099?start=15&tstart=0
    Because applescript is not reliable ?

  • Create folder sync with automator

    I have a few machines runnign 10.4.11 in our office that we are trying to back up to a NAS.
    However, I can't seem to get any sort of workflow via Automator to work. Does anyone have any advice on how to set up a workflow that creates a weekly backup? On my iMac (10.6.8) Automator has a really easy setup for this, but 10.4.11 is quite a bit different and I can't figure it out.
    Thanks!

    Hi Benjamin,
    I think have iCal weekly execute an Applescript that backs up the folder is the way to go in 10.4.x

  • How to set up Automator Folder Actions?

    I have set up and sucessfully tested a workflow which sends any file found in a particular folder to the "paperless" app, then moves all files to a different folder called "Archived attachments".
    HOWEVER as a folder action,  nothing happens when a file is put into the folder. The file just sits there in the folder.
    To create a folder action I opened  "new folder action" in Automator, then dragged and dropped the working workflow file into the workspace, then set "Folder Action recieves files and folders added to" the appropriate folder, let's call it "Attachments".
    Just to complicate things, the files are placed into the "Attachments" folder using an applescript that captures all pdf mail attachments. This applescript works succesfully.
    So, where could I be going wrong?
    The working workflow "Attachments.workflow" consists of:
    Get Specificed Finder Items
    Make Sequential
    Get Folder Contents
    Open Finder Items
    Get Folder Contwents
    Label Finder Items
    Get Folder Contents
    New Dated Folder
    The erronious Folder Action consists of:
    Run Workflow (Attachments)
    In folder actions setup:
    "Enable Folder Actions" is ticked
    "PDF Attachments" folder is ticked
    "Attachments_folder.workflow" script is on.

    I'm confused. You showed two Automator actions with the same name, one was a folder action one wasn't.
    Are you sure the correct Automator action (the one that is a folder action) is attached to the folder?
    If when the Folders Action setup window is opened and you select Articles_Folder.workflow and then edit script are you getting the right workflow?
    Assuming you do I would start off very simply. Try this:
    It will label green screen shot image files saved to the Desktop.
    See if this works for you.

  • Automator Folder Actions - Use filename as subject in email

    I regularly email .pdf atttachments to my head office. These are hand-written sales orders which are scanned in. The scanner software gives each file a sequential filename (eg. OrderNo_110612).
    I have set up a Folder Action in Automator to create a new email and send the file as an attachment when it is added to the folder.
    Get Selected Finder Items
    New Mail Message
    Send Outgoing Messages
    I would really like to add the filename to the subject of the email. Is there a script I can run within the 'Run Shell Script' action that will extract the filename and can then be used as a variable in the subject field? This would allow both myself and head office to easily find the email at a later date should the need arise.
    Any help would be gratefully received. I am not a programmer, although I understand the principle of variables etc..
    I am using OS X Lion 10.7.2
    Any help would be really gratefully received.
    Many thanks

    sorry, spaced.
    on run {input, parameters}
              tell application "System Events"
                        return name of first item of input
              end tell
    end run
    P.s. this only work for the first filename.  if you want the names of multiple attachments it needs to be revised a bit.

  • Using Automator Folder Actions

    I have an automator folder action that runs to take any pdf file dumped in to the folder, send to the printer and then delete it.
    How do I make this run on a server that I'm not logged in to (effectively as a service), so that if a pdf file is generated somewhere on the network (maybe even a PHP script on a web site hosted on this server) and copied to this folder it still auto prints to the network printer?

    I'm using a hot folder to import to Aperture as well, and also had the same problems when I try to configure it.
    I solve it by creating an action in Automator that will copy all the images from the memory card to a temp folder when a card is inserted in the card reader. At the end of the action all the files inside the temp folder are moved to the actual hot folder, as you said this is almost instant so works perfectly.
    So basicly the workaround is the following:
    Card inserted - Image capture starts and copy all the images to a temp folder - Images then move to Aperture's hot folder - Aperture gets all the images.

  • 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...

  • Folder action to find and replace text and change line feeds

    I want to use a folder action to find and replace text and change Mac carriage returns to DOS line feeds inside text files.
    The text to be replaced is: "/Users/wim/Music/iTunes/iTunes Music/Music" (without the quotes)
    This text has to be removed (i.e. replaced by an empty string)
    The text occurs many times within each file.
    The files are playlists exported from iTunes in the M3U format (which are text files). They contain Mac carriage returns. These need to be changed to DOS line feeds.
    I have found the following two perl commands to achieve this:
    To find and replace text: perl -pi -w -e 's/THIS/THAT/g;' *.txt
    To change carriage returns to line feeds: perl -i -pe 's/\015/\015\012/g' mac-file
    I know that it's possible to make a folder action with Automator that executes a shell script.
    What I want to do is drop the exported playlists in M3U format in a folder so that the folder action will remove the right text and change the carriage returns.
    My questions are:
    Is it possible to make a folder action that executes command line commands instead of shell scripts?
    What is the correct syntax for the two commands when used in a folder action shell script? Especially, how do I escape the slashes (/) in the string to be removed?
    Thanks for your help

    Ok, I've include an applescript to run a shell command. The applesript command quoted form makes a string that will end up as a single string on the bash command line.  Depending on what you want to do, you may need multiple string on the bash command lines.  I've included some information on folder actions.
    It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on.  Here is an example.
        Author: rccharles
        For testing, run in the Script Editor.
          1) Click on the Event Log tab to see the output from the log statement
          2) Click on Run
        For running shell commands see:
        http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
    on run
        -- Write a message into the event log.
        log "  --- Starting on " & ((current date) as string) & " --- "
        --  debug lines
        set desktopPath to (path to desktop) as string
        log "desktopPath = " & desktopPath
        set unixDesktopPath to POSIX path of desktopPath
        log "unixDesktopPath = " & unixDesktopPath
        set quotedUnixDesktopPath to quoted form of unixDesktopPath
        log "quoted form is " & quotedUnixDesktopPath
        try
            set fromUnix to do shell script "ls -l  " & quotedUnixDesktopPath
            display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
        on error errMsg
            log "ls -l error..." & errMsg
        end try
    end run
    How to set up a folder action.
    1) right click on folder. click on Enable folder actions
    2) Place script in
    /Library/Scripts/Folder Actions Scripts
    3) right click on folder. click on attach folder action
    pick your script.
    Create a new folder on the desktop & try.
    You can put multiple folder actions on a folder. There are other ways of doing this.
    Here is my test script:
    on adding folder items to this_folder after receiving dropped_items
        repeat with dropped_item_ref in dropped_items
           display dialog "dropped files is " & dropped_item_ref & " on folder " & this_folder
        end repeat
    end adding folder items to
    How to  make the text into an AppleScript program.
    Start the AppleScript Editor
    /Applications/AppleScript/Script Editor.app
    In Snow Leopard it's at: /Applications/Utilities/AppleScript Editor
    Copy the script text to the Applescript editor.
    Note: The ¬ is typed as option+return.  ption+return is the Applescript line continuation characters.
    You may need to retype these characters.
    Save the text to a file as an script and do not check any of the boxes below.

  • Create multiple folders in automator

    i cant seem to crack this there seem to be many applescripts out there but cant find one as basic as my needs, am trying to create a subfolder system within a folder to sort out work, id like to be able to do the following:
    tell automator to create x folders within folder with prefix xyz + sequential numbering ie. project001 project002 etc.
    i know it sounds basic and probably is but have been googling away without any joy and the create folder option in automator only makes one at a time which defeats the point.Have also tired the get items and rename but it doesnt want to change folders. any and all help greatly appreciated

    this is easily handled by apple script action.
    say the following will work.
    1. get selected (or specified) finder items.
    put the folder where you want to create all these subfolders here.
    2. run apple script
    <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">
    on run {input, parameters}
    repeat with i from 1 to 10
    tell application "Finder"
    make new folder at input with properties {name:"xyz" & i}
    end tell
    end repeat
    end run</pre>
    the above makes 10 subfolders. adjust that as you like.

  • Folder Action Start up - beach ball of death

    The subject says it all.  I can't turn on folder actions because it always ends like this.  Does this work for anyone?

    Are these Folder Actions ones that you have created, or the standard actions provided by the system? Automator saves Folder Actions that you create as workflows (packages) stored here with normal permissions and user/group ownership as you. If you tried to roll your own outside of Automator, it may be the source of your problems, whether by location or permissions, or more bad luck.
    homedir/Library/Workflows/Applications/Folder Actions/
    Here is what works via example:
    I wrote a UNIX Bash shell script that converted specific types of files based on their extension into html files. This script also called on AppleScript to show an alert dialog listing the illegal files (if any) that were also detected. I wanted to attach this script to a Desktop folder so that I could drag and drop n-files for conversion.
    I launched Automator and chose Folder Action. Then I choose Utilities > Run Shell Script. Dragged the latter onto the Automator workspace to the right. The settings for this action looked like the following (click to enlarge):
    At the top you see the folder that I will attach the action too. And on the right, I chose input as arguments, because my shell script is reading from its command line.
    The full shell script is pasted into the action. The normal shell shebang invocation is removed under these circumstances. Then you tell Automator to save the Folder Action, and exit automator.
    Now, you right-click on the target folder, and at the bottom of the menu, is the Folder Actions Setup...
    For mine, this is what the dialog should look like.
    The Actions folder is irrelevant as it is a test folder for actions. I called my Desktop folder - file2html, and the Folder Action that Automator saved, was called file2html.workflow.
    And here is the shell script that went into the folder action:

  • Chained Folder Actions

    I am getting a headache by now trying to figure out how to do a fairly simple thing...
    I have created applesript that sorts my download folder
    So i have couple of folders in there and any file that goes into
    downloads folder is moved to coresponding folder based on extension
    say i have 4 folders
    -Media
    -Text
    -Install Disks
    -Other
    i then decided to take it one step further
    and created folder action that takes files in a given folder and
    puts them in a folder with corresponding date
    so to put it simple say there is blah_blah.mp3 that i copy to downloads folder
    my two scripts idealy if they would cooperate should work like this
    ___________________________\/ DateSort folder action \/
    "Download folder" -->> "media folder" -->> "\[current date\] folder"
    ___\^download folder action\^
    the problem thought they work separately but when i use them together
    as i described... "DateSort" for some reason does not enter
    ^repeat with this_item in added_items^
    to be honest added_items it such use case is blank for unknown reason...
    And the question that is bothering me is WHYYYYYYY?
    (because if simply put a file into "media folder" it works like charm...)

    I know it is very late to reply... But my attemps to create a chained folder script system did not work very well, and i just ended up baking the operations from the second script into the first.
    Seems like on *new folder item* does not handle files placed by another apple script. Further working on it I've forsaken the idea of using folder script paradigm alltogether, It is very unreliable. Especially so when trying to deal with download folder. There are clashes all over the place. For example i dont want to touch safari/chrom download chache files, but If I dont treat them the first time around the script will never touch them again.
    So I ended up writing an app that does all this and have it being triggered by launchd every so often. Much easier to handle. If you are still inrpterested i can give you my current version. It has much cleaner code, and it finally works without a hinge.

  • Issue with folder action created with automator

    Hello all,
    I'm having an issue with folder actions that i created with automator and it's driving me crazy. Apple says they can't help with things created by the user so this is my only shot at figuring this out.
    Running a Mini 2.3G quad i7, 8GB ram on OSX Mavericks 10.9.2
    My goal is to set up an action to add text to the filename of a file placed into a particular folder. So I open automator and choose folder action. Then I choose the folder I want the action applied to at the top. Then I go to Files and Folders in the library and choose rename finder items and drag it over to the workflow. I select add text, then add the text I want added to the file name and choose before name because I want the added text to preceede the original filename text. I save it then go to the folder I applied it to and right clikc go to services then folder actions and verify that the service is attached to that particular folder and it is.
    Should work right? No. When I place a file in that folder the action runs and adds the text like I want it to... but then it starts to add it over and over again in an infinite loop. It also adds a file with the extension .ds_store to the folder that also has the name added over and over.
    I've tried deleteing all the folder actions and even deleteing all the folder actions themselves saved by the automator in the workflow file in the user library.
    I'm stumped... no idea what to do. A while ago I had used the automator to batch rename files and it worked perfectly. I tried the same steps i listed above to set this action up on a machine in an Apple retail store and it worked... so I know I have the set up right.
    Any help is greatly appreciated.
    Thanks,
    Justin

    Hi JK257
    This is why it happens:
    The folder action is looking for new items in the folder. You drop in a file called "File1". So it renames it "sometext File1". Then it sees this new file called "sometext File1" and thinks "Hey, this is a new file - I'll call it 'sometext sometext File1' because I have to rename every new file." Then it sees this new file called "sometext sometext File1" and thinks...
    You get the picture.
    (the .ds_store is a normally hidden database file which is getting revealed by the same process.)
    The solution is to move the files out of the renamer folder into a receiving folder after they have been renamed:
    Hope this helps,
    H

  • Help with creating Automator Folder Action

    Hi
    I want to create a folder action to empty my Caches from my both System and User Library files. I want a little help in creating the workflow. I tried to create a workflow, but the problem is it was asking for the system password when I selected the Library cache folder from my System. How can I create a workflow and save it as a plugin for my everyday action...
    thanks in advance..

    HI,
    Not sure if Automator can do that but AppleScript might. Post here for help.
    (Applications/Utilities)
    http://discussions.apple.com/forum.jspa?forumID=724
    Carolyn

  • Help Needed: Automator Applescript for Folder Action - Encode Video

    Hi !
    I have created an Automator Applescript for a Folder Action to do the following:
    When a new video file is moved to the target folder (i.e. Download of Vuze is done), automatically launch the Applescript Action that does the followin g(Applescripted):
    1) Using "run shell script" and FFMPEG on a UNIX command line, determine Width/Height, Framerate, Bitrate
    2) Calculate encoding parameters (slightly reduced bitrate, reduced Aspect etc.)
    3) Using "run shell script" with ffmpeg on the command line and the calculated parameters to encode the video file
    At the same time, the action is written to a log file so I know if a file is recognized, when encoding started etc.
    It works fine if I save this Action as an .app, make an alias on the Desktop and drop video files on it.
    It also works fine if I attach the script to a folder as a folder action and drag a video file in there.
    However, when I attach the script as a folder action to the Vuze download folder, it encodes only some video files, i.e. if there was a download of 5 files, chances are good that it will not encode 1 or 2 files out of those 5.
    If for example a second download finishes while the encoding for the first download is still going on, sometimes the second file starts encoding after the first encode finishes, sometimes it does not, the file does not make the log file at all, i.e. the folder action missed it or the automator action dropped it because it was still encoding. Still, sometimes it happens, sometimes not.
    As I need a solution that is 100% accurate, I would like to ask if there are any ideas on how to do this better maybe? As I am not an Applescript Guru, I would need some help to know what works and what doesn't and what the syntax is.
    My main idea right now:
    Similar to how ffmpegX works with its "process" application, have a second script (as .app) that receives the files to be encoded from the automator action and puts them in a queue, then proceeds to encode this queue while the main automator action is free to receive the next file.
    Writing this second app is quite straightforward (a modified version of my current script) but I have some questions I need help with:
    1) How do I call another applescript from within an existing applescript that launches the new applescript in a new process?
    2) How do I pass parameters to this new applescript?
    3) In case of this "Queueing" Idea, once I called the external applescript the first time, how do I make sure when I call next time, that I don't open a second instance of this script but rather pass another queue item to the original instance to be processed?
    Or in general: Is there a better way to achieve this automatic encoding solution that I have not thought about?
    Alternatively:
    Does anyone know how to call the "process" application that comes with the ffmpegX package with the correct parameters to use as a queueing / processing tool?
    Thanks!
    Joe
    Message was edited by: Joe15000
    Message was edited by: Joe15000

    To do this, I created an Automator workflow with an Applescript snippet to change the 'media kind'.
    Here is the 'Run Applescript' workflow step code:
    on run {input, parameters}
              tell application "iTunes"
                        set video kind of (item 1 of input) to movie
              end tell
              return input
    end run
    Prior to this running, I have an 'Import Files into iTunes' workflow step.
    You can switch out 'movie' with: 'TV show', 'music video', or anything in ITLibMediaItemMediaKind.
    Good luck,
    Glenn

  • Automator: Create folder from filename

    I am trying to use Automator to query a file in a foldr, then create a folder based off of the filename, then move the file into the newly created folder. I am not as savvy as I thought that I was when it comes to Automator. Even thinking that Automator might not be the correct tool for the job. Each file has a different name or this would be a lot easier. Any help would be greatly appreciated.

    You can use a Run AppleScript action to do the work, and feed items to it by using a service workflow, an Ask for Finder Items action, etc - for example:
    1) Service receives selected files or folders in Finder
    2) Get Folder Contents
    3) Run AppleScript
    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
    4) other actions as desired

Maybe you are looking for