Skip to content

Instantly share code, notes, and snippets.

@carlosonunez
Created September 8, 2015 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlosonunez/4c3015efc7e34a2ad428 to your computer and use it in GitHub Desktop.
Save carlosonunez/4c3015efc7e34a2ad428 to your computer and use it in GitHub Desktop.
(* 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