Re: osacompile
Re: osacompile
- Subject: Re: osacompile
- From: has <email@hidden>
- Date: Tue, 8 Nov 2005 23:12:32 +0000
Luther Fuller wrote:
>>>The reason I needed to read the 'run-only' flag of a file,
>>>if such a thing exists, was so that I could avoid compiling
>>>an already compiled script with osacompile.
>>
>>Why? It's perfectly legal to pass a compiled script to osacompile.
>
>Yes, it's legal and I would know exactly what had happened if I were to accidentally compile a run-only AppleScript application.
You'd get a run-only (i.e. non-editable) AppleScript application. Since this is what the code you posted already does, I'm a bit confused as to why it matters if the source script is editable or not.
Anyway, if you really want to write an osax, see <http://developer.apple.com/technotes/tn/tn1164.html> for help and skeleton code. Define an osax event handler that takes a script object (obtained via Standard Additions' 'load script') and returns a boolean. The basic procedure would be to call OpenDefaultComponent('osa ', 'scpt') to get a default OSA component instance, then call OSALoad() to load the script object to test, followed by OSAGetScriptInfo() with the kOSACanGetSource selector to find out if it's readable, clean up and return a result. API docs are at:
<http://developer.apple.com/documentation/Carbon/Reference/Component_Manager/>
<http://developer.apple.com/documentation/Carbon/Reference/Open_Scripti_Architecture/>
HTH
has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden