Applescript for moving lines of text into Bookends

Users asking other users for AppleScripts that work with Bookends.
Post Reply
ReferenceNewbie
Posts: 6
Joined: Wed Feb 17, 2021 6:03 pm

Applescript for moving lines of text into Bookends

Post by ReferenceNewbie »

I've developed this Applescript to expedite my workflow archiving documents by their filenames into bookends. It automatically creates them as the default type of reference as dictated by your preferences. It also presumes that you have a group labeled "New Incoming AppleScript Entries" which you can create in your library or change in the script to your preferred group name for processing.

My workflow is as follows:

1. Drag a file directory into Textedit so that all of the filenames are copied over with their path
2. Do a "find and replace" and specify the path as the find but replace with nothing, deleting them all and leaving filenames
3. Doing the same for file extensions as well if needed
4. Making sure there are no extra blank lines at the top or bottom of the document in textedit
5. Make sure that preferences has the right sort of reference type for what I am about to put in
6. Run this script to import each line and file name as their own entry in my group "New Incoming AppleScript Entries"
7. Global change other fields as necessary and add the references to appropriate groups before deleting them out of the Applescript entries group
...
profit?

Code: Select all

tell the application "TextEdit"
	set Var1 to the text of the front document
	set Var2 to every paragraph of Var1
	repeat with theTitle in Var2
		tell application "Bookends"
			tell front library window
				make new publication item with properties {title:theTitle}
				add last publication item to group item "New Incoming AppleScript Entries"
			end tell
		end tell
	end repeat
end tell

Very rudimentary but maybe of use to someone.

Post Reply