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: julifos <email@hidden>
- Date: Thu, 24 Apr 2003 22:08:55 +0200
>
I still find your style verbose and superfluous, and besides you are
>
neither allowing for the final colon on folders nor replacing it when
>
you have found it, no allowing for paths to disks, so the script is
>
always going to be unreliable. I would do it like this and I'd be
>
surprised if this broke on anyone's machine. I rest my case.
An entry at the app's "plst" resource won't allow the user to drop a folder.
Also, a line of code will allow only 1 file ending in ".0" (which will
exclude also any folder if the "plst" doesn't work). These are the
requirements to go ahead with the rest of the script. So, I will receive
allways anything such as:
alias "whateverDiskName:whateverFileName.0"
I don't think verbosity is the problem. Anyway, I'll compile your code and
will try to get my user to test it, so we'll see if it breaks too...
>
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 ""
>
{_container, _file}
>
end open
Anyway (and I think this is a little off-thopic), I'd like to know the
_real_ differences (appart from verbosity) between your line:
set _container to "" & text items 1 thru -2 of f & ":"
And the mine:
set folder_ to text items 1 thru -2 of (thisFile as text) & "" as text
If you wish take a look (no much to see apart from TIDs question), the
source code is here:
http://homepage.mac.com/julifos/machacha_lite_sourcecode.txt
And the "final art" here:
http://homepage.mac.com/julifos/soft/machacha/lite/machacha_lite_10.sit
Cheers!
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.