PDA

View Full Version : learning applescript




satans_banjo
Nov 15, 2005, 05:12 PM
i've started trying learning applescript but i've found that the things i can actually do with it are quite limited. i can make a script to run a command in Terminal but i am starting to see that applescript is more centred around the programs you're scripting for rather than the actual scripting. here's what i would like to be able to do:

save the current .c or .cpp file in BBEdit
get the names of the header files used (from the .c or .cpp file)
run a gcc command in terminal, compiling a program named after the .c or .cpp file made in BBEdit
the end result should be a compilation of the .c/.cpp file and all associated header files

is there any point in attempting this in applescript or should i try and make a proper BBEdit plugin?
(btw, i'm only learning C and C++ right now so it'll be ages before i'd be able to actually make a plugin)



kainjow
Nov 15, 2005, 06:37 PM
AppleScript isn't good at text processing... you'd be better of with something like Perl or PHP or Python (all built-in to OS X), not AS or C/C++.... but for getting the text from BBEdit, yes AppleScript is the only way outside of a plugin...

satans_banjo
Nov 16, 2005, 01:53 AM
AppleScript isn't good at text processing... you'd be better of with something like Perl or PHP or Python (all built-in to OS X), not AS or C/C++.... but for getting the text from BBEdit, yes AppleScript is the only way outside of a plugin...

i know a little bit of perl and python - would those be able to automate actions within OS X? i always thought that perl was web-based only