I'm attempting to follow the instructions for pinning startup tabs in Chrome. On OS X how do I add command line arguments to items that persist in my dock?
You have basically two options:
Option 1: Use Automator to create an application that in effect launches Chrome with command line arguments.
Start Automator and select to create an Application. Double-click Run Shell Script in the Library/Utilities folder and replace the text content —
Save anywhere you like.
To replace this application's icon, Get Info on your real Google Chrome, click on the icon on the top left, press
Since it's a different application, the Dock will display two Chrome applications when it's running: Chrome, and your Chrome launcher.
Option 2: Edit your application bundle to launch a script instead. This script will start the actual application, adding the command line argument.
Look for the entry
Open Terminal and enter the following:
An editor for the
(using the actual executable's name you removed from
Save and close. In Terminal, enter the following:
Now, close Terminal and move your application (which must not be running right now) to a different folder and back again. This will update Launch Services, otherwise your changes will be ignored and irritate you immensely.
Now, when you open your application, it will actually execute the
It will look and behave like you expect it to, but you will need to repeat this whenever you update your application, as this will generally replace the application bundle and all the changes you made.
You could write a script that launches Chrome, but that wouldn't be the application icon in the dock, and it would cause a separate Chrome icon to appear. So you'll have to create an application package.
First, make a copy of your Chrome app. Then, there are two approaches that might work; I'm not sure which will play better with Mac OS X and/or Chrome's self-update.
This is all based on my understanding of Mac app packages; I haven't actually tested these changes on Chrome in particular. It is even posible that the Chrome executable on Mac doesn't support this option, as Mac applications are generally not expected to be run with controllable command-line options (unlike, for example, Windows, where applications are normally launched via shortcuts which can have embedded options).
I have a very similar problem, wanting to add parameters to start with the vlc-player in osx. something like that:
/Applications/VLC.app/Contents/MacOS/VLC --rtsp-timeout=99999 --sout-ffmpeg-strict=-2 ---extraintf http --http-port=8081
I tried it with the option 1 you posted, but automator gives me an error not knowing the commands like --rtsp-timeout=99999 and so on...
I did it like this:
automator - run shell script (shell /bin/bash) and I put the code: open /Applications/VLC.app/Contents/MacOS/VLC --rtsp-timeout=99999 --sout-ffmpeg-strict=-2 ---extraintf http --http-port=8081
can you please tell me what I did wrong?