Skip to content

Instantly share code, notes, and snippets.

Last active August 2, 2021 16:15
What would you like to do?
Quickscript to move the current (saved) tab to a new DrRacket window
#lang racket/base
(require quickscript
(script-help-string "move the current (saved) tab to a new DrRacket window")
(define-script move-to-new-window
#:label "Move tab to new window"
#:menu-path ("&Utils")
(λ (selection #:definitions defs #:frame fr)
(define fname (send defs get-filename))
[(or (not fname)
(send defs is-modified?))
(message-box "Cannot move window"
"The editor must be saved before moving it to a new window")]
(define fr2 (drracket:unit:open-drscheme-window #f))
(define txt (send fr2 get-definitions-text))
(smart-open-file fr2 fname)
(send fr close-current-tab)])
(module url2script-info racket/base
(provide filename url)
(define filename "move-to-new-window.rkt")
(define url ""))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment