Subfolders in the attachments folder?

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
ghoetker
Posts: 9
Joined: Tue Apr 29, 2014 2:48 pm

Subfolders in the attachments folder?

Post by ghoetker »

I apologize if my search of the forum missed an answer to this.

I have about 6500 attachments for my library and the Finder isn't in love with having them all in a single folder. Is it possible (or could it be made possible) to automatically create subfolders within the default attachment folders? For example, in my prior bibliographic manager (BibDesk), I had 27 subfolders, A-Z and numbers, based on the first author's name, e.g., Smith and Jones 1999 went in the "S" subfolder (for anyone interested, I actually managed this by setting the format for auto-filing to "%a11/%a1-%Y-%T1-%n2%e" where "%a11" is the first letter of the first author's name, "/" the standard directory divider and the rest referring to portions of author name, year, title, numbers to randomize and the current file extension.)

Thank you for any information!
Jon
Site Admin
Posts: 10071
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Subfolders in the attachments folder?

Post by Jon »

You can have subfolders in the default folder, but Bookends won't make them for you automatically. You can make them in the Finder, or make them in the Attach dialog. Once made, you can (manually) tell Bookends where to put a specific attachment. You can also set a particular subfolder for a particular library (File -> Set Default Attachment Subfolder).

Jon
Sonny Software
ghoetker
Posts: 9
Joined: Tue Apr 29, 2014 2:48 pm

Re: Subfolders in the attachments folder?

Post by ghoetker »

Thank you so much for the rapid answer. For anyone who finds this question in the future, I worked out a quick Applescript which one can run periodically to clean things up. I suspect there are more lines than necessary. I often find Applescript works better when multiple steps are broken up.

Code: Select all

tell application "Finder"
	
	set attachmentFolder to "Macintosh HD:Users:XXXXXX:Bookends:Attachments" -- Obviously, change as appropriate
	set looseFiles to files in folder attachmentFolder
	repeat with eachLooseFile in looseFiles
		set fileName to (name of eachLooseFile)
		set fileNameChars to characters of fileName
		set targetFolderName to (item 1 of fileNameChars) as string
		set targetFolder to folder targetFolderName of folder attachmentFolder
		move eachLooseFile to targetFolder
	end repeat
end tell
Post Reply