Skip to content

Instantly share code, notes, and snippets.

@tayiorbeii
Created November 9, 2022 20:27
Show Gist options
  • Save tayiorbeii/01a402fda94ef6948771dbcbdcb2b44d to your computer and use it in GitHub Desktop.
Save tayiorbeii/01a402fda94ef6948771dbcbdcb2b44d to your computer and use it in GitHub Desktop.
import "@johnlindquist/kit"
// Name: Copy path of selected file
// Shortcut: opt+d
// Author: Taylor Bell
let selectedFile = await getSelectedFile()
// remove the filename from the path
let path = selectedFile.replace(/\/[^\/]*$/, '')
await copy(path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment