Page 1 of 1

MacExec not working?

PostPosted: Fri Nov 02, 2018 3:54 pm
by plantenkennis
Hello group,

I am finally ready with a new update for my program but looking at the next problem:
I my app I have the next line:
Code: Select all  Expand view
MacExec( "/bin/sh", ResPath()+"/MoveFiles.sh", )
, but on that line the program hangs.
I f I put the next code in terminal it works correct:
Code: Select all  Expand view
/bin/sh MoveFiles.sh


The respath() is correct. Where should I look at?

Re: MacExec not working?

PostPosted: Sat Nov 03, 2018 9:48 am
by Antonio Linares
René,

Please try it this way:

MacExec( "/bin/sh " + ResPath() + "/MoveFiles.sh" ) // only one parameter

Re: MacExec not working?

PostPosted: Sun Nov 04, 2018 9:31 am
by plantenkennis
Hello Antonio,

With only 1 parameter it does not work. However I will take another approach:
I used the MacExec to copy files> With the package I distribute I can put new files in folder /Users/shared/. With the 'MoveFiles.sh I move the files from Shared to ˜USER/plantenkennis.

Now I will put the new files in the .app package (Contents/Resourses/Update/) and on start of the program I check if there are files in that folder. Then I copy these files to ˜USER/plantenkennis and delete them from the .app. This way it works perfect and I have a bit more control over the files.

Thanks for all the help.

Re: MacExec not working?

PostPosted: Mon Nov 05, 2018 8:05 pm
by mastintin
See this ...
TaskExec parameter 1 -> comandline executable, parameter 2 ->array arguments return-> string result.

Code: Select all  Expand view

msginfo( TASKEXEC( "/bin/sh",  { ResPath() + "/MoveFiles.sh" } )   )
 


NEW ...
For open file with app -> OPENFILEWITHAPP( Path()+"/testbtn.prg", "Textedit.app")