0

I write some AppleScript to launch my java applications like Minecraft. But there are some problems with it. If I use do shell script "java -jar ~/Library/Application\\ Support/minecraft/launcher.jar" to launch Minecraft with AppleScript(save as app), there will be 3 icons on the dock, The AppleScript App's icon, the Minecraft Launcher's icon and the icon of Minecraft. How can I hide other icons except of the AppleScript Apps icon on the Dock?

Joshua Lee
  • 121
  • 1
  • 9

1 Answers1

0

I don't know if you can do that when activating the launcher.jar but if you tell the app to launch with "tell" you could temp hide the app, you can use the following code i wipped up

do shell script "defaults write /Applications/Minecraft.app/Contents/Info.plist LSUIElement 1"
delay 1
tell application "Minecraft" to activate
do shell script "defaults write /Applications/Minecraft.app/Contents/Info.plist LSUIElement 0"
tell application "Minecraft" to run

As for the Main Game, I don't think you can hide that :(

(make sure minecraft is in the Application Folder)

YeaTheMans
  • 1,005
  • 8
  • 19
  • No, you don't get my poin. There is no Minecraft.app, there just launcher.jar, I use `do shell script "java -jar ~/Library/Application\\ Support/minecraft/launcher.jar"` in my applescript, and I save it as an app. But when I run my app, there will be 3 icons on the dock. I just want my app's icon on the dock and hide the java and minecraft's icons. – Joshua Lee Nov 16 '15 at 08:32
  • oh sorry, yea i don't think you can hide it if it is not a Cocoa Based Application soz dude :( – YeaTheMans Nov 16 '15 at 08:50