Re:Hammerspoon – Lua-based powerful tool automation of macOS
by yoyojojofosho on Monday December 13, 2021 @03:39AM
(#29537863)
For anyone else trying to determine how to switch between Chrome profiles on macOS, I found a superuser post [0]
In short you can run:
open -a "Google Chrome" --args --profile-directory=$NAME
where $NAME for your current Chrome profile can be found by looking at Profile Path in chrome://version. The last directory in Profile Path is $NAME. The default $NAME is "Default" and another profile could be "Profile 5".[0] https://superuser.com/questions/377186/how-do-i-start-chrome...
Re:Hammerspoon – Lua-based powerful tool automation of macOS
by beaugunderson on Monday December 13, 2021 @04:33PM
(#29544965)
yup this is very similar to what I ended up with:
-- open Chrome Canary with a specific named Profile
function canaryWithProfile(profile, url)
local t = hs.task.new("/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary",
nil,
function() return false end,
{ "--profile-directory=" .. profile, url })
t:start()
end
-- open Chrome with a specific named Profile
function chromeWithProfile(profile, url)
local t = hs.task.new("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
nil,
function() return false end,
{ "--profile-directory=" .. profile, url })
t:start()
end
Re:Hammerspoon – Lua-based powerful tool automation of macOS
by NateEag on Sunday December 12, 2021 @09:26PM
(#29535886)
I've wanted to send YouTube links directly to VNC for ages, while having all others open in the default browser, but have never taken the time to hack up a listener.
I already use Hammerspoon, so this should be a piece of cake to add.
Thanks for mentioning this ability!
Re:Hammerspoon – Lua-based powerful tool automation of macOS
by beaugunderson on Sunday December 12, 2021 @09:31PM
(#29535919)
I believe this is the implementation I based mine on: https://github.com/zzamboni/dot-hammerspoon/blob/master/init...
I've also setup cmd+shift+1/2/3 to brings the aforementioned profiles into the foreground, so e.g. cmd+shift+2 brings my work Chrome profile to the foreground.