Jump to content
  • 0

(Archived) Folder to note with Applescript service


DarkLordBrock

Idea

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

 

Link to comment

4 replies to this idea

Recommended Posts

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

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...