Skip to content

Instantly share code, notes, and snippets.

@aquarius aquarius/OPML2PDF.scpt
Last active Aug 5, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.