Created
September 8, 2015 13:40
-
-
Save carlosonunez/4c3015efc7e34a2ad428 to your computer and use it in GitHub Desktop.
This file contains 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
(* Profile launcher for Opera *) | |
(* Set this to whatever you want. *) | |
property profileName : "google.com" | |
property profileFolder : "/Users/$USER/.OperaProfiles/" & profileName | |
property operaFilePath : "/Applications/Opera.app/Contents/MacOS/Opera" | |
property commandCreateProfileFolder : "mkdir -p " & profileFolder | |
try | |
set commandOpenOpera to operaFilePath & ¬ | |
" --args" & ¬ | |
" --user-data-dir=" & profileFolder & ¬ | |
" > /dev/null 2>&1 &" | |
(* Create the folder if absent. *) | |
tell application "Finder" | |
if exists folder profileFolder then | |
(* NOOP *) | |
else | |
do shell script commandCreateProfileFolder | |
end if | |
end tell | |
(* Start Opera! *) | |
do shell script commandOpenOpera | |
on error e | |
display alert e as critical | |
end try |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment