scide: LookupDialog - redo lookup on classes after partial lookup
[supercollider.git] / SCClassLibrary / Common / Collections / osx / extString_osx.sc
blob7b7bc843b933e0db7cf1f717946d4f521c71a5d5
1 + String {
2         // some things (e.g. SVN certificate acceptance, for Quarks) can only be achieved in an interactive prompt
3         runInTerminal { | shell="/bin/bash" |
4                 var fpath, file;
6                 // At present we only know how to do this when /usr/bin/open exists, which unfortunately means OSX-only.
7                 if(File.exists("/usr/bin/open").not){
8                         "String:runInTerminal - /usr/bin/open not found, unable to run. Usually this means you're not using Mac OSX, which is at present the only platform which supports String:runInTerminal (sorry).".error;
9                 };
11                 fpath = PathName.tmp ++ "SCStringForTerminal" ++ (this.hash.asString) ++ ".command";
12                 file = File(fpath, "w");
14                 if(file.isOpen.not) {"String:runInTerminal was unable to create the script file".error} {
15                         file.write("#!"++shell++"\n"
16                                         ++this++"\n"
17                                         ++"rm"+fpath.quote+"\n");
18                         file.close;
19                         ("/bin/chmod +x" + fpath).systemCmd;
20                         ("/usr/bin/open -a Terminal" + fpath).systemCmd;
21                 };
22         }
24         openOS {
25                 ("open " ++ this.escapeChar($ )).systemCmd
26         }