Help Converting Batch File to Applescript

Discussion in 'Mac Programming' started by thezidane, Feb 20, 2010.

  1. thezidane macrumors newbie

    Joined:
    Feb 20, 2010
    #1
    I have a simple batch file to search my server for any excel files and was wondering if anyone could help me write this for my mac server?

    @echo off
    mkdir \files
    xcopy C:\*.xls \files /S /D

    any help would be much appreciated, thanks!
     
  2. pit29 macrumors 6502a

    pit29

    Joined:
    May 23, 2006
    Location:
    The Golden State
    #2
    You can probably do this easily with Automator. Just start it, it's pretty easy to use...
     
  3. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #3
    You might want to look at Smart Folders in Finder. It can more easily do this, unless you need actual copies.

    If you want the same type of thing as your script, Mac is based on Unix and Unix has the mkdir command as well. There's also a copy command. Just do "man copy' to see its arguments and how to use it.
     
  4. pit29 macrumors 6502a

    pit29

    Joined:
    May 23, 2006
    Location:
    The Golden State
    #4
    Yeah, I didn't think of it, but Smart Folders are the smartest idea. To get copies in a different folder, just select all, and alt-drag the files to the place where you want a copy.
     
  5. thezidane thread starter macrumors newbie

    Joined:
    Feb 20, 2010
    #5
    I forgot to mention that the batch file is usually on a USB flash drive. so it isn't just copying files from one directory to another, it is from one drive to another. can i still create a script with automator to search a drive and copy to another drive?
     
  6. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #6
    Yes
     

Share This Page