Re: How to compile script in OSX
Re: How to compile script in OSX
- Subject: Re: How to compile script in OSX
- From: dev_sleidy <email@hidden>
- Date: Sat, 9 Sep 2006 08:19:07 -0400
I simply want to compile this script. In Script Editor there is a
"Compile" item in the Script menu. This menu item is active, but
when I select it, nothing happens. There is also a compile button
in the Script Editor window. It is active, but when I click it,
again nothing happens.
Selecting 'Script Editor's 'Script, Compile' menu item, or clicking a
'Script Editor's window's 'Compile' toolbar icon button - perform the
same function. That function is to verify the syntax of the code you
entered.
If you entered improper code and selected, either the 'Compile' menu
item or clicked on the 'Compile' toolbar icon button - a drop down
sheet with error information would be displayed.
If you entered proper code - the commands, variables, etc. would
change color - as per the preferences settings of 'Script Editor'.
If you did not do either of the above; but, selected, either the
'Run' menu item or clicked on the 'Run' toolbar icon button - 'Script
Editor' performs a 'Compile' check. If the code was incorrect a drop
down error sheet would appear. If the code was entered correctly, it
would be executed.
Selecting the 'Compile' menu item, or clicking the 'Compile' toolbar
icon button, does not compile the code to a file.
I would like to create a compiled script that can be executed by
double clicking.
To create a double click-able 'application' (what you describe as a
'compiled script that can be executed') - when you create any code
and select 'Script Editor's 'File, Save' (or 'File, Save As...') menu
item - select 'Application' from the 'File Format:' popup button.
I guess a "droplet" script would also work.
To allow the application to accept dragged on items, then you must include ...
on open dragged_Items
...
end
or
on open (dragged_Items)
...
end
... where 'dragged_Items' (above) is just a variable - and may be any
name you prefer.
Below is an example of how to use 'on open'.
on open (dragged_Items)
repeat with i in dragged_items
display dialog (i as string)
end
end
Copy the above code into a 'Script Editor' window, and save it as an
'Application' (via the 'File Format:' popup menu). Now drag any
number of files (document and / or application), folders, or files
and folders - onto the applet (when you save code as an 'Application'
in 'Script Editor' it is called an 'applet').
_______________________________________________
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