Last active
June 21, 2022 03:18
-
-
Save knu/59d446bacb6f78daa6e70cf049047b0c to your computer and use it in GitHub Desktop.
Open a Google Chrome window in a specified profile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if application "Google Chrome" is not running then | |
tell application "Google Chrome" to activate | |
end if | |
tell application "System Events" to tell process "Google Chrome" | |
set frontmost to true | |
click (menu item 1 where its name contains "****") of (menu 1 where its name is "プロファイル" or its name is "Profiles") of menu bar 1 | |
end tell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --profile-directory="$(jq -r --arg name "****" '.profile.info_cache | to_entries[] | select(.value.name == $name) | .key' ~/Library/Application\ Support/Google/Chrome/Local\ State)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment