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.

Similar Messages

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

  • Automator Folder Action Not Running

    I have created a simple automator folder action that helps me to keep my downloads folder organized.    I want to move various files with certain file exensions to specific folder.
    I am finding the process to be intermittantly successful.   Sometimes it works, sometimes it does not run.      I've looked in activity monitor but do not see the automator launcher process running.   I think that is why I am having issues.   At other times, when it does run,  the workflow hangs and I have to kill Automator Runner.
    Any ideas on helping me with automator folder actions?
    Thank you,
    Jerold

    What does Finder -> select folder -> Control-Click -> Services -> Folder Actions Setup say about your existing folder action?
    Are folder actions enabled in the setup window?
    Is your folder action attached to your folder?
    For diagnostics, create a very simple Automator folder action (such as "Ask for Confirmation"; it does not need to make sense, it just needs to be something that you can use to verify the folder action occurred), and attach that to any folder. If that works, build up to making your PDF action work.

  • Automator Folder Action

    I have an Automator Folder action attached to my Downloads folder which moves any .jpg file to another folder where I normally place my images. It works for a while (automatically moving the .jpg files whenever a file is placed in the Downloads folder) and then stops fopr no apparent reason. On occassion when I logoff and on or restart, the action will work for a limited time.
    I don't have much experience with Automator and even less with Applescript. Any help will be much appreciated.
    I use an iMac with OS X 10.9.2.
    Thanks.

    Sorry... this is not an answer to your problem. More like an addition to your question.
    How do you attach an Automator Workflow as a folder action?
    I've made a Workflow to copy all files from an iTunes' playlist to a USB device, I want it to automatically run whenever I plug in the USB device. I've left-clicked the icon for the USB device and then "attach folder action", but I don't see any script to run an Automator Workflow.

  • Apple Script to automatically apply automator folder action workflows

    Hello
         I'm trying to get an applescript to automatically apply an automator folder action workflow to a folder..
         Getting applescript to apply a scpt file to a folder as a folder action is straight forward. However, it seems that scpt files are different than automator folder action workflows..
         Normally I would just script the folder action in apple script, but this is for someone that can handle automator, but not apple script coding. This whole scripting is to solve the issue of subdirectories being creating and then files or subfolders being created there after. So we need to try to get automator folder actions to propagate though..  easy enough with applescript..
    Any help would be appreciated...

    Here is the code that I needed to happen...  Maybe I just missed something in automator... but this applescript properly applies itself to subfolders, which then allows me to apply specific scripts based on folder names and locations. Also if the subfolders already exist.. the scirpt also is applied to those.
    on adding folder items to this_folder
      createlist(this_folder)
    end adding folder items to
    on createlist(item_list)
              set ActionScript to " REMOVED FOR PUBLIC DISPLAY:ApplyScriptSubfolders.scpt"
              set the the_items to list folder item_list without invisibles
              set item_list to item_list as string
                   repeat with i from 1 to number of items in the the_items
                     set the_item to item i of the the_items
                                       set the_item to (item_list & the_item) as alias
                                       set this_info to info for the_item
                                       if folder of this_info is true then
                              tell application "System Events"
                                                                          display dialog "Attching script to " & the_item as text  --
                                     attach action to folder (the_item as text) using ActionScript
                                                           end tell
                                my createlist(the_item)
                                       end if
                   end repeat
    end createlist
    I appreciate your help.. if you now know what has to happen and have a shorter way of doing so, please do so..
    Thank you again,

  • ITunes 10.5 breaks automator folder action

    Just like itunes10 did
    osx 10.6.8
    itunes 10.5
    automator folder action with itunes tasks no longer works after 10.5 update.
    Is it the version check again?

    Unfortunately, it seems that this is a cross-platform problem between iTunes 10.5 and all NAS disks. Shared libraries on network drives worked fine under 10.4.1, but now there is just an endless loading cycle with no error message or time-out. There is a bit more about it in this thread.
    Martin

  • Automator Folder Action: File Name = Spotlight Comment?

    Hey guys,
    I'm trying to have automator add the original filename of a file as spotlight comment when it is added to a certain folder. I can only use the "Set Spotlight Comments for Finder Items" in folder actions to add a specified comment, but nothing else. Is it possible to grab the file name via applescript?
    The idea behind this is to preserve the original file names of all downloaded files before they get renamed.
    Thanks,
    V

    Thanks for your reply, I now have your action installed and it does get the filenames, but I still can't add them to the spotlight comment text box. Looks like I didn't think this through properly.

  • 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 Broken in SLS

    I may be the only person that wants to use Automator in Snow Leopard Server. However, I've found that Automator can be a great match with a server to automate tasks when shared files come in from other users.
    The problem I am having is that the Folder Actions Trigger does not work. I can setup the Folder Actions under the contextual menu but nothing fires.
    If I set this up the same way in Snow Leopard Desktop Version Folder Actions work as they should and triggers when a file is placed in the monitored folder.
    Please tell me I'm not the only person that wants to use automator and folder actions? Anyone else having trouble with Folder Actions/Automator in Snow Leopard Server?

    The update is only good for Mac's listed in this About the Performance update.
    DALE

  • Rename, New folder action using Drive CMIS connector

    I am trying to work on "Rename" and "New Folder" actions from Drive. To give more details - when I connect to our DAM using Drive, the DAM gets mounted as a network drive and can be accessed from Windows Explorer. I was told on one of the Adobe forums thread that Drive uses the Windows in-built context menus to initiate these actions.
    Refer: http://forums.adobe.com/message/3807568#3807568
    But when I try "New Folder" menu, Explorer gives me "Access denied" or "You need permission" kind of error. On "Rename" I get similar error. I believe both these errors are due to the fact that I am trying to modify certain things on a network drive. But then what would be the work around so that I can perform these actions on a CMIS server using Drive?
    We are adding CMIS layer on top of our DAM so that it will work as a CMIS server. For connection with Drive, we use the default CMIS connector that comes with it.

    Logs on "Rename" action
    2012/09/28 05:34:58,691 [IFSConnection-1] FATAL IFSConnection - NASTY Runtime exception for Request: RENAME
    com.adobe.drive.biz.filesystem.FileSystemException: java.lang.NullPointerException
        at com.adobe.drive.internal.biz.filesystem.FileSystemService.run(FileSystemService.java:1680 )
        at com.adobe.drive.internal.biz.filesystem.FileSystemService.run(FileSystemService.java:1646 )
        at com.adobe.drive.internal.biz.filesystem.FileSystemService.rename(FileSystemService.java:9 81)
        at com.adobe.drive.ifs.job.RenameHandler$1.call(RenameHandler.java:95)
        at com.adobe.drive.ifs.job.RenameHandler$1.call(RenameHandler.java:1)
        at com.adobe.drive.model.context.Context.run(Context.java:88)
        at com.adobe.drive.ifs.internal.IFSConnection.dispatch(IFSConnection.java:187)
        at com.adobe.drive.ifs.internal.IFSConnection.run(IFSConnection.java:142)
    Caused by: java.lang.NullPointerException
        at com.adobe.drive.connector.cmis.client.CMISProxy.buildQuery(CMISProxy.java:2086)
        at com.adobe.drive.connector.cmis.client.CMISProxy.query(CMISProxy.java:1987)
        at com.adobe.drive.connector.cmis.client.CMISProxy.getDescendantDocuments(CMISProxy.java:196 1)
        at com.adobe.drive.connector.cmis.client.CMISProxy.hasCheckedOutDocumentsByAnyUser(CMISProxy .java:1920)
        at com.adobe.drive.connector.cmis.handler.Handler.isCheckedOut(Handler.java:305)
        at com.adobe.drive.connector.cmis.handler.MoveHandler.execute(MoveHandler.java:95)
        at com.adobe.drive.connector.cmis.handler.MoveHandler.execute(MoveHandler.java:1)
        at com.adobe.drive.internal.data.manager.DataManager.execute(DataManager.java:3162)
        at com.adobe.drive.internal.data.manager.DataManager.execute(DataManager.java:3114)
        at com.adobe.drive.data.manager.call.AbstractFSCall.executeConnector(AbstractFSCall.java:323 )
        at com.adobe.drive.data.manager.call.Move.callConnector(Move.java:501)
        at com.adobe.drive.data.manager.call.Move.moveRemoteSource(Move.java:302)
        at com.adobe.drive.data.manager.call.MoveFinder.moveToEmptyDestination(MoveFinder.java:83)
        at com.adobe.drive.data.manager.call.MoveExplorer.moveToEmptyDestination(MoveExplorer.java:7 0)
        at com.adobe.drive.data.manager.call.Move.execute(Move.java:142)
        at com.adobe.drive.internal.data.manager.DataManager.moveAsset(DataManager.java:3892)
        at com.adobe.drive.internal.biz.filesystem.FileSystemService$12.execute(FileSystemService.ja va:998)
        at com.adobe.drive.internal.biz.filesystem.FileSystemService$FSRunnable.run(FileSystemServic e.java:1803)
        at com.adobe.drive.data.internal.persistence.PersistenceRunner.run(PersistenceRunner.java:11 9)
        at com.adobe.drive.internal.biz.filesystem.FileSystemService.run(FileSystemService.java:1666 )
        ... 7 more
    Logs on "New folder" action
    2012/09/28 05:23:42,321 [IFSConnection-1] FATAL IFSConnection - NASTY Runtime exception for Request: CREATE
    com.adobe.drive.biz.filesystem.FileSystemException: com.adobe.drive.data.model.DriveException: Error creating directory
        at com.adobe.drive.internal.biz.filesystem.FileSystemService.wrapException(FileSystemService .java:1623)
        at com.adobe.drive.internal.biz.filesystem.FileSystemService.run(FileSystemService.java:1673 )
        at com.adobe.drive.internal.biz.filesystem.FileSystemService.create(FileSystemService.java:8 67)
        at com.adobe.drive.ifs.job.CreateHandler$1.mkDir(CreateHandler.java:204)
        at com.adobe.drive.ifs.job.CreateHandler$1.call(CreateHandler.java:183)
        at com.adobe.drive.ifs.job.CreateHandler$1.call(CreateHandler.java:1)
        at com.adobe.drive.model.context.Context.run(Context.java:88)
        at com.adobe.drive.ifs.internal.IFSConnection.dispatch(IFSConnection.java:187)
        at com.adobe.drive.ifs.internal.IFSConnection.run(IFSConnection.java:142)
    Caused by: com.adobe.drive.data.model.DriveException: Error creating directory
        at com.adobe.drive.internal.data.manager.DataManager.create(DataManager.java:4434)
        at com.adobe.drive.internal.biz.filesystem.FileSystemService$10.execute(FileSystemService.ja va:885)
        at com.adobe.drive.internal.biz.filesystem.FileSystemService$10.execute(FileSystemService.ja va:1)
        at com.adobe.drive.internal.biz.filesystem.FileSystemService$FSCallable.run(FileSystemServic e.java:1767)
        at com.adobe.drive.data.internal.persistence.PersistenceRunner.run(PersistenceRunner.java:11 9)
        at com.adobe.drive.internal.biz.filesystem.FileSystemService.run(FileSystemService.java:1666 )
        ... 7 more
    There might be something wrong with our implementation as well. But I am not able to figure out where lies the problem.

  • Automator folder action won't run entire folder contents

    Hi,
    Ok, I think I'm pretty well versed in Automator and getting things to work. But this is just escaping me.
    I've made a simple Photoshop Droplet (done this before). Open Automator, built a workflow for getting a folders contents and then opening the contents with the Droplet.
    Saved this as a folder action,...
    But when I drag multiple items to the folder, it only runs the very first item and stops,...
    If I drag one by one into the folder it will work fine,....
    I'm going to have to be dragging multiples all the time, it's a waste of time to do one by one,...
    I'm totally missing something here,.... please help!!
    I'd also like to move the contents of the folder, once the Droplet has run, to the trash
    But first I have to get this darn thing to run on the entire folders contents,.....
    Workflows I've tried:
    1 - Open finder Items (open in my Droplet) works one at a time
    2 - Get Specified Finder Items (point to my folder)
    Get Folder Contents
    Open finder Items (open in my Droplet) again, works one at a time
    Thanks!!
    Christopher

    Hi Curly, and a warm welcome to the forums!
    I don't know much about Automator, and this may be of no help, but...
    It's either just picking up/passing one variable, when it either needs an array of variables, or needs to loop back for the next one.

  • 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

  • How to transfer automator folder actions

    I have set up quite a few automator actions for folders. e.g. rename all files by date when moved to Receipt folder.
    How do I migrate these actions to a new Mac? I don't want to have to manually set them up again.

    By default, automator saves folder actions as .workflows in the following folder:
    /Users/yourusername/Library/Workflows/Applications/Folder Actions/
    From the finder menu, select Go > Go the Folder...
    ~/Library/Workflows/Applications/Folder Actions/
    Copy and paste the bolded path. Your folder actions are contained here. Simply copy these workflows and upon migration, you can restore them in the same path.

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

  • Folder action to change the label of the folder

    Hi all
    I would like to use Automator/Folder Actions to set the Label of the folder to show that it contains a file that was created or modified as follows:
    Red if in the last three days,
    Orange if over three days but less than seven; and
    Yellow if over seven days but less than fourteen
    Oh, and clear the folder label if the contents of the folder are over fourteen days old.
    Is it possible to do using Automator and folder actions?
    Thanks
    Jai
    iMac G5; iBook G3; PB165c; PB170; Mac IIcx; Mac SE/30; Mac SE; Mac Plus; Newton 130; 2gen iPod 10G     Mac OS X (10.4.7)   MacUser since 1984... and waiting for a tablet (like the Nokia 770 with MacOSX)

    In Automator-No
    The trigger for folder actions to run is the act of adding a file/folder to the folder which has the action applied. If you don't add anything, they won't do anything.
    You could probably get close to what you want using Smart Folders. It won't be color-coded or perfect though because modifying a file doesn't always reflect on the modification date of the folder. And parent folders are not affected by changes made in sub-folders.

Maybe you are looking for

  • Multiple User accounts on one computer

    Is there anyway of setting Itunes to use one central music library file rather than having a seperate one for each user? I want the 2 accounts to be able to access the same library and when songs are added under one profile, to be shown on the other

  • Dreamweaver 8 is not working on Tiger.

    To Whom It May Concern at Apple, I have an problem with my Macromedia Dreamwaver 8.1. I use an older version of your application on my older Mac Pro hard drive to design  my Eighteen Years a List Of Client logos from my New York residency.  After my

  • Can't download folio from Staging Server from Adobe Viewer

    Hello: I have uploaded a new publication (235 MB) to the Staging Server (NOT the Distribtuion Server) but when I'm trying to donwload it from the Adobe Viewer, I'm not able to do it. Even the bar shows me "0 MB of 235 MB downloaded", but it never mov

  • BC4J on OC4J

    Hi, May i know the problem i'm having here. As far as i know the class is in at least 7 jars inn the j2ee\home\lib folder. 11/26/01 8:00 PM defaultWebApp: Servlet error java.lang.NoClassDefFoundError: oracle/jbo/server/ApplicationModuleImpl      at j

  • VM using cluster shared volume will not run if the CSV is owned by a different node.

    If a VM is owned by node "A" and the VHD file is on a CSV that is owned by node "B", it will fail to start. Hyper-v manager popup says that the VHD file is not accessible.  If you change the owner of the CSV file to node "A", it works.  This would im