Skip to content

Instantly share code, notes, and snippets.

@Metaxal
Last active October 31, 2021 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Metaxal/3ed323747e1af0bd4df5acd56b03b45e to your computer and use it in GitHub Desktop.
Save Metaxal/3ed323747e1af0bd4df5acd56b03b45e to your computer and use it in GitHub Desktop.
Quickscript to open multiple files at once
#lang racket/base
;;; License: [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) or
;;; [MIT license](http://opensource.org/licenses/MIT) at your option.
(require quickscript
quickscript/utils
racket/class
racket/string
racket/gui/base)
(script-help-string "Open multiple files at once")
(define-script open-multi
#:label "Open multiple files…"
#:menu-path ("&Utils")
(λ (selection #:frame fr)
(define files
(get-file-list "Select one or several Racket files"
fr
#f
#f
#f
'()
'(("Racket Sources" "*.rkt;*.scm;*.scrbl;*.ss;*.rktd;*.rktl")
("Any" "*.*"))))
(when files
(for ([f (in-list files)])
(smart-open-file fr f)))
#f))
(module url2script-info racket/base
(provide url filename)
(define filename "open-multi.rkt")
(define url "https://gist.github.com/Metaxal/3ed323747e1af0bd4df5acd56b03b45e"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment