Re: Environment woes executing scripts from my OS X app

2015-12-16 Thread Maxthon Chan
If you can call /usr/bin/env you can use that as an intermediary. Sent from my iPhone > On Dec 16, 2015, at 15:47, Rick Mann wrote: > > I'm working on an OS X app that unfortunately has to call a series of bash > and python scripts for part of the processing it does. I was able to include > t

Re: Environment woes executing scripts from my OS X app

2015-12-16 Thread Peter
Hm, maybe I’m getting this wrong but how about NSTask - (void)setEnvironment:(NSDictionary *)environmentDictionary Am 16.12.2015 um 13:46 schrieb Maxthon Chan : > If you can call /usr/bin/env you can use that as an intermediary. > > Sent from my iPhone > >> On Dec 16, 2015, at 15:47, Rick Man

Re: Environment woes executing scripts from my OS X app

2015-12-16 Thread Jens Alfke
> On Dec 15, 2015, at 11:47 PM, Rick Mann wrote: > > the environment is different when launched via my app than when launched on > the command line. — When you launch a program from a terminal, it inherits the shell’s environment, which includes variables you’ve set in startup scripts like .

Positioning of text

2015-12-16 Thread eric g
I am trying to understand how Cocoa's text drawing system positions text on OS X. I have setup some text attributes as follows: let emojiFont = NSFont.systemFontOfSize( 18 ) let emojiStyle = NSMutableParagraphStyle.defaultParagraphStyle().mutableCopy() as! NSMutableParagraphStyle

Re: Environment woes executing scripts from my OS X app

2015-12-16 Thread Paul Scott
On Dec 16, 2015, at 15:47, Rick Mann wrote: > I'm working on an OS X app that unfortunately has to call a series of bash > and python scripts for part of the processing it does. I was able to include > the scripts in my app's bundle, and invoke them there, but the environment is > different w

Re: Environment woes executing scripts from my OS X app

2015-12-16 Thread Paul Scott
By the way, you could also use this AppleScript, saved as an application, and run automatically via the System Preferences -> Users & Groups -> Current User -> Login Items configuration. set vars to { ¬ { name:"ANT_HOME", value:"/usr/local/apache-ant-1.9.6" }, ¬ { name:"CATALINA_HOME", v

Re: Environment woes executing scripts from my OS X app

2015-12-16 Thread Paul Scott
Sorry, I messed up the script. It should have been this: set vars to { ¬ {name:"ANT_HOME", value:"/usr/local/apache-ant-1.9.6"}, ¬ {name:"CATALINA_HOME", value:"/Users/pscott/Projects/apache-tomcat-8.0.24"}, ¬ {name:"LAUNCHD_SCRIPT", value:"/Users/pscott/bin/logon_as"}, ¬ {done:true} ¬ } r

Fwd: Positioning of text

2015-12-16 Thread Jakob Egger
> On 16 Dec 2015, at 19:02, eric g > wrote: > > I was expecting the emoji to be drawn in the lower left corner and do not > understand why is the character drawn so high. Why is the emoji drawn > where it is drawn? The horizontal padding is caused by the text contai

Re: Environment woes executing scripts from my OS X app

2015-12-16 Thread Rick Mann
Sorry, I didn't specify enough constraints in my original post. - The code that calls the external scripts has to be cross-platform, and run on linux as well as OS X. So, no NSTask. - I can modify the code that calls the scripts, and I can use OS X-only APIs to set up a global environment (for p

Re: Environment woes executing scripts from my OS X app

2015-12-16 Thread pscott
I am pretty sure you can do that as one command without semicolons or export. I.e, system("PYTHONPATH=/usr/bin/python PYTHONHOME=/usr/share/python/ /path/to/script args"); The script should see the variables. I tested this on OS X, should work on other systems as well. Paul On 12/16/2015

Re: Environment woes executing scripts from my OS X app

2015-12-16 Thread Rick Mann
> On Dec 16, 2015, at 15:29 , Chris Hanson wrote: > > On Dec 16, 2015, at 2:29 PM, Rick Mann wrote: > >> - The code that calls the external scripts has to be cross-platform, and run >> on linux as well as OS X. So, no NSTask. > > Sure you can, you just have to hide the use of NSTask or > po

Re: Environment woes executing scripts from my OS X app

2015-12-16 Thread Jens Alfke
> On Dec 16, 2015, at 3:23 PM, pscott wrote: > > I am pretty sure you can do that as one command without semicolons or export. > I.e, > > system("PYTHONPATH=/usr/bin/python PYTHONHOME=/usr/share/python/ > /path/to/script args"); Not all shells support that syntax. I know that tcsh didn’t (I

Re: Environment woes executing scripts from my OS X app

2015-12-16 Thread pscott
On 12/16/2015 4:32 PM, Jens Alfke wrote: On Dec 16, 2015, at 3:23 PM, pscott > wrote: I am pretty sure you can do that as one command without semicolons or export. I.e, system("PYTHONPATH=/usr/bin/python PYTHONHOME=/usr/share/python/ /path/to/script args"); Not a

Re: Environment woes executing scripts from my OS X app

2015-12-16 Thread Jens Alfke
> On Dec 16, 2015, at 9:10 PM, pscott wrote: > > Are you sure about that? Every linux or bsd system I ever ran into says in > the system(3) man page that /bin/sh is used Oops, you’re right. My bad. I still think no one should use it, though :) —Jens __