<%*
const editor = app.workspace.activeEditor
// Get the link at the current cursor position
const link = editor.editor.getClickableTokenAt(editor.editor.getCursor())
if (link?.type === 'internal-link') {
// Get the current folder
const currentFolder = editor.file.parent.path
// Get the linked TFile
const linkedFile = app.metadataCache.getFirstLinkpathDest(link.text, '')
// Move the linked file to the current folder
await app.fileManager.renameFile(linkedFile, currentFolder + '/' + linkedFile.name)
new Notice(linkedFile.basename + ' has been moved to ' + currentFolder)
}
-%>