Weird Finder bug - or not?
Weird Finder bug - or not?
- Subject: Weird Finder bug - or not?
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 18 Aug 2003 18:45:36 -0700
I seem to have found a "floating" bug in Finder scripting in OS 10.2.6. Now
you see it, now you don't.
A user of one of my scripts that has been available for a very long time
wrote me that the script was erroring immediately with a "Finder got an
error: descriptor mismatch".
I tried it myself in OS 10.2.6, and sure enough replicated the same error.
It boiled down to these lines:
on open (theSelection)
set fp to item 1 of theSelection as string
tell application "Finder" to set fileName to file fp's name
end open
'file fp' in the second line was highlighted.
If I changed the first line to 'as Unicode text' instead of 'as string' all
was well. But this script has to work in OS 10.1 as well as 10.2, and alias
'as Unicode text' wasn't introduced until OS 10.1.5 or thereabouts. (AS
1.8.3 I think.)
Changing the second line to 'alias fp' instead of 'file fp' with 'as string'
in the first line also worked, I think. (I know I could just parse the
filepath to get the file name, but later in the script I really do need the
Finder to set file type, creator type and to rename the file.)
I wanted to double-check 'alias' today
But here's the weird part: today I get no error with the original script!
Both 'as string' and 'file fp' work just fine together.
So now I can't test it and I can't figure out what's going on. All I did
between yesterday and today was to restart my computer. How could that
matter? Has anyone else seen anything like this in OS 10.2.6?
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.