Make an app where scripting controls everything

Discussion in 'Mac Programming' started by Chirone, Apr 3, 2013.

  1. macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #1
    Hi,

    I want to make an app like Maya where the interface is made with objective c but all actions are runnable with scripts.
    So if you want to open a window you could always type in python or ruby a command that will open the window.
    Or if you want to open a picture and display it on screen then you hit a button which runs the script command that somehow tells the app to open a file and display it on screen.
    I'm aware that there is apple scripting, but I'd rather not use that.
     
  2. macrumors regular

    Joined:
    Mar 2, 2013
    #2
    great idea!

    .
    .
    .
    .

    :confused:
     
  3. macrumors 6502

    Joined:
    May 29, 2011
    Location:
    Littleton, Colorado, USA
    #3
    Since you don't want to use AppleScript (I am guessing that also means Apple Events), how do you plan on sending commands to your application? What have you done so far?
     
  4. thread starter macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #4
    That's kind of why I was asking, to see if anyone had any ideas.

    What I've thought of so far is to make some sort of parser that takes in a scripting language and determines what to do with it from there.

    do you know of some way that I can take in ruby script and and make something happen from it?
     
  5. macrumors 603

    Joined:
    Aug 9, 2009
    #5
    Sockets. Could be Unix domain sockets or TCP/IP sockets.
    http://en.wikipedia.org/wiki/Unix_domain_socket

    If you use IP sockets, you have to figure out a way to publish or advertise what port number you're using. mDNS (Bonjour) could do that, but it's not the only approach.


    Python is embeddable (google it). So connect the embedded Python interpreter to the socket, manage the possibility of multiple connections, and you don't have any parser to write, because Python already has one.
     
  6. thread starter macrumors 6502

    Joined:
    Mar 2, 2009
    Location:
    NZ
    #6
    interesting... I will look into that.
     
  7. macrumors member

    Joined:
    Mar 24, 2013
    Location:
    Enschede, Netherlands
    #7
    Reading this, I actually wonder the following.

    When I go to the prompt I notice that the command interpreter is very similar to UNIX. Even yacc and lex exist. These are programs for building a compiler, an interpreter or any other software that parses text, especially written in a programming language.

    Yacc (whereis yacc gives: /usr/bin/yacc) and lex (whereis lex gives: /usr/bin/lex) are two programs to help you with that. Yacc wants a language definition and lex wants a definition list of tokens, the smallest part of language.

    I didn't expect an Apple to have it, but I am more and more convinced that Mac OS X is a dialect of UNIX (Xenix or Linux) with a GUI (the windowing system) on top of it.

    Maybe this information may give you a hint to the solution to this matter.
     
  8. macrumors 6502

    Joined:
    May 29, 2011
    Location:
    Littleton, Colorado, USA
    #8
    OS X is an Open Brand UNIX 03 registered product that is based on FreeBSD, sitting on top of a Mach kernel, so many of the UNIX tools are in there - see the OS X Manual Pages.
     
  9. macrumors 603

    Joined:
    Aug 9, 2009
    #9

Share This Page