• 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: Stan Cleveland <email@hidden>
  • Date: Thu, 22 May 2014 14:20:17 -0700

On May 22, 2014, at 1:14 PM, Luther Fuller wrote:

I just started up in 10.9.3 Mavericks (English) and exercised my script.
I got the same result ... leading zeros anywhere within a file name are equivalent to "0".

Also, a second thought about this problem: This could be a "feature" designed to facilitate naive users who may not understand details of file naming. (I hope not!) If true, then it should be documented somewhere.

Has anyone seen it documented? And, if so, then where?

Hi Luther,

It's outdated and not specific to AS, but there's relevant information at http://support.apple.com/kb/TA22935

From that, it's clear that any portion of a file name that can be interpreted as a number, for purposes of sorting, will be. And, of course, leading zeros have no significance in a numeric sort. 

My semi-educated guess is that, since this is how Finder's internals work, the numeric-parsing mechanism is inadvertently affecting AS commands. Think about it—in the Finder's UI, you either see a file or you don't. The fact that Finder keeps two version of each file name—the actual one and a numerically-parsed one—goes unnoticed. A script, OTOH, requires access to the actual name, but the Finder only seems to provide the parsed one.

It's interesting that the Finder's scripting dictionary includes the displayed name property of a file, which the dictionary describes as "the user-visible name of the item". But, of course, it suffers from the same problem:

name of files of folder "MacHD:Users:stanc:Desktop:Test:" whose displayed name is "Test_1.txt"
--> {"Test_00001.txt", "Test_0001.txt", "Test_001.txt", "Test_01.txt", "Test_1.txt"}
files of folder "MacHD:Users:stanc:Desktop:Test:" whose displayed name is "Test_1.txt"
--> {document file "Test_00001.txt" of folder "Test" of folder "Desktop" of folder "stanc" of folder "Users" of startup disk of application "Finder", etc.}

I'm running Mac OS X Lion, BTW.

Stan C.

 _______________________________________________
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

  • Follow-Ups:
    • Re: Finder's "exists" command ignores leading zero's in filename
      • From: Luther Fuller <email@hidden>
    • Re: Finder's "exists" command ignores leading zero's in filename
      • From: Shane Stanley <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: Luther Fuller <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: Luther Fuller <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