Re: Applescript file extensions
Re: Applescript file extensions
- Subject: Re: Applescript file extensions
- From: has <email@hidden>
- Date: Wed, 24 Apr 2002 00:50:27 +0100
Brennan wrote:
>
Still working on this scriptable app. There's interest in having the
>
ability to drop scripts on the app, or on parts of its GUI. The lead
>
programmer is interested in accepting text files (containing applescript
>
text) as well as compiled scripts.
>
>
Actually the app already does this, but it's also going to be possible and
>
meaningful to drop text files onto the app, which will have some other
>
effect altogether than executing the contents as an applescript.
>
>
>
He's asking whether there's an existing filename extension, like .scr or
>
.as or some such, which would act as a flag to this kind of action.
>
>
My take is that the app should ONLY accept compiled scripts.
That would seem simplest and most foolproof. Also, there's fewer things
that could go wrong with a compiled script: if the script's compiled then
that at least rules out the possibility of syntactic errors. A compiled
script [hopefully] implies that there's been at least a little work and
checking put into the code.
You could, of course, try compiling every text file that's dropped;
executing those that compile and treating those that don't as non-script
text files. Seems a bit slap-dash to me, however, and compilation/runtime
errors that occur in uncompiled scripts could result in inappropriate
behaviour.
Matthew Stuckwisch suggested:
>
.applescript = Script as text
>
.scpt = Compiled script
I thought filename extensions were still very much optional in OS X. That'd
seem to indicate that any depency on filename suffixes is less than ideal:
it puts too much responsibility on the user. If they don't name a file the
way the app wants, the app will punish them. This doesn't seem terribly
reasonable behaviour, however - especially given OS X's current contrary,
obfuscatory attitude to filename suffixes - and might simply end up ticking
off users instead. (Besides, what of a .txt file that contains AppleScript
code, or an .applescript file which contains plain text authored in a
script editor?)
Hrmmm... considering the pros and cons, I think I'd go with Brennan's
'take': accepting compiled scripts only is simple, robust and about as
foolproof as you can hope for.
HTH
has
--
http://www.barple.connectfree.co.uk/ -- The Little Page of Beta AppleScripts
_______________________________________________
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.