Using Automator and Applescript to search and move files to flash drive

I've used applescript and automator to do simple tasks like watch folders and move files and rename files, but that is about the extent. I am wondering if it is possible to set up a automator service or app that will do several things.
When a flash drive is plugged it, it will ask for a file to be searched for, then it will search a predetermined directory for files with the word or number in them and then it will copy the found files to the mounted flash drive.
Any help would be greatly appriciated!
Thanks!

As a start, you can use launchd to run a script when a volume is mounted:
<?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>Label</key>
          <string>com.tonyt.LaunchOnVolMount</string>
          <key>ProgramArguments</key>
          <array>
                    <string>LaunchOnVolMount.sh</string>
          </array>
          <key>QueueDirectories</key>
          <array/>
          <key>StartOnMount</key>
          <true/>
          <key>WatchPaths</key>
          <array/>
</dict>
</plist>
You can then have the LaunchOnVolMount.sh script perform the tasks you need.
You can incorporate Applescript within the Bash script with osascript:
#!/bin/bash
answer=$( osascript -e 'tell app "System Events" to display dialog "What file do you want to search for?" default answer "" ' )
echo $answer
I beleive that you can also call an Applescript from launchd

Similar Messages

  • Using .motn and .mov files in FCP

    I am starting to use Motion much more in FCP Projects and I was just wondering if I should using .motn files in my FCP timeline in most circumstances or is there a time when actually having the .mov file is better?  Other then render time is there much advatange or disadvantage from one to the other? 

    Better depends on the project and what you need.  I look at it this way:
    Use .motn
    -If I think I will have many revisions to the effect.
    Use .mov
    -When I have to send the result to some who doesn't have Final Cut
    -When I'm sure things are not going to change.

  • Restoring picture and movie files after hard drive failure and repair

    I need some help restoring photo/movie files from my external hard drives after my iBook was repaired following a storm. I have backups hidden all over my external hard drives. I have unburned burn folders that may have pictures on them. I was using iPhoto from iLife 05 and iLife 08, and Kodak Easy Share. I have searched on spotlight using ".jpg", "pics", and ".mov" and titles of various images, but I am still missing images that I am fairly sure I duplicated to external hard drives. Any ideas for searching?

    Thanks, I just downloaded EasyFind. I ran an initial search and it looked very effective. I will have to manually check the search results to see if it is getting any files I haven't already been able to find.

  • Can I select all flagged photos and move to a flash drive

    Can I select all flagged photos and move to Flash Drive as a group rather than drag and drop one pic at a time?

    Hi David,
    One way you can do it is to create a Smart Album, and make the conditions = Photo Is Flagged. That will put all of your flagged photos into a single album. Then you can export that Album to the Flash Drive via File>Export. Once you set up the Export the way you want it, and then click on "Export" it will bring up your Finder Window, allowing you to select the Flash Drive to export to.
    Hope this helps!
    Cheers,
    GB

  • Saving and Opening files from Flash Drive Mac to Windows Computer

    Hi!
    I recently purchased a generic Flash drive (2gb). I am having problems saving things on it. Sometimes when i drag a file to the flash drive icon it doesn't load properly or transfers well. I try opening it and it says: "FILE ERROR
    Couldn't open the file. It may be corrupt or a file format that Preview doesn't recognize." Some documents do open well. I also tried opening files on a windows computer and it says it has to be formated. I format it and of course everything deletes.
    Does anyone know how to fix this problem?
    Thanks

    OK. I did.
    But here is the problem, it still doesn't save certain file on the flash drive. Most of the files are either jpg.,cwk.,pdf., or mov.
    The mov. won't even play. It works fine when i save files from a windows computer, but not when i save from my mac.
    I really have no idea why its doing this. I am aware that certain file can't be opened from a mac to a window, but i just don't know why, when i place a file into the flash drive icon and try to re-open it, it says the error message again (On my mac).
    Thanks.

  • Searching paragraphs using automator and deleting the search results from the original body of text

    How do I search paragraphs of a text document using automator and then have the search results deleted from the text document after those search results are exported to a textedit document?

    How do I search paragraphs of a text document using automator and then have the search results deleted from the text document after those search results are exported to a textedit document?

  • I have itunes set up on a PC with all my music, apps, etc. I want to stop using PC and move my iTunes and files to a Mac I bought and synch my iPhone with the Mac. Can I just synch iPhone with Mac iTunes and will it copy all my stuff onto Mac, or will I h

    I have itunes set up on a PC with all my music, apps, etc. I want to stop using PC and move my iTunes and files to a Mac I bought and synch my iPhone with the Mac. Can I just synch iPhone with Mac iTunes and will it copy all my stuff onto Mac, or will I have to copy files from PC onto Mac?

    Here are some of the links to get you started.
    https://discussions.apple.com/thread/3727530?start=0&tstart=0
    http://support.apple.com/kb/HT4527
    http://www.macworld.com/article/1146958/move_itunes_windows_mac.html

  • Using foreach loop container with file system task to rename and move files

    the foreach loop container will not rename and move files for me
    sukai

    duplicate of
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/8f2899f1-43b0-47e0-8bd0-e082989cdcb8/file-system-task-and-foreach-loop-container?forum=sqlintegrationservices
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Using automator or applescript in Preview

    Hi All,
    I'd like to create a services menu item in Preview which does either of two things:
    Open the file I'm currently viewing in Canon DPP raw processing software
    OR
    Check for a folder called "Keepers" in the same directory as the file I'm currently viewing. If it does not exist, create it, and then save a copy of the file into this folder.
    However, I can't seem to find a way to create a services menu item in Preview - can anyone point me in the right direction?
    Thanks

    AFAIK, you can't create a service in Leopard using Automator or AppleScript. Check the AppleScript forum under OS X Technologies. See http://www.reynoldsftw.com/2009/08/automator-and-finder-interactions-in-os-x-10- 6/ for more on this.

  • .mp4 and .mov files are just LARGE

    Sorry, without posting all the encoding details, is there an obvious reason why my .mp4 and .mov files are ~10x the size that they should be after AME? I'm talking about files that are 30mb .mp4's before and 300mb.mov afterwards. If you need details I'll post. Thanks.

    File size is determined primarily by only two factors - duration and bitrate.  The codec used, resolution, frame rate, etc. all have little or no effect on file size.
    Duration, and bitrate.  If you want a smaller file, one or the other of those has to be reduced.

  • I want to transfer my photo and movie files from my iPhone 4S to my mac.

    I have posted this question before without any success and was hoping by reposting it may promt a solution to my problem.
    I want to transfer my photo and movie files from my iPhone to my Mac OS X (10.5.8).
    But I don't want to use Cloud or iTunes.
    Is there a way to connect my iPhone 4S to my Mac directly,
    say ... via a program or such on my MAC, to drag and drop the photos and Movie files,
    directly into a folder. ??????????
    Reason want to connect iPone to MAC or MAC to iPhone is ....
    I have no DATA on my iPhone Mobile plan at moment.
    So Photosync app is no good, as I can't download the app to my iPhone.
    I can download a Photosync to my MAC ...
    but with the Photosync app you can only send data.
    Thanks in advance for any help.

    Sorry I should of mentioned ....
    Reason want to connect iPone to MAC or MAC to iPhone is ....
    I have no DATA on my iPhone plan at moment.
    So Photosync app is no good, as I can't download the app to my iPhone.
    I can download a Photosync to my MAC ...
    but with the Photosync app you can only send data  (so needs to be on the  iPhone).

  • Export current format - JPG and MOV files

    When exporting jpg and mov files in "current format" the mov files will be exported with only 1 second (ca 130kb).
    If I export in "original format" it exports the mov files as they are, but the pictures are "original" and not show the last version.
    Any idea?

    If you dleted them you'll need to use a file recovery application like File Salvage
    Regards
    TD

  • Best way to move files to external drive in LR 5. Drag and drop or export, if drag and drop

    Best way to move files to external drive in LR 5. Drag and drop or export, if drag and drop can I put all the dated folders into one single folder

    Drag and drop should do the job. Or move the files (or folders) in your operating system and then re-link via http://www.computer-darkroom.com/lr2_find_folder/find-folder.htm
    Yes, you can put all the dated folders into a single folder (but if you plan to do this, then don't try move the files using your operating system and re-link)
    Export most definitely isn't the solution.

  • I'm using Time Machine and a LaCie external drive to backup. I also have a 8 GB LaCie flash drive I want to use for small jobs. If I plug the LaCie flash drive in, is my Mac going to think it is the LaCie external drive and start trying to backup?

    I'm using Time Machine and a LaCie external drive to backup. I also have a 8 GB LaCie flash drive I want to use for small jobs. If I plug the LaCie flash drive in, is my Mac going to think it is the LaCie external drive and start trying to backup?

    no.

  • How can I save and share movies to a flash drive in Premier Elements 9

    How can I save and share movies to a flash drive in Premier Elements 9
    mobile phones and other devices - only give for ipods and iphones
    export files for viewing on computer -  windows media etc
    I am experienced at burning dvds on the Adobe Premier Elements but new to sharing movies to a flash drive.
    Please help!

    Moti
    Premiere Elements 9.0/9.0.1 on what computer operating system?
    1. USB Flash Drive.
    Go to Share/Computer/ make your export choice.
    In the Save In field for the preset selected, browse to and select the USB Flash Drive
    2. Windows Media
    Share/Computer/Windows Media and select appropriate preset to get you .wmv file
    3. See Share/Mobile Phones and Players
    Remember you can customize the settings under the Advanced Button/Video Tab, Audio Tab, Multiplexer Tab of
    the preset selected.
    Please review the Premiere Element 9 Help PDF, Chapter 15, Saving and Sharing Movies.
    http://help.adobe.com/archive/en_US/premiereelements/9/premiereelements_9_help.pdf
    The above is an overview. We can go into more details after you review the above.
    Thank you.
    ATR

Maybe you are looking for