AppleScript gets incorrect file name - OSX
AppleScript gets incorrect file name - OSX
- Subject: AppleScript gets incorrect file name - OSX
- From: JY <email@hidden>
- Date: Mon, 27 May 2002 19:40:51 -0700
I found some files in my iTunes music folder that were created by
importing a music CD (with track names etc. already gotten from the
online CD database) into iTunes. These are very peculiar files. My eyes
see an odd character in their file names (both looking at the files on
the desktop, and looking at their names in a navigation box). The
character looks like a tiny little man with a box around it. Most
certainly not* a question mark! (more on that in a moment).
AppleScript, the Finder and the clipboard do not get the correct names
for these files. For example, "She?s Got Her Ticket.mp3" is returned by
AppleScript, and by copying the file name in the finder and pasting into
a text editor.
Examples:
The first shows what you can't do with it!!
set f to choose file
-->alias "HD:Users:me:Desktop:She?s Got Her Ticket.mp3"
try
f as string
on error err
end try
err
-->"Can't make alias \"Sox:Users:jim:Desktop:She?s Got Her Ticket.mp3\"
into a string."
or this:
set f to choose file
set theName to name of (info for f)
-->"She?s Got Her Ticket.mp3"
or trying the Finder:
tell application "Finder"
set fs to selection
set f to item 1 of fs
end tell
-->document file "She?s Got Her Ticket.mp3" of folder "Desktop" of
folder etc etc"
The returned alias works OK for working directly on the file.
set f to choose file
-->alias "HD:Users:me:Desktop:She?s Got Her Ticket.mp3"
tell application "Finder"
open f
end tell
-->Opens the file in iTunes
The "as string" failure is bugging me. I need the string for a database.
Has anyone bumped into this one before? Did you find a workaround?
Ah ha! I just pasted the file name (copied in the Finder) into Mail.app
and there is the little guy in the box. OK, pasting that character only
from Mail.app into Tex-Edit Plus gives me two characters - ascii 255 and
ascii 180. I don't know if that helps me, but that's more than I knew a
moment ago.
JY
_______________________________________________
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.