Jump to content
DarkLordBrock

mac (Archived) Folder to note with Applescript service

Recommended Posts

Hello all,

 

I have been trying to see if I could code an Applescript to do the folding in a loop, but I have not done enough with Applescript to build it. I'm hoping that someone could help.

 

I would like to take a group of folders or a single folder (while loop) and make a new note based off the folder name, then import all the files in the folder into the note it made from the folder name, then keep doing this to all the selected folders. 

 

If anyone one has some code that I could look at this would greatly help. 

 

Thank you,

Kyle

 

Share this post


Link to post

Rough, but it does work assuming you have a notebook named "appleScriptTest".  Certainly it needs error checking, drag and drop support, prompting for a folder selection (assuming nothing is selected in the Finder), and maybe better handling of subfolders (it currently only examines files one level deep).

 

------

 

on appendFiles(theFolder, theNote)

tell application "Evernote"

set allFiles to (every file of theFolder)

repeat with aFile in allFiles

tell theNote to append attachment file (aFile as text)

end repeat

end tell

end appendFiles

 

tell application "Finder"

set theItems to (selection)

repeat with anItem in theItems

if (class of anItem) is folder then

tell application "Evernote"

set theNote to create note title (name of anItem as string) with text "" notebook "appleScriptTest"

end tell

my appendFiles(anItem, theNote)

end if

end repeat

end tell

 

Share this post


Link to post

Thank you so much for that code. That is the basic outline of what I'm looking to do. THANK YOU so much, this is more then I could have asked for!!!

Share this post


Link to post
Guest
This topic is now closed to further replies.

×
×
  • Create New...