Re: Tell, Double Tell & Run Only
Re: Tell, Double Tell & Run Only
- Subject: Re: Tell, Double Tell & Run Only
- From: Sander Tekelenburg <email@hidden>
- Date: Fri, 24 May 2002 20:13:37 +0200
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
At 12:33 -0500 UTC, on 24-05-2002, Peter Bunn wrote:
>
Hello:
>
>
As part of a demo package, I'm hoping to include some run-only scripts
>
that involve simple "tell application "Foo"" commands. However, even
>
using a variation of the infamous 'double-tell' (as below), I've found
>
the technique sometimes works, sometimes doesn't... requiring the user to
>
'find' "Foo" most times... if not everytime.
To see some sample code, have a look at my "MailURL"[1]. It combines
referring to an app by variable[2] with using raw AppleEvents. To get the raw
events, I use the 'faux osax' technique[2], described at Bill Cheeseman's
pages. A trick to create a Scripting Addition out of an app's dictionary,
which then allows you to switch the dictionary on/off. When off, you'll get
the raw events.
In my experience this works just about always. You can put it in a try block
and on error allow the user to choose the app manually - just in case.
>
Is there a more reliable method to achieve a seamless 'tell' prior to OS
>
9? Is 'using terms from' the way to go in 9?
>
>
Can a run-only, recreatored script 'learn'/retain the app name/location
>
in the first place?
It can learn through the "tell by variable"[2] method. You could then store
the result in a property, so the script 'remembers'. But when the user
installs a newer version of the app, or when the script is moved to another
machine, it will break. So you either need to catch such an error and have
the script again locate the app, or just run that appsearching routine
everytime.
>
A definitive answer to the question "Can a run-only script be cracked?"
>
would also be welcome.
Everything can be cracked. The more popular your script is, the bigger the
chance that someone somewhere will be intrigued enough to attempt to crack
it. (Having said that, I have never actually heard of a run-only script being
cracked. But most likely that's due to the relatively small market for
commercial AppleScripts. (Which might change now that we have AppleScript
Studio...))
- From what I do know of cracking run-only scripts, you may be able to make
cracking harder by using non-descriptive variable names. Of course that will
also make it harder to write/maintain your code...
[1] <
http://www.euronet.nl/~tekelenb/software/mailURL.html>
[2] <
http://www.applescriptsourcebook.com/tips/tellbyvariable.html>
HTH
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <
http://www.pgp.com>
iQA/AwUBPO6CyusywKfXgqKdEQKNaACgtDQqqPUfs2CkkGD/yb/rfcFTvigAn35i
aoBRrrIpPtu0wNKIHPLVjdam
=sN6J
-----END PGP SIGNATURE-----
--
Sander Tekelenburg, <
http://www.euronet.nl/~tekelenb/>
_______________________________________________
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.