• 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: Christopher Stone <email@hidden>
  • Date: Fri, 23 May 2014 15:53:39 -0500

Hey Folks,

Jeepers.  That's one nasty bug.

(I had an email meltdown this morning and missed a bunch of this thread.)

set path_to_desktop to path to desktop folder
set my_img to (path_to_desktop as string) & "2028.jpg"

tell application "Finder"
  file my_img as alias
end tell

--> alias "Ryoko:Users:chris:Desktop:002028.jpg"

Back to the alias method:

-------------------------------------------------------------------------------------------

exTant(my_img)

--> false
--> ~ 0.0005 seconds to process

on exTant(_path) # Takes an HFS, Posix, or ~/Posix path as input.
  local _path
  try
    if _path starts with "~/" then
      set _path to (POSIX path of (path to home folder as text)) & text 3 thru -1 of _path
    end if
    if _path starts with "/" then
      alias POSIX file _path
    else if _path contains ":" then
      alias _path
    end if
    return true
  on error
    return false
  end try
end exTant

-------------------------------------------------------------------------------------------

--
Take Care,
Chris

 _______________________________________________
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's "exists" command ignores leading zero's in filename (From: Nigel Garvey <email@hidden>)
 >Re: Finder's "exists" command ignores leading zero's in filename (From: Stan Cleveland <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