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
|