Skip to content

Instantly share code, notes, and snippets.

@chasemc
Created January 2, 2024 17:20
Show Gist options
  • Save chasemc/625bce464ab183d51a06a2760d82c87f to your computer and use it in GitHub Desktop.
Save chasemc/625bce464ab183d51a06a2760d82c87f to your computer and use it in GitHub Desktop.
Select a directory in R with macOS Finder
selected_dir<- system('osascript -l JavaScript -e \'a=Application.currentApplication();a.includeStandardAdditions=true;a.chooseFolder({withPrompt:"Please select a file to process:"}).toString()\'', intern = TRUE, ignore.stderr = T)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment