Re: Finder's "exists" command ignores leading zero's in filename
Re: Finder's "exists" command ignores leading zero's in filename
- Subject: Re: Finder's "exists" command ignores leading zero's in filename
- From: Luther Fuller <email@hidden>
- Date: Fri, 23 May 2014 15:30:03 -0500
On May 22, 2014, at 9:15 AM, koenig.yvan wrote: For my own use I would code :
set path_to_desktop to path to desktop folder as text set my_img to path_to_desktop & "2028.jpg" tell application "System Events" set file_found to exists disk item my_img end tell
Then, On May 23, 2014, at 2:07 PM, Ken G. Brown wrote:
I tried this modified form as suggested, and it seems to work correctly.
tell application "Finder" tell file "00441.jpg" of desktop to set file_found to ((it exists) and (its name begins with "00441.jpg")) end tell
I experimented with the latter for a few minutes. It works, but it can be slow.I think the best solution is to avoid use of the Finder.
I found Yvan's suggestion to be a better solution that is simple and works instantly and unambiguously.
|
_______________________________________________
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