• 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's "exists" command ignores leading zero's in filename
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finder's "exists" command ignores leading zero's in filename


  • Subject: Re: Finder's "exists" command ignores leading zero's in filename
  • From: "koenig.yvan" <email@hidden>
  • Date: Thu, 22 May 2014 17:30:33 +0200


Le 22/05/2014 à 17:19, Bert Groeneveld <email@hidden> a écrit :

Hi Yvan, thank you for your help. Unfortunately on my machine adding  the word "file" after "exists" doesn't make any difference (my system version is 10.8.5).

Your other method with System Events works fine.

Bert.


I guess that you made a typo.

Here, 

set path_to_desktop to path to desktop folder
set my_img to path_to_desktop & "a213e52fbc66e4068bbc3796b0a302259d42c70da60c58e0ca2d654c63ac95d7.jpeg" as string
tell application "Finder"
set file_found to exists file my_img
end tell
set my_img to path_to_desktop & "2028.jpg" as string
tell application "Finder"
set file_found to exists file my_img
end tell

Behaves flawlessly.

Events log :
tell current application
path to desktop
--> alias "SSD 500:Users:••••••••••:Desktop:"
end tell
tell application "Finder"
exists file "SSD 500:Users:••••••••••:Desktop:a213e52fbc66e4068bbc3796b0a302259d42c70da60c58e0ca2d654c63ac95d7.jpeg"
--> true
exists file "SSD 500:Users:••••••••••:Desktop:2028.jpg"
--> false
end tell

Résultat :

false

Yvan KOENIG (VALLAURIS, France) jeudi 22 mai 2014 17:30:13


 _______________________________________________
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: 
 >Finder's "exists" command ignores leading zero's in filename (From: Bert Groeneveld <email@hidden>)
 >Re: Finder's "exists" command ignores leading zero's in filename (From: "koenig.yvan" <email@hidden>)
 >Re: Finder's "exists" command ignores leading zero's in filename (From: Bert Groeneveld <email@hidden>)

  • Prev by Date: Re: Finder's "exists" command ignores leading zero's in filename
  • Next by Date: Re: Finder's "exists" command ignores leading zero's in filename
  • Previous by thread: Re: Finder's "exists" command ignores leading zero's in filename
  • Next by thread: Re: Finder's "exists" command ignores leading zero's in filename
  • Index(es):
    • Date
    • Thread