Re: Problem with tell application "Finder" get exists...
Re: Problem with tell application "Finder" get exists...
- Subject: Re: Problem with tell application "Finder" get exists...
- From: Matt Deatherage <email@hidden>
- Date: Wed, 18 Jan 2006 11:00:19 -0600
On 1/18/06 at 10:08 AM, email@hidden wrote:
> When I do a...
>
> tell application "Finder" to get exists "shotName_001.tif"
>
> the result is true.
>
> But when I do...
>
> tell application "Finder" to get exists "shotName_0001.tif" -- add an
> extra 0 to the capture number
>
> the result is also true. Even though the literal file name in the Finder
> only has two zeros in the capture number.
Yvan is right, of course - you have to have "file" in there for it to
work. Then this becomes just like Nigel's problem:
> > set OKNames to {"2.jpg", "03.jpg"}
> > tell application "Finder"
> > every file of myFolder whose name is in OKNames
> > end tell
> >
> > Files in the folder with names like "2.jpg", "02.jpg", "002.jpg",
> > "3.jpg", "03.jpg", "003.jpg", etc are _all_ returned by the above
> > reference in Tiger.
I created "Picture_001.png" on the desktop, and under 10.4.3, all of the following returned "true":
> exists "Picture_1.png"
> exists "Picture_01.png"
> exists "Picture_001.png"
> exists "Picture_0001.png"
> exists "Picture_00001.png"
> exists "Picture_000001.png"
> exists "Picture_0000001.png"
There appears to be some situation in which Finder is interpreting part
of a filename as an integer, and is matching any non-calculated
expression of that same integer. [Looking for "Picture_(4-3).png"
returns "false," so it's not any expression that evaluates to "1 as
integer", just anything that would compile that way, for lack of a
better way to say it.] When I removed the underscore and tried again,
I saw the same behavior. It even fails for me when using full
pathnames as Yvan did, but he's on 10.3.9 and I'm on 10.4.3.
Odd that two people would find it in a few days under different
circumstances but not until now, but life's full of such coincidences.
--Matt
--
Matt Deatherage <email@hidden>
GCSF, Incorporated <http://www.macjournals.com>
"I was going to be a neo-deconstructionist, but mom wouldn't let me."
-- Calvin, to Hobbes
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden