Automator Workflow Copying Files

I want to create an Automator workflow that copy items to a destination folder but ignores files that already exist in the destination. I begin having trouble at the "Copy Finder Items" action where the only options are to replace existing files or create duplicates in th destination folder?

My bad.
Try this script instead:
tell application "Finder"
          set source_folder to (choose folder with prompt "Choose the source folder:")
          set target_folder to (choose folder with prompt "Choose the destination folder:")
          if source_folder is not target_folder then
                    set the_files to every file of source_folder
                    repeat with each_file in the_files
                              set file_name to name of each_file
                              if not (exists file file_name of target_folder) then
  duplicate each_file to target_folder
                              end if
                    end repeat
          else
                    display dialog "Choose different folders as source and target!" buttons {"OK"} default button 1 with icon stop
          end if
end tell
It does what the first one should have done - checks the name of each file against the files already in the source folder and only duplicates those which aren't already there.

Similar Messages

  • Using Automator to copy files from a Windows network

    This has been covered before, but the solution didn't work for me, so excuse the mainly copy-and-paste article:
    I wrote an automator workflow to copy a chosen file located on a PC on the local network.
    Here is the workflow:
    Get Specified Servers
    Mount Servers
    Ask for Finder Items
    Copy Finder Items
    The workflow executes fine up until the workflow actually finishes copying all the files. The automator complains that the Copy Finder Items errors with the following message:
    Can't read directory contents: /Volumes/Files
    The other thread suggests choosing "Ignore Input" for the "Ask for Finder Items" action, which I did. But now I have a different error:
    Couldn't create: /Users/{my name}/Desktop/filename.xlsx
    Any ideas? Thanks!

    This has been covered before, but the solution didn't work for me, so excuse the mainly copy-and-paste article:
    I wrote an automator workflow to copy a chosen file located on a PC on the local network.
    Here is the workflow:
    Get Specified Servers
    Mount Servers
    Ask for Finder Items
    Copy Finder Items
    The workflow executes fine up until the workflow actually finishes copying all the files. The automator complains that the Copy Finder Items errors with the following message:
    Can't read directory contents: /Volumes/Files
    The other thread suggests choosing "Ignore Input" for the "Ask for Finder Items" action, which I did. But now I have a different error:
    Couldn't create: /Users/{my name}/Desktop/filename.xlsx
    Any ideas? Thanks!

  • Does anyone know how to configure Automator to copy files from my MBP to my server on a regular basis

    I want to set up an Automator workflow to shcedule automatic backups of my Photos / document to my server.
    Thanks  any advice would be helpful
    Keith

    We've Googled & we've Binged, searched high and low and we still cannot find out about the calander as we don't use Google for anything other than an occasional issues as their privacy issues bother us, even though we have nothing to hide .  We don't have Outlook either as it does not come with my Microsoft Windows Teacher & Student.
    As for the pictures/videos, most of them came over, but of course the ones I want the mosts didn't transfer from my BlackBerry curve to my iPhone4
    But thank you for your help ! 
    If anyone else is familar with this, no disrespect to razmee209 as I appreciate the help he/she has give me and has taken the time to help me, which I have no words to express my full gratitude for the help!

  • Workflow copying files is timing out

    We have SharePoint 2010.  I have two libraries in the same sub site.  One is a library of active files and one is a library of archived files.  I have a simple workflow that I created in Designer which says if the Archive checkbox is checked,
    then copy to the archive library and then delete from this library.  It takes about 6 seconds for a single record to be copied over and then deleted.  And, if I check the archive checkbox in several records using datasheet view, the first few will
    be copied over but the rest will eventually timeout.  The file size is only about 50-150kb each.  Doing these one by one is very time-consuming because I have 1000+ files to move.  The only way I can get it to work is to change 3-5 at a
    time and let them complete before changing any more.  Is there anything I can do to make this workflow more efficient?
    I am a site administrator so I have full access to all sites/sub sites.
    Milissa Hartwell

    So one option that's come to the top of my head is to just avoid the workflow altogether. It's sounds pretty simple, you want to move files. Use the "Manage Content and Structure" feature! You can check off tons of files at a time and tell them
    to move, they retain all their metadata too.

  • How to apply multiple automator workflows to one file

    Hi everyone,
    I've set up a few workflow applications to automate the process of making packshots from PDF files. The way those roughly work is they create a temporary copy in a folder, open a Photoshop droplet that executes all the actions on the file, and then save the finished product in a "finished" folder.
    However, we frequently need to deliver multiple packshots made from the same file. I was asked to make one automator app that allowed us to drop the PDF version on it, resulting in the multiple types of packshots in the "finished" folder, together with the original PDF.
    The way I have this set up right now is as follows:
    1) Copy the original PDF file to the "finished" folder
    2) Execute the first automator app
    3) Execute the second automator app
    This seems simple enough, and does work in 10.6.8. When I try it on a different computer in our studio though, with 10.7 installed, I get various errors:
    - Sometimes it says an error occured within one of the automator apps, while the app works fine when running it seperately (on all computers).
    - Sometimes it says something like "An error occurred while converting the data" when moving on from the first application to the second application
    - Sometimes I'll get an error message in the log, saying:
    *** -[_NSArrayl objectAtIndex:]: index 0 beyond bounds for empty array
    What I got from this is that it's actually not getting the right input it requires (or not getting any input, since it's an empty array). However, the previous task is set to "return the task input" (our systems are Dutch so excuse me for any discrepancies in translations please), and the resulting output that I get seems to be what I want the next automator application to use. Below is a screenshot of the error message:
    What I've tried:
    - I read somewhere that the newer versions of Automator require the action "Retrieve selected finder items" between them. I've tried using this in various ways (between all other actions/tasks, only before the second application to be run and before both applications to be run), but with no success. The problem I have with these is that, during the applications, it moves the files around, thus apparently selecting those folders as well.
    - Building an entirely new workflow on the newer system
    - Using "Start application" instead of "Execute Automator workflow". This results in Automator saying that it did execute the workflow while nothing happened.
    - Using "Ignore input" for the second application. This also results in Automator saying that it executed the workflow while nothing happened.
    So right now, I'm pretty stumped as to how to get this combination of apps to work in 10.7. Any solutions or workarounds are most welcome.
    Thanks in advance!

    Yes, angelanna. You can merge or split your video file via FCP sequence.
    ahaah, maybe I think angelanna would like to get the resulting file with MTS format because he mentioned “No need to be compressed”. Are you asking for this, angelanna?
    If so, a simple MTS files managing and editing tool  is needed. Maybe you can have a try the Mac version of Aunsoft Final Mate for managing HD camcorder footages. I just downloaded its free trial version and it offers a simple way of garping footages directly  from camcorder. And also it provides a attractive feature to join flawlessly and split accurately native MTS files for video file output with original MTS format.
    Maybe this is the tool cwhich an help you out, angelanna.
    Enjoy your video.

  • Hyperion DIM (Data integn mgmt/Informatica) - Create Workflow to copy files

    Hello,
    I understand this is an ODI forum but I could not find a Oracle Hyperion DIM forum and so I thought some of you might know DIM. This should be easy for those who have Informatica experience.
    So we are using WinSCP for copying files from one folder to the other.
    Those who do not know what WINSCP is - it is a simple to tool used to conduct secure file transfer b/w local and remote desktop.
    We are doing this file copy from one folder to the other on a repeat basis and we would like to automate the workflow using DIM.
    Well, the task is that I basically log on to WinSCP by providing a hostname, username and password and from a specific folder I have to pick up a file and drop it into a different folder.
    I need to create a workflow to do this so that it may be automated. Can anybody suggest ideas on which tasks I may use within DIM and the general approach? This would be great help. Thanks.
    -- Adi

    Hello,
    I understand this is an ODI forum but I could not find a Oracle Hyperion DIM forum and so I thought some of you might know DIM. This should be easy for those who have Informatica experience.
    So we are using WinSCP for copying files from one folder to the other.
    Those who do not know what WINSCP is - it is a simple to tool used to conduct secure file transfer b/w local and remote desktop.
    We are doing this file copy from one folder to the other on a repeat basis and we would like to automate the workflow using DIM.
    Well, the task is that I basically log on to WinSCP by providing a hostname, username and password and from a specific folder I have to pick up a file and drop it into a different folder.
    I need to create a workflow to do this so that it may be automated. Can anybody suggest ideas on which tasks I may use within DIM and the general approach? This would be great help. Thanks.
    -- Adi

  • Getting File Name in Automator workflow - combine PDF

    I am using Automator to combine 2 PDF files.
    I would like to inherit one of the file names in the new PDF and append a standard text to the front of the file name.
    I am not sure how to do this. I can combine the PDFs the way I would like, but I am not sure how to plick the file name.
    my workflow is as follows.
    Folder Action targets folder where 1st PDF is added(I want this FILE NAME).
    Ger Specified finder item selects 2nd PDF to be combined.
    Sort Finder Items makes sure the new PDF pages are ordered properly.
    Combine PDF Pages combines the pages.
    Move Finder Items saves the files where i want it.
    Name single item is whre i thought to add my standard text plus the variable of FILE NAME.
    Open File in mail to set up my email.
    Anyone can help with this?
    thanks,
    Aaron

    Here is an automator workflow that does something similar so I believe you can adapt to your needs.  This workflow is setup as a service workflow. It will combine PDFs in the order in which they are selected/clicked via the Shift key.  The default name of the combined output file will be the name of the first file clicked.  Automator can be activated by CTRL clicking any of the selected PDFs.
    1. Service receives PDF files in Finder
    2. Automator Action: Run AppleScript
    on run {input, parameters}
              display dialog "Files will be combined in the order selected via the Shift key" as text
              return input
    end run
    3.. Automator Action: Trim input items
    keep the first one
    you will need to download and install this autotmator action from here:
    http://www.menace-enterprises.com/Files/Automator/Actions/Trim%20Input%20Items.d mg
    4.  Automator Action: Run AppleScript
    (* Note & Definitions
    This Applescript extracts the basename of the first selected file without its .pdf extension
    "path_basename_ext" is full path and name, e.g. User/desktop/file.pdf
    "NmExt" is filename with extension, e.g. file.pdf
    "baseName" is the base filename without extension, e.g. file
    "Ext" is the file's extension, e.g. pdf
    on run {input, parameters}
              set path_basename_ext to input
              tell (info for path_basename_ext) to set {NmExt, Ext} to {name, name extension}
              set baseName to text 1 thru ((get offset of "." & Ext in NmExt) - 1) of NmExt
      baseName
              return baseName
    end run
    5.  Automator Action: Set Value of Variable
    define baseName as the variable
    6.  Automator Action: Get selected finder items
    Options: check ignore input
    7. Automator Action: Combine PDF pages
    choose Combine by appending
    8. Automator Action: Move Finder Items
    choose To: Desktop
    Options: check show this action when workflow runs
    9. Name Single Items
    choose Basename only to: baseName
    Options: check show this action when workflow runs
    10. Open Finder Items

  • Workflow to copy file from SharePoint app web to host web?

    Hi All,
    About SharePoint-hosted Apps and Visual Stuidio 2012 workflows:
    I'd like to copy files from a document library which is in my app web to a doc lib in my host web. This, using a Visual Studio 2012 workflow.
    Could you please provide some pointers about how to perform this? I couldn't find much on the web about this right now.
    Much appreciated

    see http://forum.java.sun.com/thread.jsp?forum=4&thread=206423

  • Automator copy files incrementally by date?

    I need to daily backup a folder from my mac (4gb folder) to a windows server. I can't use time machine, since the hard drive on the server is formated differently then what it needs to be to use time machine.
    I've been using automator's copy finder file, but it just copies the whole thing, and 4gb takes too long
    I've seen people scripting to do such copies while ignoring files that already have the same name. But that doesn't help me because I need to copy all files that have been modified, regardless of their name. Maybe someone can help me write an apple script that copies files if their "last modified" dates are different?
    Or maybe there is a solution to using time machine with a windows-formated folder?
    Thanks ;P

    Short answer: No. That is the way it is.
    Why? The Make Second Copy during Import is designed to be a backup of your memory card processes-not a back up of your files as you store them on disk. It is intended to be a transient copy that allows you an immediate backup until such time as a File System Level backup can be performed, allowing you to have two copies so that you can reformat your memory cards.
    I agree it would be nice if the folder storage strategy was duplicated for the backup as it is created for the import but that is not something you can set the program to do currently.  I remember it behaving differently versions ago but do not recall exactly how it used to work.

  • Hiding Files Via Automator Workflow

    Is there some way I can make an Automator workflow that will hide a file/folder?
    Thanks,
    Mason

    Found my solution over here.

  • AppleScript to skip Automator workflow step - when no files are provided

    My current Automator workflow:
    Get Specified Finder Items (path to folder auto-populating with images from a camera)
    Get Folder Contents
    Sort Finder Items - by Creation Date in descending order (gets oldest item first)
    Limit Number of Items - Limit to First 1 items
    Move Finder Items (If no items are passed to this step skip it)
    Loop - Automatically; Stop after 20 minutes; Use the original input
    What I am trying to accomplish:
    I'm trying to write an AppleScript to skip the "Move Finder Items action" when it is not supplied with any files (from the previous workflow step), moving on to the next step which is a loop to begin my workflow again.
    Big picture:
    I have a workflow, where I am moving files from one folder to another folder (one at a time). When the input folder is empty, Automator comes back with "No item references were passed to the Move Finder Items action (-50)"; which it should - because it is not passed any files. I would like to ignore this error (or skip this step) and continue with the workflow if no files are provided to the "Move Finder Items action". I currently have an AppleScript (see below) that stops the workflow when this error occurs, but I would like to have this flow continue, not stop.
    AppleScript:
    on run {input, parameters}
              if input is {} then error number -128 -- 'user cancelled'
              return input
    end run
    Please help me create a script to skip this step, or to restart the Automator workflow when no files are passed to  the "Move Finder Items action".

    I'm not aware of a way to do this with a workflow saved as an application, but Automator is scriptable, so you can manipulate a workflow document.  For an example, build the follwing workflow:
    Ask for Text (just to get some input)
    Run AppleScript:
    on run {input, parameters}
      set currentAction to index of current action of front workflow -- the most recent completed action
      if input is {} then -- if no input then disable the following action
        tell Automator action index (currentAction + 2) of front workflow to set enabled to false
      else -- enable it
        tell Automator action index (currentAction + 2) of front workflow to set enabled to true
      end if
      return input
    end run
    Ask for Confirmation (just to show a dialog when enabled - this action will be enabled/disabled based on the text input)
    Loop
    You can also use action names, but I think it is less confusing to use indexes, since names can be edited and an action can be used more than once.

  • Create Automator workflow/AppleScript to automatically move files within NAS

    Running iMac / Macbook Air (OS 10.9.5), having the Macs connected wireless to the same network as a Seagate Central (NAS). On the Seagate Central and the iMac I have specified a couple of folders which are bidirectional synced via "Sync folders pro", e.g. pictures/movies folders. As a family, we have several iPhones (4S and 5S) with dedicated folders on the Seagate Central / iMac. Having the Seagate Media app on the iPhones, we are able to upload (and thereby free iPhone memory) pictures/movies directly onto the Seagate Central (pictures/movies which then are synced back onto the iMac). However, when uploading pictures/movies from the iPhone to the Seagate central (via Seagate Media app), it is not possible to define a target directory, and the pictures are therefore uploaded to a dedicated directory. I therefore search for some workflow/script to automatically (when new pictures/movies are uploaded, or at a daily basis);
    - Search for pictures/movies within a specific NAS folder
    - Move the pictures/movies to another specific NAS folder
    - Delete all other files/folders within the NAS folder being searched
    New to Automator / scripting, so I hope you bear with me even if the questions are dumb.
    Is it possible to make the NAS recognize a workflow/script without starting the iMac and/or MBA?

    Ok, so I made it a bit further, now having the following Automator Workflow (iCal)
    1. Get requested clients (check for ignore input from this action)
    - afp://192.168.1.86/Public
    2. Connect to client
    - I end up with a mounted disc (Public folder). Note that I end up at the same folder even if using afp://192.168.1.86/Public/iPhone/Photos in step 1.
    3. Get specified Finder items (check for ignore input from this action - to avoid having the Public folder itself following the workflow)
    - Choose the subfolder Public/iPhone/Photos
    4. Get folder content
    5. Filter Finder items
    - Did not get any results by using arguments as "kind is picture" and/or "kind is movie"
    - Ended up using arguments as "name contains jpg", "name contains mov" etc
    6. Move Finder items
    - Destination folder: Public/Pictures/iPhone
    - I now successfully managed to transfer the pictures and movies from one NAS folder to another
    *** I now want to continue the workflow to delete all other Folders/Files on Public/iPhone/Photos ***
    7. Get specified Finder items (check for ignore input from this action - to have no existing input for the remaining workflow)
    - Choose the subfolder Public/iPhone/Photos
    8. Get folder content
    - Results no showing a folder and a file
    9. Move Finder items to trash
    However, I´m encountering a couple of problems with this workflow;
    Note1: If there are no pictures/movies to move (no output from #5 going into #6), the workflow will stop. Any suggestions on how to skip step #6 and go to #7 if there are no pictures/movies to move? Applescript within Automator? Setting up the workflow as iCal (regular basis), so would be nice if the workflow just completes without errors (i.e. still goes on with deleting other files on the folder, even if there are no pictures/movies to move).
    Note2: Step #9 result in a error "Finder could not move the specified items to trash". Has this something to do with a folder and some other file being attempted deleted from a NAS folder? Any suggestions for how to cope with this problem?

  • Automator workflow help: Moving files

    I am have trouble with an automator workflow. My ultimate goal is to create a image capture plugin that will create a dated folder with two subfolders for 'PNG' and 'JPG' files. Thus far I've been able to get the creation of the folder hierarchy I'm trying to create but when once action to import files from my device pulls the files I want I'm having trouble sperating the two file types into there subfolders.
    As it stands my work flow consist of the following actions and variables:
    *Image Capture plugin work flow*
    1. New Dated Folder (Action)
    2. Set Value of Variable (Variable)
    [Variable: 'Folder' So that I can ref back to this variable]
    3. New Folder (Action)
    [Folder name: 'PNG' using the 'Folder' variable to store this new folder]
    4.Set Value of Variable (Variable)
    [Variable: 'PNG']
    5. New Folder (Action)
    [Folder name: 'JPG' using the 'Folder' variable to store this new folder]
    6. Download Pictures (Action)
    This is the point in wich I get stuck.
    I've tried a few Files & Folders actions but I'm unable to parse by file extension.
    (I've tried both Filer Finder Items and Find Finder Items actions set to the file extension but keep pullling all my files to one sub folder or the other.)
    Any advice would be much

    The Filter Finder Items action should do it - for example, get the original items (and save for later), filter/move one set of items, get the original items back and filter/move another set of items, etc.  Be aware that the period is not a part of the extension, and watch out about mixing previous results into the current set if input items.  Each action has an Ignore Input option (where appropriate) - for example, when getting the original items from a variable, ignore the input so that the previous results (e.g. the path of moved items) don't get mixed in.

  • Old Toad's automator workflow to backup Library6.iPhoto database

    Dear Old Toad,
    I just today downloaded your workflow to backup the iPhoto database file, and am having problems making it work.
    When I run it, either from the dock or the script menu, it launches Automator but then closes without doing anything. I don't get a confirmation screen, and no copy of the database is created.
    So I opened it in Automator to see if editing it would help, even though my library is already named iPhoto Library and stored in user/pictures. When I dragged it onto the Automator window, there was only 1 action (Get Specified Finder Items) instead of the 4 that show up in the ReadMe. When I dragged it onto the Automator app to open it, I got nothing.
    I downloaded it via Firefox 3.0.1 and got a 1.1MB zip, and I tried downloading it twice in case it had corrupted in the download, but no change with the second try. Downloaded from here:
    http://web.mac.com/toad.hall/ToadsCellar/ToadsCellar.html
    Running OS 10.4.11, iPhoto 7.1.5, on a G4.
    Something else I can try?
    Thanks,
    Daiya
    Message was edited by: Daiya

    Yes. Run the application like you would use the Save command in other applications, often. Running it again will overwrite the current backup copy with a new backup that will include all changes you've made to your library, new pictures, deletions, slideshows, books, etc.
    I suggested keeping it in the dock so you can quickly run it after any changes you've made to the library. Being in the Dock makes it more convenient than having to go into the Application folder and launching it from there.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 6 and 7 libraries and Tiger and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    Note: There now an Automator backup application for iPhoto 5 that will work with Tiger or Leopard.

  • Automator workflow install locations in Leopards

    We have several Automator scripts we created for Finder in Leopard. Where do these go? I expect they should go:
    /Library/Application\ Support/Apple/Automator/Workflows/Applications/Finder/
    But I noticed this directory:
    /Library/Automator/
    And this one:
    ~/Library/Automator
    We want these Automator scripts to show up in users' Finder contextual menu. More importantly, we want to manage these Automator scripts in one place (so they should NOT go into the home directory).
    Thanks,
    Don

    red_menace wrote:
    The Application Support directories are just that - places for an application to put additional support files for it's use. The contextual workflows look like they would be similar to the Scripts menu, in that the items are defined and only work from the user's library. For a shared library of workflows, you would need to store them in an accessible place, such as Shared (or Library, but an admin will need to create the folder there), and then have each user copy or make an alias and place it in their ~Library/Workflows/Applications/Finder/ folder.
    Users should no have to do anything if we push the *.workflow files to the correct locations. OSX is designed to be manageable at the local level, user level, etc. We have several *.workflow files that we need to push out to several dozen workstations. Each workstation can potentially have several dozen home directories. It's not possible (or desirable) to manage this deployment in a way that requires user intervention. I'm pretty sure a previous poster was right, that they *.workflow files belong here:
    /Library/Application\ Support/Apple/Automator/Workflows/Finder/
    We'll do some more testing (I'll keep monitoring this forum). I'll also post to the admin lists to see how other enterprise management folk are handling distribution of *.workflow files in managed environments (where users are non-admin, on workstations bound to AD/OD). Once this is all done I'll follow up with this thread and mark it as closed.
    Thanks,
    Don

Maybe you are looking for

  • Validating records into a maintenance view

    Hi folks! I have a simple Z table (say ZTABLE) and a Z view based on it with some related description (say ZVIEW).  The ZTABLE has a DEC field (called COEF) with 2 decimals and it should have only numbers between 0 and 1. I set the valid interval fro

  • Maps, lack of color / contrast in drive mode

    I have updated by n8 with Anna and Maps 3.08, 11wk41 b02, map version 0.2.43.117. It works fine except when driving to a destination on a freeway / motorway.  The roadway is a gray color that blends into the background and even though it zooms in at

  • Viewing time in full screen mode

    Hello, I am using iMovie '11 (version 9.0.8) and would like to view time in full screen mode, and by time I mean hours: minutes: and seconds. Is it possible to view the playhead in the scrubber bar at full screen? I put a time code in my video, but I

  • [Solved] PKGBUILD Update for ufs-tools

    This is the second of five packages I'm looking at, per the original post. This time, the package is aur/ufs-tools (0.1-1), which installs a binary under /sbin. Flagged as before, no apparent hard-coded paths in the source, and it seems to be operabl

  • J2SE Plugin on OEL

    Hi all I've installed R12.1.1 on OEL 5u4, and it's all working correctly. However, I can't work out what's required to launch the professional forms on Linux. I need to install the J2SE Plugin version 1.6.0_07. Can anyone help out with what's needed?