Last active
February 5, 2023 19:07
-
-
Save aquarius/6a1529c3482c40c9a4e0 to your computer and use it in GitHub Desktop.
Export OPML as PDF in MindNode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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