Re: Finder error problem?
Re: Finder error problem?
- Subject: Re: Finder error problem?
- From: "Mark J. Reed" <email@hidden>
- Date: Mon, 6 Dec 2010 10:55:57 -0500
On Mon, Dec 6, 2010 at 10:33 AM, Jim Brandt
<email@hidden> wrote:
Axel, Mark
I tried both of your suggestions (different variations of same thing), but still get incorrect true values for files with leading zeros that don't exist.
Really? It works fine here. Here's your script with nothing changed except how found_first is set (well, I also took the "display dialog" out of the tell "Finder" block - no reason for that):
set firstFiles to {"Pic 1", "Pic 01", "Pic 001", "Picture 1", "Picture 01", "Picture 001"}
tell application "Finder" to set source_folder to (folder of the front window) as text
repeat with i from 1 to count of firstFiles
set this_item to item i of firstFiles
set file_name to (source_folder & this_item) as text
try
file file_name as alias
set found_first to true
on error
set found_first to false
end
display dialog file_name & tab & found_first
end repeat
OMM, that yields the expected results:
Macintosh HD:Users:mreed:tmp:Pic 1 false
Macintosh HD:Users:mreed:tmp:Pic 01 false
Macintosh HD:Users:mreed:tmp:Pic 001 false
Macintosh HD:Users:mreed:tmp:Picture 1 true
Macintosh HD:Users:mreed:tmp:Picture 01 false
Macintosh HD:Users:mreed:tmp:Picture 001 false
--
Mark J. Reed <
email@hidden>
_______________________________________________
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