1 USING: cocoa.apple-script elevate elevate.unix ;
5 CONSTANT: apple-script-charmap H{
13 : quote-apple-script ( str -- str' )
14 [ 1string [ apple-script-charmap at ] [ ] bi or ] { } map-as
15 "" join "\"" dup surround ;
17 : apple-script-elevated ( command -- )
19 "do shell script %s with administrator privileges without altering line endings"
20 sprintf run-apple-script ;
23 M:: macosx elevated ( command replace? win-console? posix-graphical? -- process )
24 already-root? [ <process> command >>command 1array ] [
25 posix-graphical? [ ! graphical through applescript
26 command apple-script-elevated