|
|
Applescript for BBEdit
|
|
|
|
Fresh-Faced Recruit
Join Date: Jan 2004
Location: Lancaster, PA
Status:
Offline
|
|
I'm completely clueless about applescript and was wondering if the following is possible...
Write a script that saves and compiles a java source file from within BBEdit like the following-
1. saves current document to desktop
2. open terminal window
3. compile current document
4. close terminal window
I ran the script editor, hit record, and opened the terminal app and it didn't record anything. I take it the terminal isn't applescriptable?
Is there an easier approach? Do I need to open terminal to compile my current document with javac? I'm new to both Java and Applescript I would prefer to stick with BBEdit and not an IDE such as netbeans, so suggestions to use other means will fall on deaf ears.
Thank you!
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
No, you don't need to open Terminal. AppleScript has the do shell script command which you can use to run javac like you would with Terminal, only directly from your script. Apple has some pretty thorough documentation on the it.
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Jan 2004
Location: Lancaster, PA
Status:
Offline
|
|
Thanks Chuckit! That definitely points me in the right direction!
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Oct 2002
Location: Left Coast
Status:
Offline
|
|
Originally posted by Xcode:
I ran the script editor, hit record, and opened the terminal app and it didn't record anything. I take it the terminal isn't applescriptable?
Just a minor clarification - Terminal is scriptable, but it is not recordable. Two different animals. Hardly any apps are recordable anymore, which is a shame, as it's very cool when they are. To be recordable, I believe you have to essentially do everything in your app by sending yourself AppleEvents, and that is a big PITA. If you do that the OS can then tap into the dispatching of those events and record them. Scriptability is much easier, and can be tacked on to just about any app, even ones where all the core code has already been written.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|