• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
move a file to an external drive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

move a file to an external drive


  • Subject: move a file to an external drive
  • From: Jack Schwart <email@hidden>
  • Date: Thu, 14 Jul 2011 14:28:11 -0400

Hi guys,

I've got a digital photographer in the family who is filling up my hard drive with jpeg and raw files.  I bought an external drive to hold the pictures.  What I've been doing is downloading both the jpegs and the raws files to the external drive, and then just importing the jpegs into iPhoto to save hard drive space.

When I transfer the files off the camera onto the external hard drive, it combines them into one folder.  I wrote a script that separates the two different file types into a JpegFolder and a RawFolder, and then plops them on the Desktop.

What I'd prefer to do, is sort them and plop them on the external drive.  Then all I will have to do is drag the JpegFolder into iPhoto, thus preserving hard drive space.  Problem is, that when I try to do so, I get an error that finder can't access the Folders I created on the external drive.

I submit to you two versions of the script I wrote.  The first one works, it just dumps everything onto my desktop.

The second one give me the error.  My guess is that my file path to the jpegFolder I created on the external drive is incorrect, but I've tried every way I can think of to access it.  Any suggestions would be greatly appreciated...

Version 1:

set SortedFolder to ¬
choose folder with prompt ¬
"Select a Folder to sort your JPEG's" default location (path to pictures folder)

property photoExt : {"jpg", "JPG"}

tell application "Finder"

set jpegFolder to the name of SortedFolder & "JPEG"
set rawFolder to the name of SortedFolder & "Raw"

make new folder at desktop with properties {name:jpegFolder}
make new folder at desktop with properties {name:rawFolder}


set nFiles to every file of SortedFolder
repeat with curFile in nFiles

if the name extension of curFile is in photoExt then
move curFile to the folder jpegFolder
else
move curFile to the folder rawFolder
end if
end repeat
delete SortedFolder
end tell

Version 2:

set SortedFolder to ¬
choose folder with prompt ¬
"Select a Folder to sort your JPEG's" default location (path to pictures folder)

property photoExt : {"jpg", "JPG"}
set TB to "1 TB Photo Back up:Sorted"

tell application "Finder"

set jpegFolder to the name of SortedFolder & "JPEG"
set rawFolder to the name of SortedFolder & "Raw"

make new folder at TB with properties {name:jpegFolder}
make new folder at TB with properties {name:rawFolder}


set nFiles to every file of SortedFolder
repeat with curFile in nFiles

if the name extension of curFile is in photoExt then
move curFile to the folder jpegFolder
else
move curFile to the folder rawFolder
end if
end repeat
delete SortedFolder
end tell



Thanks, Jack







 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: move a file to an external drive
      • From: Christopher Stone <email@hidden>
    • Re: move a file to an external drive
      • From: Luther Fuller <email@hidden>
  • Prev by Date: Re: Determine media type in iTunes
  • Next by Date: Re: move a file to an external drive
  • Previous by thread: Re: Determine media type in iTunes
  • Next by thread: Re: move a file to an external drive
  • Index(es):
    • Date
    • Thread