kwote

David Bovill david at openpartnership.net
Fri Nov 11 07:10:35 EST 2005


Thanks for the improvements Sarah!


On 11 Nov 2005, at 04:17, Sarah Reichelt wrote:

> Yes, it works for me (Mac OS X 10.4.3) but I prefer to let Rev do the
> work of finding the correct path for AppleScript. Also I have never
> used the merge function and can't really see why it is needed. Here is
> my version, which includes an error check at the end:
>
> on folder_Open someFolder
>     put revMacFromUnixPath(someFolder) into someFolder
>     put "tell application" && kwote("Finder") into someAppleScript
>     put return & "activate" after someAppleScript
>     put return & "open folder" && kwote(someFolder) after  
> someAppleScript
>     put return & "end tell" after someAppleScript
>     do someAppleScript as AppleScript
>     if the result is not empty then answer error "Can't open folder "
> & someFolder & cr & the result
> end folder_Open

I use "merge" quite a lot actually :) Find it more intuitive than  
"format" which I am sure is faster!

Actually, ( this is Dans fault :) - I am curious - do you use "kwote 
()" as well - or are you just being nice to me :)  If so can you  
remember where you got it from - AFIK it came from someone really  
cool in an Apple Developer documentation thingy for HyperCard back  
about 100 years ago - in the same article there was stuff about  
virtual custom properties and dictionaries - all of which are now  
native to Rev (thanks again Scott).

Am interested as it is one of the first functions I started to use as  
a library. I am in the process of removing small functions like this  
to make handlers a little more standalone - for instance at a quick  
check "kwote" is referenced by 452 other handlers in my library:

function kwote string
     return quote & string & quote
end kwote

So two questions:

     1) How would you do this in a single line within a handler using  
"format"?

     2) Has anyone some code to safely and automatically update all  
of my 452 referenced handlers :)





More information about the use-livecode mailing list