IN: elevate.macosx
<PRIVATE
-CONSTANT: apple-script-charmap H{
- { "\n" "\\n" }
- { "\r" "\\r" }
- { "\t" "\\t" }
- { "\"" "\\\"" }
- { "\\" "\\\\" }
-}
-
-: quote-apple-script ( str -- str' )
- [ 1string [ apple-script-charmap at ] [ ] bi or ] { } map-as
- "" join "\"" dup surround ;
-
: apple-script-elevated ( command -- )
quote-apple-script
"do shell script %s with administrator privileges without altering line endings"