When Automator asks me to locate the program, it is unselectable. I’m guessing this is because it’s an executable file and not an application. Can I use AppleScript to get around this issue?
My goal is to create a script so that I can assign a keyboard shortcut to activating Minecraft. The problem is that the Minecraft application file can only start the Minecraft Launcher. But rather than the launcher and game being in the same file, the launcher somehow targets the executable file “java” and runs that at the same time. So when I start the game, if I move my mouse over the dock, the icon representing the running game is just called “java”. The problem is I can’t figure out how to target “java” from a workflow or AppleScript, so I don’t know how do anything in relation to that process.
Essentially I would like to get this code, fromhttp://brettterpstra.com/2011/01/22/quick-tip-applescript-application-toggle/ to work with Minecraft.
set appName to "Mail"
set startIt to false
tell application "System Events"
if not (exists process appName) then
set startIt to true
else if frontmost of process appName then
set visible of process appName to false
else
set frontmost of process appName to true
end if
end tell
if startIt then
tell application appName to activate
end if
Does anyone have any ideas for how I can get around this issue?