Skip to content

Instantly share code, notes, and snippets.

@aquarius
Last active February 5, 2023 19:07
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aquarius/6a1529c3482c40c9a4e0 to your computer and use it in GitHub Desktop.
Save aquarius/6a1529c3482c40c9a4e0 to your computer and use it in GitHub Desktop.
Export OPML as PDF in MindNode
set folderPath to choose folder
set fileExtension to "opml"
tell application "Finder"
try
set the fileList to files of folderPath whose name extension is fileExtension
end try
end tell
tell application "/Applications/MindNode.app"
repeat with mindNodeFile in fileList
open (mindNodeFile as alias)
set mindNodeDocument to document 1
set fileName to POSIX path of (mindNodeFile as alias)
set baseName to (characters 1 thru -((count of fileExtension) + 3) of fileName) as string
set exportFile to ((baseName & ".pdf") as POSIX file)
tell mindNodeDocument to export to exportFile as PDF
close window 1 without saving
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment