Re: AppleScript TID bug OS 10.2.5?
Re: AppleScript TID bug OS 10.2.5?
- Subject: Re: AppleScript TID bug OS 10.2.5?
- From: John Delacour <email@hidden>
- Date: Thu, 24 Apr 2003 13:00:40 +0100
- Mac-eudora-version: 6.0a16
At 12:52 pm +0200 24/4/03, julifos wrote:
No problems here, but some of my users have been getting a persistent error
with TIDs. This is the kind of error they get:
#####################################
Can't get text items 1 thru -2 of "path:to:file"
#####################################
Which may be result of anything such as:
#####################################
set thisFile to alias "path:to:file"
set AppleScript's text item delimiters to ":"
set folder_ to text items 1 thru -2 of (thisFile as text) & "" as text
set file_ to text item -1 of (thisFile as text)
set AppleScript's text item delimiters to {""}
#####################################
Seems that some of them have recently upgraded their OS to 10.2.5, and they
have also problems with other applescript-based applications...
If they do it as below, they will not get so confused. A finder
item, a file specification, an alias can all be converted simply to a
string using
"" & f or f as string
and then a far simpler routine followed. They can easily find out
where they're going wrong if they look at their event log.
It is also quite unnecessary to say "Applescript's....."
tell application "Finder"
reveal first file in (path to scripting additions)
set f to item 1 of (get selection)
end tell
(* 4 possibilities
f
application file "ColorSyncScripting.app" of folder
"ScriptingAdditions" of folder "Library" of folder "System" of
startup disk of application "Finder"
set f to f as file specification
--> file "dx:System:Library:ScriptingAdditions:ColorSyncScripting.app:"
set f to f as alias
--> alias "dx:System:Library:ScriptingAdditions:ColorSyncScripting.app:"
set f to f as string
"dx:System:Library:ScriptingAdditions:ColorSyncScripting.app:"
*)
set f to f as string
set text item delimiters to ":"
set folder_ to "" & text items 1 thru -2 of f
set file_ to text item -1 of f
set text item delimiters to ""
{folder_, file_}
-- {"dx:System:Library:ScriptingAdditions", "ColorSyncScripting.app"}
_______________________________________________
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.