learning applescript

Discussion in 'Mac Programming' started by satans_banjo, Nov 15, 2005.

  1. macrumors regular

    Joined:
    Sep 12, 2005
    Location:
    SE London
    #1
    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)
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    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...
     
  3. thread starter macrumors regular

    Joined:
    Sep 12, 2005
    Location:
    SE London
    #3
    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
     

Share This Page