Jump to content


execute_program() / execute_shell()?

  • Please log in to reply
1 reply to this topic

#1 dannyjenn


    GMC Member

  • GMC Member
  • 2736 posts
  • Version:Mac

Posted 13 May 2012 - 04:58 AM

I've posted this in the novice programming forum but got no replies... since it involves Mac I figured I'd post it here.

Does anyone know if the execute_program() and execute_shell() functions are supposed to work in the Mac GM? I checked the manual and it didn't mention them being removed so I assume that they're in there... thing is they don't seem to do anything when I try using them (and I tried something similar on the PC and it seemed to work there...)

Maybe I'm doing it wrong? I'm not familiar with pathnames on the Mac, since there's no C-Drive or anything... suppose I wanted to open up a file... text.txt... located in the same directory as the game. I figured I'd do execute_shell("text.txt","") but that doesn't seem to work. What is the pathname for TextEdit (located in the Applications folder)? I was going to try execute_program("TextEdit.app","text.txt",0) but I wasn't sure of TextEdit's pathname.

Also, what is the difference betwen those 2 functions? Besides the third argument in the first one and the ability for the second to open a file without specifying a program... is there really anything else different between the two?
  • 0

#2 YellowAfterlife


    GMC Member

  • Global Moderators
  • 4146 posts
  • Version:GM:Studio

Posted 13 May 2012 - 06:02 PM

execute_program is meant for execution of actual programs (executables under OS/Windows). It as well allows to pause game's execution while program is running.
execute_shell is meant for 'asking system to open a file'. It will open file with default assigned program, eventually executing it if file is an executable program.

Simple difference between them is that you cannot expect execute_program('readme.txt', '', 0) to work correctly.

Cannot exactly tell about specifics of this under MacOS, though you should try to specify program name as lowercase and/or extension-less ('textedit'), along with trying other possible synonyms for program name, which are known to work from terminal.
  • 0

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users