OSX Desktop Icons And Shortcuts?

Ask for help with ScummVM problems

Moderator: ScummVM Team

User avatar
clone2727
Retired
Posts: 1611
Joined: Fri Jun 09, 2006 8:23 pm
Location: NJ, USA

Post by clone2727 »

Forum Rule 12 (English, Please)
User avatar
md5
ScummVM Developer
Posts: 2250
Joined: Thu Nov 03, 2005 9:31 pm
Location: Athens, Greece

Post by md5 »

criezy wrote:thill2708, here is the solution I propose:
1) Create a text file containing the following text:


code:
--------------------------------------------------------------------------------
#!/bin/sh
/Applications/ScummVM/ScummVM.app/Contents/MacOS/scummvm monkey1
--------------------------------------------------------------------------------



This is a shell script. You might need to change the path to the ScummVM application depending where you have install it.

2) You need to tell the OS to open this file with the Terminal application (show the info of the file and in the Open with section select Terminal.app) and you can change the icon at the same occasion using the way described by clone.
dr.zeissler
Posts: 28
Joined: Mon Jan 01, 2007 5:53 pm

Post by dr.zeissler »

md5 wrote:
criezy wrote:thill2708, here is the solution I propose:
1) Create a text file containing the following text:


code:
--------------------------------------------------------------------------------
#!/bin/sh
/Applications/ScummVM/ScummVM.app/Contents/MacOS/scummvm monkey1
--------------------------------------------------------------------------------

This is a shell script. You might need to change the path to the ScummVM application depending where you have install it.

2) You need to tell the OS to open this file with the Terminal application (show the info of the file and in the Open with section select Terminal.app) and you can change the icon at the same occasion using the way described by clone.
thx,

i'll try it.

Doc
yehoodig
Posts: 1
Joined: Thu Oct 01, 2009 1:15 pm

Here's a solution

Post by yehoodig »

After trying Boxer for my Dos games I wanted something like this too. I think what I came up with is pretty decent, so I thought I would share.

Type this into AppleScript:

Code: Select all

tell application "Finder" to get (path to me) as Unicode text
set workingDir to POSIX path of result
set ScriptToRun to "open -a scummvm --args --path=\"" & workingDir & "Contents/Resources/game/\" NAMEOFGAME"
do shell script ScriptToRun
Save this as an application, and then make a "game" folder under the application resources where you put all the game files. You can also replace the "applet.icns" file if you want a non-default icon.

There, you never have to run ScummVM to play your game again.

However, if you want to edit the script later DO NOT navigate to the script file! If you do, the "workingDir" variable will return the location of the script file, not the location of the application. Instead you should open the application from within AppleScript.
User avatar
mikemoore99
Posts: 1
Joined: Tue Feb 14, 2012 6:14 am

Here's how I did it....

Post by mikemoore99 »

So this post was helpful to me, but I'm pretty savvy with copying what the greats describe, so for anyone else out there who's always wanted to do this, I think this is the best way. I tried to make it simple, so anyone who isn't super great on computers may still be able to do it. Good luck!

(before starting, you may want to find and download Icon Composer and icns2icon. Google them, they're both free apps)

1. Open Script Editor

2. Type the following:
do shell script "//Scumm/ScummVM.app/Contents/MacOS/scummvm [id of game]"
(the beginning part will differ, put the path for scumm. For me, I made a folder called Scumm in my Macintosh HD. The id of the game can be found in ScummVM, click the game, edit button, you'll see the id right there, change it if you want)

3. Save this as an application, run only. Now you'll have a little script thing that will open your game when double-clicked. Now for an icon.

4. Using Apple's Icon Composer that comes with the X Code tool stuff is the best way to get a really slick looking icon. Edit whatever pic you want to use (I usually take screenshots) and when you save it (in your photo editor, I use Photoshop) you have to save it with transparency active. The way I do this is in photoshop, the icon is on one layer, the background is blank/checkers, I save as a tiff with layers, another window pops up that has an option to save transparency, click that and you're done.

5. Open Icon Composer. Take your tiff and just drag and drop it into the 512 box. It'll auto-size the other ones, so now just save it.

6. Find an app called icns2icon, download it. This converts your icns file to a visible icon. Just drag and drop your file into this app. Now all you have to do is click the file, cmd-i, click the little picture in the upper left, cmd-c, find your script file for the game, cmd-i, click upper left, cmd-v, and voila! You now have an icon that will open the Scumm game of your choice.

Hope this helps someone out there. It helped to have the smart guys on here answer first! This is a great way to keep my kids from screwing up my ScummVM list
pbe00
Posts: 1
Joined: Tue Feb 26, 2013 1:14 pm

OS X game container and launcher

Post by pbe00 »

First let's create an empty launcher/container for ScummVM games inside your home directory. This will be called ScummVM Launcher.app

These instructions currently assume that ScummVM is located inside /Applications

1. Open Terminal

2. Create the Application folder structure

Code: Select all

mkdir -p ~/ScummVM\ Launcher.app/Contents/Resources/Data
mkdir ~/ScummVM\ Launcher.app/Contents/Resources/ScummVM\ Savegames
mkdir ~/ScummVM\ Launcher.app/Contents/MacOS
3. Create PkgInfo file

Code: Select all

echo "APPLttxt" | cat > ~/ScummVM\ Launcher.app/Contents/PkgInfo
4.1. Start to fill in the code for our launcher script

Code: Select all

cat > ~/ScummVM\ Launcher.app/Contents/MacOS/launcher
4.2. Paste this shell script

Code: Select all

#!/usr/bin/env sh

# Todo: auto-detect scummvm location
SCUMMVM=/Applications/ScummVM.app/Contents/MacOS/scummvm

PLIST=${0%/*}/../Info.plist
DATAPATH=${0%/*}/../Resources/Data
SAVEPATH=${0%/*}/../Resources/ScummVM\ Savegames
CONFIGFILE=${0%/*}/../Resources/ScummVM\ Preferences

"$SCUMMVM" --path="$DATAPATH" --config="$CONFIGFILE" --savepath="$SAVEPATH" $(defaults read "$PLIST" ScummVMGameID) &
4.3. Press Ctrl + C on your keyboard to end input

5. Set execution rights to the launcher

Code: Select all

chmod a+x ~/ScummVM\ Launcher.app/Contents/MacOS/launcher
6. Copy current ScummVM preferences inside the launcher

Code: Select all

cp ~/Library/Preferences/ScummVM\ Preferences ~/ScummVM\ Launcher.app/Contents/Resources/
7. Fill some application information into Info.plist

Code: Select all

defaults write ~/ScummVM\ Launcher.app/Contents/Info.plist CFBundleDevelopmentRegion English
defaults write ~/ScummVM\ Launcher.app/Contents/Info.plist CFBundleDisplayName "ScummVM Launcher"
defaults write ~/ScummVM\ Launcher.app/Contents/Info.plist CFBundleExecutable "launcher"
defaults write ~/ScummVM\ Launcher.app/Contents/Info.plist CFBundleIdentifier "org.scummvm.launcher"
defaults write ~/ScummVM\ Launcher.app/Contents/Info.plist CFBundleInfoDictionaryVersion "6.0"
defaults write ~/ScummVM\ Launcher.app/Contents/Info.plist CFBundleName "ScummVM Launcher"
defaults write ~/ScummVM\ Launcher.app/Contents/Info.plist CFBundleVersion "1.0"
defaults write ~/ScummVM\ Launcher.app/Contents/Info.plist ScummVMGameID ""
At this point we have a general ScummVM container. If you want to explore its contents, right click application in finder and choose Show Package Contents. The structure is like this:
Contents/
-> MacOS/
-> -> launcher (this is the application)
-> Resources/
-> -> Data/ (this folder contains the game)
-> -> ScummVM Savegames (this directory contains the save games)
-> -> ScummVM Preferences (these the preference file)
-> Info.plist (this file contains the application info and game ID)
-> PkgInfo

Now you can make a game container by pasting your game data inside Contents/Resources/Data

As an example, let's make a Police Quest 1 EGA launcher. Start by making a copy of the launcher as Police Quest 1 EGA

Code: Select all

cp -a ~/ScummVM\ Launcher.app ~/Police\ Quest\ 1\ EGA.app
Copy Police Quest 1 EGA data inside the container from ~/pq1 directory, replace this with the directory that game data is in:

Code: Select all

cp -a ~/pq1/* ~/Police\ Quest\ 1\ EGA.app/Contents/Resources/Data/
To tell ScummVM which game the launcher contains run: defaults write ~/Police\ Quest\ 1\ EGA.app/Contents/Info.plist ScummVMGameID <game identifier>

So for Police Quest 1 for example the code is

Code: Select all

defaults write ~/Police\ Quest\ 1\ EGA.app/Contents/Info.plist ScummVMGameID pq1
Now you have a launcher. Easiest way to set the icon:
1. Open an image
2. Select and copy image to clipboard (Cmd + C)
3. Right-click (or Alt+Click) in finder and select Get Info
4. Select the icon in the top left so that it becomes illuminated with blue
5. Paste new icon (Cmd + V)
User avatar
almeath
Posts: 178
Joined: Fri Mar 14, 2008 1:40 pm
Location: Australia

Post by almeath »

Sorry to resurrect an old topic, but I found pbe00's manual method of creating a ScummVM launcher to be very effective, as I like the fact that the preferences and saved games are all contained within the launcher itself.

I would like to suggest a slight tweak to the shell script, for those who would prefer to make the launcher an entirely self-contained app, which can be moved from Mac to Mac without having to keep ScummVM installed in a separate location.

Just use the following line:

SCUMMVM=${0%/*}/../MacOS/scummvm

For this to work, it is necessary to copy the required resources and executables from the ScummVM application to the corresponding locations in the Launcher:

1. "scummvm" executable from Contents/MacOS
2. "Frameworks" folder from Contents (if you are using ScummVM 1.8.1 or higher)
3. Any game-specific support files required for your target game from Contents/Resources

If you use MT-32/CM32L audio then those ROMS need to be moved across to Contents/MacOS as well.

It is a bit fiddly but if you do it once you can keep a master copy of the Launcher ready to receive any particular game that you drop into the Data folder.

Finally, remember to use the "defaults write" command noted above to manually change the game ID to your target game, and you might need to re-copy the preferences file into the Launcher (or manually edit the preferences contained in the Launcher) to suit your particular game settings.
dr.zeissler
Posts: 28
Joined: Mon Jan 01, 2007 5:53 pm

Re: OS X game container and launcher

Post by dr.zeissler »

pbe00 wrote: Tue Feb 26, 2013 1:34 pm First let's create an empty launcher/container for ScummVM games inside your home directory. This will be called ScummVM Launcher.app

These instructions currently assume that ScummVM is located inside /Applications

1. Open Terminal

2. Create the Application folder structure

Code: Select all

mkdir -p ~/ScummVM\ Launcher.app/Contents/Resources/Data
mkdir ~/ScummVM\ Launcher.app/Contents/Resources/ScummVM\ Savegames
mkdir ~/ScummVM\ Launcher.app/Contents/MacOS
3. Create PkgInfo file

Code: Select all

echo "APPLttxt" | cat > ~/ScummVM\ Launcher.app/Contents/PkgInfo
4.1. Start to fill in the code for our launcher script

Code: Select all

cat > ~/ScummVM\ Launcher.app/Contents/MacOS/launcher
4.2. Paste this shell script

Code: Select all

#!/usr/bin/env sh

# Todo&#58; auto-detect scummvm location
SCUMMVM=/Applications/ScummVM.app/Contents/MacOS/scummvm

PLIST=$&#123;0%/*&#125;/../Info.plist
DATAPATH=$&#123;0%/*&#125;/../Resources/Data
SAVEPATH=$&#123;0%/*&#125;/../Resources/ScummVM\ Savegames
CONFIGFILE=$&#123;0%/*&#125;/../Resources/ScummVM\ Preferences

"$SCUMMVM" --path="$DATAPATH" --config="$CONFIGFILE" --savepath="$SAVEPATH" $&#40;defaults read "$PLIST" ScummVMGameID&#41; &
4.3. Press Ctrl + C on your keyboard to end input

5. Set execution rights to the launcher

Code: Select all

chmod a+x ~/ScummVM\ Launcher.app/Contents/MacOS/launcher
6. Copy current ScummVM preferences inside the launcher

Code: Select all

cp ~/Library/Preferences/ScummVM\ Preferences ~/ScummVM\ Launcher.app/Contents/Resources/
7. Fill some application information into Info.plist

Code: Select all

defaults write ~/ScummVM\ Launcher.app/Contents/Info.plist CFBundleDevelopmentRegion English
defaults write ~/ScummVM\ Launcher.app/Contents/Info.plist CFBundleDisplayName "ScummVM Launcher"
defaults write ~/ScummVM\ Launcher.app/Contents/Info.plist CFBundleExecutable "launcher"
defaults write ~/ScummVM\ Launcher.app/Contents/Info.plist CFBundleIdentifier "org.scummvm.launcher"
defaults write ~/ScummVM\ Launcher.app/Contents/Info.plist CFBundleInfoDictionaryVersion "6.0"
defaults write ~/ScummVM\ Launcher.app/Contents/Info.plist CFBundleName "ScummVM Launcher"
defaults write ~/ScummVM\ Launcher.app/Contents/Info.plist CFBundleVersion "1.0"
defaults write ~/ScummVM\ Launcher.app/Contents/Info.plist ScummVMGameID ""
At this point we have a general ScummVM container. If you want to explore its contents, right click application in finder and choose Show Package Contents. The structure is like this:
Contents/
-> MacOS/
-> -> launcher (this is the application)
-> Resources/
-> -> Data/ (this folder contains the game)
-> -> ScummVM Savegames (this directory contains the save games)
-> -> ScummVM Preferences (these the preference file)
-> Info.plist (this file contains the application info and game ID)
-> PkgInfo

Now you can make a game container by pasting your game data inside Contents/Resources/Data

As an example, let's make a Police Quest 1 EGA launcher. Start by making a copy of the launcher as Police Quest 1 EGA

Code: Select all

cp -a ~/ScummVM\ Launcher.app ~/Police\ Quest\ 1\ EGA.app
Copy Police Quest 1 EGA data inside the container from ~/pq1 directory, replace this with the directory that game data is in:

Code: Select all

cp -a ~/pq1/* ~/Police\ Quest\ 1\ EGA.app/Contents/Resources/Data/
To tell ScummVM which game the launcher contains run: defaults write ~/Police\ Quest\ 1\ EGA.app/Contents/Info.plist ScummVMGameID <game identifier>

So for Police Quest 1 for example the code is

Code: Select all

defaults write ~/Police\ Quest\ 1\ EGA.app/Contents/Info.plist ScummVMGameID pq1
Now you have a launcher. Easiest way to set the icon:
1. Open an image
2. Select and copy image to clipboard (Cmd + C)
3. Right-click (or Alt+Click) in finder and select Get Info
4. Select the icon in the top left so that it becomes illuminated with blue
5. Paste new icon (Cmd + V)
Thank you. This means the ScummVM App is not the container or in the container.
I need to use more than one different scummVM version on my setup. so I should rename them in order to make that work, right ?

ScummVM12
ScummVM16

etc.
join
Posts: 1
Joined: Tue Mar 01, 2022 12:49 am

Re: OSX Desktop Icons And Shortcuts?

Post by join »

Sorry to ressucitate a dead topic, but the things discussed here (especially pbe00's solution) have been very helpful for me, so I'd like to contribute back with my solution.

I made a macOS app (10.9+) named ScummVMBox that allows you to pack ScummVM games into double-clickable bundles.

It fetches the game list from the official scummvm-icons repository (https://github.com/scummvm/scummvm-icons), automatically downloads the icon relevant to your game (but you can use your own icons as well), and offers a few options to customize how the game is launched (for instance, whether you want to embed savegames as well, or whether you want to force full-screen mode).
Once done, you get a nice package in the Finder with your game's icon on it!
Double-clicking it launches the game in ScummVM and sets it up to display your icon in the Dock.

It's pretty much a set-and-forget solution, like the other ones offered in the topic, but it automates the process a bit.
I haven't tested it much, but I could convert my pretty large game collection and it appears to launch painlessly.

You can learn more about it on the website. I hope this will be useful for some people!

- Website: https://oin.github.io/scummvmbox
- Github Repo: https://github.com/oin/scummvmbox
Post Reply