• 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
Re: Finder error problem?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finder error problem?


  • Subject: Re: Finder error problem?
  • From: Jim Brandt <email@hidden>
  • Date: Mon, 6 Dec 2010 15:18:30 -0600

I tossed my test script earlier, so I can't go back now to see where I went wrong before I responded to you.

I swear I cut and pasted your code in and it didn't work.

I just tried again and now get correct results. Thanks for pointing it out and for help with the solution.

Jim

On Dec 6, 2010, at 9:55 AM, Mark J. Reed wrote:


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

References: 
 >Re: Finder error problem? (From: Jim Brandt <email@hidden>)
 >Re: Finder error problem? (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Question on Applescript setting Annotation for QT7
  • Next by Date: Re: text 1 thru the result
  • Previous by thread: Re: Finder error problem?
  • Next by thread: Sorting a list of aliases
  • Index(es):
    • Date
    • Thread