Bug in Panther Finder only on non-English OS 10.3?
Bug in Panther Finder only on non-English OS 10.3?
- Subject: Bug in Panther Finder only on non-English OS 10.3?
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 07 Dec 2003 23:44:04 -0800
A user with a German version of OS 10.3 is reporting an error when the
Finder tries to get the name of file from a selection or 'choose folder',
either as alias or coerced to Finder file from string file path. I do not
get the error here (OS 10.3.1, AS 1.9.2). There are no accents or other
diacriticals in his disk name of file path, which is:
"maren:Dokuments:adressen2.CSV"
The error he gets is
"Finder got an error: can't get name of file
maren:Dokuments:adressen2.CSV"
I sent him 6 different ways of doing it. He gets an error with all 6. It may
be 'name' property which is the problem, or the Finder simply can't get a
Finder file out of an alias or file path, so can't. get 'name' or any other
property? I get no error with any of them. And I thought localized OS's
were in fact the same as en-US OS now. The only method that works for him to
to get rid of the Finder and use text manipulation (delimiters) on the file
string. Is there something wrong, unique to his copy, with his installation,
or
I also tried two methods (coercing to a Finder file) which error on my
machine as well but which used to work in previous OS's. (See 8 and 9
below.)
I don't really know how to report a bug that I can't replicate. Can other
people with German or other non-US or non-English OS 10.3 test this out?
1.
------------
set fff to (choose file) as string
tell application "Finder" to set fileName to file fff's name
--> "Finder got an error: can't get name of file
maren:Dokuments:adressen2.CSV"
display dialog fileName
----------------
2.
------------
set fff to (choose file) as string
tell application "Finder" to set fileName to alias fff's name
--> "Finder got an error: can't get name of alias
maren:Dokuments:adressen2.CSV"
display dialog fileName
----------------
3.
-------------------------
set fff to (choose file) as string
set AppleScript's text item delimiters to {":"}
set fileName to last text item of fff
set AppleScript's text item delimiters to {""}
display dialog fileName
--------------------------
--> "maren:Dokuments:adressen2.CSV" -- (works)
4.
----------------------------
set fff to (choose file)
tell application "Finder" to set fileName to fff's name
--> "can't get name of alias maren:Dokuments:adressen2.CSV"
display dialog fileName
---------------------
5.
---------------------
set fff to (choose file) as Unicode text
tell application "Finder" to set fileName to alias fff's name
--> "can't get name of alias maren:Dokuments:adressen2.CSV"
display dialog fileName
------------------------------
6.
--------------
set fff to (choose file) as string
tell application "Finder" to set fileName to (fff as alias)'s name
--> "can't get name of alias maren:Dokuments:adressen2.CSV"
display dialog fileName
--------------------------
7.
--------------
set fff to (choose file) as string
set fff to fff as alias
tell application "Finder" to set fileName to fff's name
--> "can't get name of alias maren:Dokuments:adressen2.CSV"
display dialog fileName
--------------------------
Now for the two that don't work here either:
8.
---------------------------
set fff to (choose file)
tell application "Finder"
set finderFile to fff as file
-->Can't make alias "PB G5 HD Panther:Users:berkowit:Desktop:Calendar
Export EvX.txt" into a file.
set fileName to name of finderFile
end tell
display dialog fileName
---------------------
So alias now won't coerce to a Finder file.
9.
-----------------------------
set fff to (choose file)
tell application "Finder"
set finderFile to fff as item
--> alias "PB G5 HD Panther:Users:berkowit:Desktop:Calendar Export
EvX.txt"
set fileName to name of finderFile
end tell
display dialog fileName
----------------------------------
--> alias "PB G5 HD Panther:Users:berkowit:Desktop:Calendar Export EvX.txt"
This works, but it's the same as no. 4. But stepping through, I noticed
something odd.
set finderFile to fff as item
--> alias "PB G5 HD Panther:Users:berkowit:Desktop:Calendar Export
EvX.txt"
doesn't do any coercion to Finder item. It just spits back the alias form.
It then goes on to use it on my US OS 10.3.1. Whereas in method 8, it
refused to coerce to a Finder 'file' object. It also won't coerce to
'document file'.
Is there another method for getting an alias or file path to a Finder file
(or item) object explicitly? And why do the implicit coercions work for me
but not for the German user?
--
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.