AppleScript TID bug OS 10.2.5? [again]
AppleScript TID bug OS 10.2.5? [again]
- Subject: AppleScript TID bug OS 10.2.5? [again]
- From: julifos <email@hidden>
- Date: Sat, 26 Apr 2003 19:44:08 +0200
Hi all again!
I've confirmed again the error.
I sent a little applet called "Bug Test" to this user to see what was going
on. This is the code, courtesy of Mr. J. D. (I attached a simple dialog to
the end, in order to see the results):
###########################
set ls to {path to me, path to "cusr", path to startup disk}
open ls
--
on open ls
set {f, _colon} to {"" & item 1 of ls, false}
if f ends with ":" then set {f, _colon} to {text 1 through -2 of f,
true}
set text item delimiters to ":"
if (count text items of f) is 1 then return {"", f & ":"}
set _container to "" & text items 1 thru -2 of f & ":"
set _file to last text item of f
if _colon then set _file to _file & ":"
set text item delimiters to ""
display dialog _container default answer _file
end open
###########################
This user installed OS 10.2.5, he got some problems with it and reinstalled
again 10.2.1 (which I suposse his current OS).
International System: true, China.
Dev Tools: sorry, I forgot this question ;-)
Here is his report:
_____________________________________
When I put the "Bug Test" app on my desktop and double
click it, nothing happens. Then I open "Bug Test" app
using script editor and then run it. I got a dialog as
below:
system:Applications:Applescript:
Script Editor.app:
("system" is my disk name)
Then I learned Applescript a little and read the code
of "Bug Test" app. I found the reason of why nothing
happen when I double click the app.
When I run the script in script editor, the first item
of ls (path to me) is
"system:Applications:Applescript:Script Editor.app:"
(I don't know why since "me" should be the script) and
"count text items of f" is 4. Then, all the things
below work perfect.
But when I double click the app, the first item of ls
(path to me) is not path of "script editor" as before,
but the real path of "Bug Test" app, that is,
"system:Users:louie:Desktop:Bug Test". Then the
strange thing happens. The "count text items of f" is
1, the app returns and no dialog is displayed.
I try to comment the return code and let the app
continue. Then I got error below:
"Can't make text items 1 thru -2 of
"system:User:louie:Desktop:Bug Test"" into a string"
which is identical to what I got when using Machacha
lite 1.0.
So my conclusion is the "item seperation" of apple
script has proble. Apple script thought
"system:Users:louie:Desktop:Bug Test" has only 1
items.
This bad thing only happens when running script
directly. When run script in script editor, everything
is OK.
_____________________________________
So... Any ideas?
JJ
_______________________________________________
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.