I am attempting to set the priority on an application to be higher, but I keep getting 'permission denied' when attempting to do som even as the superuser.
From the Terminal:
Alexandsteins-Macbook:~ alexanderstein$ sudo nice -n -10 /Applications/Minecraft.app
nice: /Applications/Minecraft.app: Permission denied
1 Answers
firstly, you need to nice the program that is launched. You're pointing at a directory. Applications on mac os are files within the application bundle.
The file you're looking for will be located within the directory:
/Applications/Minecraft.app/Contents/MacOS
I don’t have minecraft, so I don’t know what the file is called.
you can nice that file, which should have the desired effect.
You could use a little bit of applescript to accomplish something similar (it's not exactly the same):
tell application "Minecraft"
activate
delay 1
end tell
tell application "System Events" to set pid to unix id of process "Minecraft"
do shell script ("renice -10 -p " & pid) password "xxxxxxxxx" with administrator privileges
You can either replace the xxxxxxxxx with your password, or else omit the entire password "xxxxxxxxx", and have the UI prompt you for an administrator account to perform the task.
This will also work with running copies of minecraft.
To get the applescript to run, you can use the applescript editor to create a scriptlet, or put it into a simple text file, and run it using osascript textfile.
- 496