How can I make a programme start routine with a command line argument?

Hello everyone


I would like to have the programme Gimp start on OSX Sierra with the command line argument

-f, --no-fonts

Do not load any fonts. This is useful to load GIMP faster for scripts that do not use fonts, or to find problems related to malformed fonts that hang GIMP.

(Found here: https://docs.gimp.org/en/gimp-fire-up.html).


Even though I am not very familiar with Terminal, I suppose this would be done there by typing stuff. However, I would like to have a start routine (script) that sits on my desktop or in my dock starting Gimp with that argument. Thanks for help or hints for doing this.


Morgy

iMac with Retina 5K display, OS X El Capitan (10.11.2)

Posted on Jan 20, 2017 3:14 AM

Reply
12 replies

Jan 20, 2017 6:25 AM in response to Morgy

The following AppleScript will open GIMP without fonts. See man -t open | open -a preview -f . If you have additional startup arguments, the follow the --args command line usage where anything afterward is deemed program arguments.


The following was tested on El Capitan 10.11.6, and dramatically reduces the GIMP startup time.


do shell script "open -a gimp --args --no-fonts &"


Unlike Linux, and other UNIX implementations, GIMP on OS X/macOS Sierra is an application bundle, and not a single, direct command-line executable application. You can save this AppleScript as a Desktop application for a one-button launch of GIMP without fonts.

Jan 24, 2017 12:49 AM in response to VikingOSX

Hello again


The script

open -a gimp --args --no-fonts &

indeed does its job from Terminal and opens Gimp in a few second without fonts on Sierra. Great!


However, I haven't figured out yet the work flow (with Automator?) to get a "Gimp-script-start-icon" including the above command sitting on my desktop that can be click-started by the user.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can I make a programme start routine with a command line argument?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.