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

Chirone

macrumors 6502
Original poster
Mar 2, 2009
279
0
NZ
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.
 

Red Menace

macrumors 6502a
May 29, 2011
578
226
Colorado, USA
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?
 

Chirone

macrumors 6502
Original poster
Mar 2, 2009
279
0
NZ
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?
 

chown33

Moderator
Staff member
Aug 9, 2009
10,747
8,420
A sea of green
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.
 

Hans Kamp

macrumors member
Mar 24, 2013
38
0
Enschede, Netherlands
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?

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.
 

chown33

Moderator
Staff member
Aug 9, 2009
10,747
8,420
A sea of green
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.