• 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
Follow on to "move a file to an external drive"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Follow on to "move a file to an external drive"


  • Subject: Follow on to "move a file to an external drive"
  • From: Jack Schwart <email@hidden>
  • Date: Tue, 19 Jul 2011 21:01:42 -0400

Hi Luther, sorry I took so long to thank you for your suggestion.  Apologies to Chris Stone also.  I had my email filters set incorrectly.

I tried your suggestion...

A suggestion. Replace this ...

set TB to "1 TB Photo Back up:Sorted"

with

property TB : alias "1 TB Photo Back up:Sorted"

I don't think 'make new ...' understands strings.


Unfortunately, I got the same result.



What's happened is as follows...

The script makes the new folder on the external drive as planned.  The folders are empty initially.

During the "if then else" loop, when I try to move the sorted JPEG and Raw files into the waiting folders,  I get the error...

"Finder got an error:  Can't get folder \"yada yada\"

Here's a copy again of the script...


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  -- This is where the script gives me the error.  
else
move curFile to the folder rawFolder
end if
end repeat
delete SortedFolder
end tell  


Anyway, I did some more research on it, and found the answer.  I was correct in thinking that my file path was to blame.  The answer lies in adding one more folder inside the "if, then else" loop...


if the name extension of curFile is in photoExt then
move curFile to the folder jpegFolder of folder TB
else
move curFile to the folder rawFolder of folder TB
end if


Thanks again to both Luther and Chris for your suggestions.  I really appreciate it.

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

  • Prev by Date: Re: number with one decimal
  • Next by Date: Re: Determine media type in iTunes
  • Previous by thread: Re: number with one decimal
  • Next by thread: import to iPhoto
  • Index(es):
    • Date
    • Thread