I have a script (Shell, chmod-ed to 755. Python is in the script, meaning not run from an outside .py file) that is executable. It works when I run it. How can I make a .app that executes said script on runtime? I have a simple .app that has this structure: APPNAME.App>Contents>MacOS>script This does not run. Is there any way I can piggyback a script onto another application, The Powder Toy, for example? I'm not new to OSX, I just don't have root privileges and can't install XCode. Rembember, I can't install anything from source or use setup scripts, effectively annihilating py2app as an option. EDIT: This answer is courtesy of mklement0. Automator lets you choose the environment to run your script, type it in, and bundle it into a .app, removing the need for a shell script.

有帮助吗?

解决方案

  • Run Automator and create a new Application project.
  • Add a Run Shell Script action.
  • In the Shell: list, select the interpreter of choice; /usr/bin/python in this case.
  • Paste the contents of your Python script into the action and save the *.app bundle.

其他提示

if your using applescript, just save it as a bundle by save as, and click the drop down saying script, change that to bundle i think. after that, click on the bundle icon in apple script and drag the script to the folder you want. to run it put your run command in and drag the script that you placed in the bundle folders before in the directory slot of the run command. i can not give you anything exact due to the fact that i am not on my mac, but i am giving you the best i know.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top