ShogunPanda Posted September 4, 2016 Share Posted September 4, 2016 (edited) Also available here: http://www.packal.org/workflow/alfred-chrome Introduction This workflow allows you to open a URL in Google Chrome. To trigger the workflow, type chrome or cr. Optionally you can add a URL. Between the results you will a list of profiles to use to open the URL (or simply to open a new window). If you hold the `Alt` key while selecting the result item, the window will be open using incognito mode. Installation Double click (or open in Alfred settings) the Alfred Chrome.alfredworkflow file. This workflow is for Alfred 3 only therefore it works on macOS 10.9+ (Mavericks and following). Uninstallation Remove the workflow via Alfred settings. Specifying a different flavor of Chrome If you use Canary version of Chrome or similar applications, like Chromium, you can instruct the workflow to use it. To do it: In the Workflows settings, select Alfred Chrome workflow. Open the Configure workflow and variables by clicking on the second icon on right section of the workflow header. Under the Workflow Environment Variables section, create a variable called ALFRED_CHROME_NAME and enter the same name you see in your Applications folder. Click on Save and you're good to go! Edited January 14, 2018 by ShogunPanda selfmade69 1 Link to comment
mattstratton Posted September 6, 2016 Share Posted September 6, 2016 Possibly dumb question - my Google Profile names have spaces in them...is there somewhere else I should be looking to get the Profile name? (For example, they are called "Matt Gmail" and "Matt Chef") Link to comment
chrisramakers Posted September 7, 2016 Share Posted September 7, 2016 Don't know if it's possible but can the script be update to allow just opening the browser, not an url is required, else the workflow just does nothing. For example when I do "chrome as Chris" i would like chrome to open/switch to chrome with my "Chris" profile active Link to comment
ShogunPanda Posted November 5, 2016 Author Share Posted November 5, 2016 @mattstratton and @chrisramakers, I've addressed both you requests in version 2.1.0 that I just published. Let me know if it works. Link to comment
polen Posted November 6, 2016 Share Posted November 6, 2016 Hi there, is it just me or it doesn't work at all in El Capitan? Link to comment
ShogunPanda Posted November 6, 2016 Author Share Posted November 6, 2016 Ehi @polen, do you get any error or notification? If not, can you please try the following steps and paste the output here? 1. Open Alfred Preferences 2. Go to Workflows settings 3. Right click on “Alfred Chrome” and then click on “Open in terminal” 4. Press enter in the terminal 5. Type “./alfred-chrome $QUERY“ (without quotes, where $QUERY must be replaced with whatever you usually type in Alfred) and press enter again This way I should be able to address any issue. Thanks! Paolo Link to comment
polen Posted November 13, 2016 Share Posted November 13, 2016 I don't get any notification. When I run it in the terminal I get dyld: Library not loaded: @rpath/libswiftAppKit.dylib ... Link to comment
ShogunPanda Posted November 15, 2016 Author Share Posted November 15, 2016 Ok, some problem with compilation. Will check it out and let you know. Link to comment
ShogunPanda Posted November 23, 2016 Author Share Posted November 23, 2016 Hi all! I’ve updated the workflow again. The main executable in the workflow (which now is 2.3 MB instead of the previous 354 KB) now uses static linking. This means the error @polen sent me should be gone and even on older macOS the workflow should work Can you please download it again and confirm it? Thanks! Link to comment
polen Posted December 2, 2016 Share Posted December 2, 2016 Hi @ShogunPanda I downloaded it again and it works well, thanks!!! Link to comment
rogiebear07 Posted December 5, 2016 Share Posted December 5, 2016 I'm having some trouble with this workflow. When I enter "chrome in $USER $URL" I get an invalid url message. "chrome $URL" works fine. Where would I track down the correct variable for $USER? Profile names doesn't seem to work, and neither does the folder names in the Chrome application support folder. Link to comment
ShogunPanda Posted January 17, 2017 Author Share Posted January 17, 2017 @rogiebear07 There is a little typo. You have to type "chrome as $USER $URL". Let me know if you still have issues! Link to comment
santip Posted January 30, 2017 Share Posted January 30, 2017 Hi @ShogunPanda, any chance you can share the source code of the "alfred-chrome" executable on github? Thanks! benlim 1 Link to comment
ShogunPanda Posted March 20, 2017 Author Share Posted March 20, 2017 (edited) On 30/1/2017 at 7:28 PM, santip said: Hi @ShogunPanda, any chance you can share the source code of the "alfred-chrome" executable on github? Thanks! Ehm... it was in the .gitignore file by mistake. Fixed now. Edited March 20, 2017 by ShogunPanda Link to comment
ShogunPanda Posted March 20, 2017 Author Share Posted March 20, 2017 Hi all. I just published version 3. This one simplifies usage buy only requiring "chrome" or "cr" to be typed to show all available profiles. You can also insert the URL or toggle incognito using the Alt key. See the first post for more informations. Link to comment
doctorwho Posted April 16, 2017 Share Posted April 16, 2017 Hi,Getting an error while trying to initialize the shortcut Error logs when “./alfred-chrome $cr“ from terminal, -bash: “./alfred-chrome: No such file or directory Error logs in application window, Starting debug for 'Alfred Chrome' [2017-04-16 22:18:15][ERROR: input.scriptfilter] Code 1: Google Chrome cannot be found. Nothing to do! :( [2017-04-16 22:18:15][ERROR: input.scriptfilter] JSON error: JSON text did not start with array or object and option to allow fragments not set. in JSON: Google Chrome cannot be found. Nothing to do! :( I am syncing Alfred preferences via Dropbox Link to comment
artdev Posted April 21, 2017 Share Posted April 21, 2017 (edited) The same for me On 4/16/2017 at 8:04 PM, doctorwho said: Error logs in application window, Starting debug for 'Alfred Chrome' [2017-04-16 22:18:15][ERROR: input.scriptfilter] Code 1: Google Chrome cannot be found. Nothing to do! :( [2017-04-16 22:18:15][ERROR: input.scriptfilter] JSON error: JSON text did not start with array or object and option to allow fragments not set. in JSON: Google Chrome cannot be found. Nothing to do! :( Edited April 21, 2017 by artdev Link to comment
aheidelberg Posted May 4, 2017 Share Posted May 4, 2017 (edited) I also get the same error. Google Chrome cannot be found. Nothing to do! :( After changing the application name to "Google Chrome Canary" it worked though, just not with the normal version. Edited May 4, 2017 by aheidelberg Link to comment
djaneb Posted August 3, 2017 Share Posted August 3, 2017 Hi there ... I have been unable to launch the script with the same errors as above ... in terminal Google Chrome cannot be found. Nothing to do! :( All good if you're too busy to fix it. Many thanks Link to comment
aheidelberg Posted August 12, 2017 Share Posted August 12, 2017 I found a workaround. You can check it out on GitHub. Link to comment
loudestnoise Posted August 17, 2017 Share Posted August 17, 2017 @aheidelbergDownloaded the zip from your Github fork of this workflow, but it's still not triggering with 'cr' or 'chrome'. Any ideas? 10.12.5, Alfred 3.4.1 Link to comment
aheidelberg Posted August 18, 2017 Share Posted August 18, 2017 (edited) @loudestnoise Download only the main.swift file from my GitHub. Then compile it to an executable on your Mac either with Xocde or in Terminal.app by running swiftc main.swift -o alfred-chrome-fixed or whatever output name you want. I'm not sure if you need to install Xcode for that. Then right click on Alfred Chrome in the Alfred Workflows Tab to open the workflow directory in Finder. Copy the compiled executable there and change the script Alfred Chrome is using by right-clicking the "cr" and / or "chrome" Script Filter, then Configure Object and then changing the Script File to your new file. That's what I did, hope it helps. Edited August 18, 2017 by aheidelberg Link to comment
ShogunPanda Posted January 14, 2018 Author Share Posted January 14, 2018 Hi all! First of all, sorry for the long absence in supporting this workflow. @aheidelberg Thanks for finding a workaround while I was MIA Today I've update the Workflow to version 4.0.0. This update includes a rewrite in Go of the helper, which slims down workflow size by more than a half. I also checked Chrome source and I now the profiles detection has vastly improved, support explicitly Chrome, Chrome Canary and vanilla Chromium. Finally, in order to specify a different Chrome flavor, you know have to use the environment variable ALFRED_CHROME_NAME, which you can easily edit in the workflow configuration window (second icon in the settings) rather than editing obscure files. For more information about this, checkout the first post of this thread. Let me know if it works properly and thanks again for liking this! See ya! Paolo Link to comment
wiffle Posted February 21, 2018 Share Posted February 21, 2018 Any way to default open with incognito? Also, it species to open with "Profile 1". Any way to change the name of the profile? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now