tried to test with from user scripts folder but it fails. with an error
(system (string-append osascriptdir "open-terminal.scpt" "\"cd /Applications/Racket v7.7/bin/\"")
#lang racket/base | |
(require racket/system | |
racket/path | |
quickscript) | |
(script-help-string "Open a terminal in the current directory.") | |
(define-script open-terminal | |
#:label "Open terminal" | |
#:menu-path ("&Utils") | |
#:os-types (unix macosx) | |
#:output-to message-box | |
(cond | |
[(equal? (system-type 'os) 'unix) | |
(λ (str #:file f) | |
(define dir (path->string (path-only f))) | |
(system (string-append "gnome-terminal" | |
" --working-directory=\"" dir "\"" | |
" -t \"" dir "\"" | |
"&")) | |
#f)] | |
[(equal? (system-type 'os) 'macosx) | |
(λ (str #:file f) | |
(define dir (path->string (path-only f))) | |
(define osascriptdir (string-append | |
(path->string (find-system-path 'pref-dir)) | |
"quickscript/user-scripts/")) | |
(system (string-append osascriptdir "open-terminal.scpt" " \"cd " dir "\"")) | |
#f)])) |
#!/usr/bin/osascript | |
on run argv | |
if length of argv is equal to 0 | |
set command to "" | |
else | |
set command to item 1 of argv | |
end if | |
if length of argv is greater than 1 | |
set profile to item 2 of argv | |
runWithProfile(command, profile) | |
else | |
runSimple(command) | |
end if | |
end run | |
on runSimple(command) | |
tell application "Terminal" | |
activate | |
set newTab to do script(command) | |
end tell | |
return newTab | |
end runSimple | |
on runWithProfile(command, profile) | |
set newTab to runSimple(command) | |
tell application "Terminal" to set current settings of newTab to (first settings set whose name is profile) | |
end runWithProfile |
#lang racket/base | |
(require racket/system | |
racket/path) | |
(define f "/Applications/Racket v7.7/bin/slideshow") | |
(cond | |
[(equal? (system-type 'os) 'unix) | |
(λ (str #:file f) | |
(define dir (path->string (path-only f))) | |
(system (string-append "gnome-terminal" | |
" --working-directory=\"" dir "\"" | |
" -t \"" dir "\"" | |
"&")) | |
#f)] | |
[(equal? (system-type 'os) 'macosx) | |
(λ (str #:file f) | |
(define dir (path->string (path-only f))) | |
(define osascriptdir (string-append | |
(path->string (find-system-path 'pref-dir)) | |
"quickscript/user-scripts/")) | |
(system (string-append osascriptdir "open-terminal.scpt" " \"cd " dir "\"")) | |
#f)]) |