Can anyone tell me whats wrong with this AppleScript?

Discussion in 'Mac Apps and Mac App Store' started by lukedavidh, Aug 7, 2015.

  1. lukedavidh macrumors newbie

    Joined:
    Aug 7, 2015
    #1
    tell application "Finder"

    duplicate (every file of {"Volumes:MyPassportForMac:FamilyVac2014} whose name extension is in {".JPG"}) to folder "AllFamVacJPEGS" of desktop

    end tell
     
  2. Jessica Lares macrumors G3

    Jessica Lares

    Joined:
    Oct 31, 2009
    Location:
    Near Dallas, Texas, USA
    #2
    You're missing a " in {"Volumes:MyPassportForMac:FamilyVac2014} You need one after the 4.
     
  3. lukedavidh thread starter macrumors newbie

    Joined:
    Aug 7, 2015
    #3
    Ahh, yes. newbie mistake. still doesn't work, says

    SCRIPT ERROR
    Can’t get {} whose {".JPG"} contains name extension.
     
  4. kryten2 macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #4
    Try this :

    Code:
    tell application "Finder"
        duplicate (files of folder "Volumes:MyPassportForMac:FamilyVac2014:" whose name extension is "jpg") to folder "AllFamVacJPEGS" of desktop
    end tell
    
     
  5. Jessica Lares macrumors G3

    Jessica Lares

    Joined:
    Oct 31, 2009
    Location:
    Near Dallas, Texas, USA
    #5
    Got it, this worked for me:

    Code:
    tell application "Finder"  
    
    duplicate (every file of ("Volumes:MyPassportForMac:FamilyVac2014" as alias) whose name extension is "jpg") to folder "AllFamVacJPEGS" of desktop
    
    end tell
    You need to pass the volume path as an alias. You don't need the brackets on the jpg extension either because it's only that one and not tiff/gif/etc.
     

Share This Page