Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

satans_banjo

macrumors regular
Original poster
Sep 12, 2005
218
0
SE London
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

Moderator emeritus
Jun 15, 2000
7,958
7
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

macrumors regular
Original poster
Sep 12, 2005
218
0
SE London
kainjow said:
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.