Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 3, 2013, 04:27 PM   #1
Chirone
macrumors 6502
 
Join Date: Mar 2009
Location: NZ
Make an app where scripting controls everything

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.
Chirone is offline   0 Reply With Quote
Old Apr 4, 2013, 02:18 AM   #2
Sonnestah
Banned
 
Join Date: Mar 2013
great idea!

.
.
.
.

Sonnestah is offline   0 Reply With Quote
Old Apr 4, 2013, 04:29 AM   #3
Red Menace
macrumors regular
 
Join Date: May 2011
Location: Littleton, 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?
__________________
MacBook Pro / OS X Mavericks (10.9.2) / Xcode 5.1 / [and various (much) older stuff keeping dust off the shelves]
Red Menace is offline   0 Reply With Quote
Old Apr 4, 2013, 06:45 AM   #4
Chirone
Thread Starter
macrumors 6502
 
Join Date: Mar 2009
Location: 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?
Chirone is offline   0 Reply With Quote
Old Apr 4, 2013, 12:16 PM   #5
chown33
macrumors 603
 
Join Date: Aug 2009
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.
chown33 is offline   0 Reply With Quote
Old Apr 4, 2013, 03:11 PM   #6
Chirone
Thread Starter
macrumors 6502
 
Join Date: Mar 2009
Location: NZ
interesting... I will look into that.
Chirone is offline   0 Reply With Quote
Old Apr 4, 2013, 03:34 PM   #7
Hans Kamp
macrumors member
 
Join Date: Mar 2013
Location: Enschede, Netherlands
Quote:
Originally Posted by Chirone View Post
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.
Hans Kamp is offline   0 Reply With Quote
Old Apr 4, 2013, 04:57 PM   #8
Red Menace
macrumors regular
 
Join Date: May 2011
Location: Littleton, Colorado, USA
Quote:
When I go to the prompt I notice that the command interpreter is very similar to UNIX.
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.
__________________
MacBook Pro / OS X Mavericks (10.9.2) / Xcode 5.1 / [and various (much) older stuff keeping dust off the shelves]
Red Menace is offline   0 Reply With Quote
Old Apr 4, 2013, 06:53 PM   #9
chown33
macrumors 603
 
Join Date: Aug 2009
Quote:
Originally Posted by Hans Kamp View Post
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.
OS X is POSIX compliant:
http://en.wikipedia.org/wiki/POSIX#F...OSIX-compliant

As RedMenace noted, it's also Open Brand UNIX 03 compliant, i.e. it complies with SUS:
http://en.wikipedia.org/wiki/Single_...ification#OS_X
chown33 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:08 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC