re: Strange problem with text item delimiters
re: Strange problem with text item delimiters
- Subject: re: Strange problem with text item delimiters
- From: David Crowe <email@hidden>
- Date: Wed, 2 Jul 2003 16:56:45 -0600
Kai;
I tried the little scriptlet you sent:
set AFile to "afilename.doc" as Unicode text
set text item delimiters to "."
set ParsedFilename to AFile's text items
ParsedFilename
--> {"afilename", "doc"}
... and it produced the correct result.
But so did something similar to my original.
After a little more playing around, I discovered that my script
breaks when I attempt to get the text items of (name of aFile), e.g.:
set text item delimiters to "."
tell application "Finder"
set aRandomFile to first file of startup disk
set ParsedFilename to text items of (name of aRandomFile)
set x to (name of aRandomFile)
end tell
class of (name of aRandomFile) & class of x
--> {property, Unicode text}
So, why is class of (name of aRandomFile) "property" and not "Unicode
text", even though if you copy (name of aRandomFile) to a variable,
the variable's class is "Unicode text"?
It seems like something is wrong here, but for now at least I have a
workaround.
- David Crowe
_______________________________________________
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.