Sometimes you need to launch Blender from the console, such as when debugging OSL scripts.
The way this is done on a Mac is by browsing the package contents of Blender.app and finding the MacOS/blender executable. But who wants to do this every single time? Well, you could create an alias and leave it on your Desktop, but what if you want an icon on your Dock? Isn’t that what the Dock is for - launching Applications? Right, so…
- To create such a Dock icon, first launch Automator (Spotlight search, or find it in your Applications folder). Create a new Application. Then search your list of actions for “get” and you’ll find an action called “Get Specified Finder Items”. Drag-drop it into your workflow.
- Now in order to add the file path you’ll need to point it inside the .app package. But the file browser won’t just let you do that, so first create an alias of the MacOS/blender item an place it somewhere you can navigate to, such as Documents. To navigate to the item in Finder, right-click Blender.app and choose “Show Package Contents”, and click through the subfolders: Contents/MacOs/blender. Right-click on that and choose “Make Alias”. Move that alias somewhere accessible, such as Documents.
- Back in Automator, in the “Get Specified Finder Items” action pane, click the “Add…” button and navigate to your alias.
- Add another action called “Open Finder Items” below your first action. The default setting is fine.
- Save your Automator project as an Application (in your Applications folder). Give it a name that will make sense to you, such as “Launch Blender From Console” or something.
- In Finder, locate your new app file and drag it to the Dock. You now have a way to quickly launch Blender in console mode!
- (Optional) Customize the icon. Right-click and “Get Info” on your new .app file, and do the same for Terminal.app (or Blender.app if you prefer that icon). In the top left of each Info window there is an icon shown. You can copy (Command+C) the Terminal icon, and paste (Command+V) it over your new app’s icon.
What this looks like in Automator:
(This screen shot is from OS X 10.6, but the process is the same in more recent versions.)