Re: Weird info for/choose file prompt issueTo: applescript-users <email@hidden>
Re: Weird info for/choose file prompt issueTo: applescript-users <email@hidden>
- Subject: Re: Weird info for/choose file prompt issueTo: applescript-users <email@hidden>
- From: Kai <email@hidden>
- Date: Mon, 07 Apr 2003 04:15:07 +0100
on Sun, 6 Apr 2003 15:16:01 +0200, Brennan <email@hidden> wrote:
>
I've seen this bug on various versions of Mac OS (9.x and 10.x) on three
>
different machines. It took me a while to isolate it, and I really thought I
>
was going crazy..
[snip]
>
An even more compact version goes as follows
>
>
set fName to name of (info for (anyFileOrAlias))
>
choose file with prompt ("Blah:" & fName)
You should also be able to get around the problem with something like:
==============================================
set {text:fName} to (info for anyFileOrAlias)'s name as string
choose file with prompt ("Blah:" & fName)
==============================================
This is faster[1] than using try/<<class ktxt>>. However, for an even
speedier[2] alternative:
==============================================
set text item delimiters to ":"
set {text:fName} to (anyFileOrAlias as string)'s text item -1
set text item delimiters to ""
choose file with prompt ("Blah:" & fName)
==============================================
[1] More than twice as fast
[2] At least 10 times faster
(Both comparisons against try/info for/<<class ktxt>>. Tested OMM without
'choose file' - which would be the same in each case.)
--
Kai
_______________________________________________
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.