Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Applescript for BBEdit

Applescript for BBEdit
Thread Tools
Xcode
Fresh-Faced Recruit
Join Date: Jan 2004
Location: Lancaster, PA
Status: Offline
Reply With Quote
Mar 20, 2004, 07:36 PM
 
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!
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Mar 20, 2004, 08:21 PM
 
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'."
     
Xcode  (op)
Fresh-Faced Recruit
Join Date: Jan 2004
Location: Lancaster, PA
Status: Offline
Reply With Quote
Mar 20, 2004, 08:57 PM
 
Thanks Chuckit! That definitely points me in the right direction!
     
JNI
Forum Regular
Join Date: Oct 2002
Location: Left Coast
Status: Offline
Reply With Quote
Mar 21, 2004, 01:51 AM
 
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.
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 10:35 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,