Default attachments sub-folder for an open library

Users asking other users for AppleScripts that work with Bookends.
Post Reply
DrJJWMac
Posts: 127
Joined: Sat Jun 22, 2019 8:04 am
Location: south east USA

Default attachments sub-folder for an open library

Post by DrJJWMac »

How do I get the path to the default attachment sub-folder for a currently opened (active) library? The default attachments folder returns the base folder.

--
JJW

Jon
Site Admin
Posts: 9107
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Default attachments sub-folder for an open library

Post by Jon »

You can't. But you know the name of the default folder. And if you know the subfolders assigned to each library, you can get the name of the open libraries, match them to the subfolders you assigned, and look in /default folder/subfolder1, /default folder/subfolder1, etc.

Jon
Sonny Software

DrJJWMac
Posts: 127
Joined: Sat Jun 22, 2019 8:04 am
Location: south east USA

Re: Default attachments sub-folder for an open library

Post by DrJJWMac »

> And if you know the subfolders assigned to each library, ...

I can certainly take a brute force or hard-coded approach.

Let me use this opening then also to request AppleScript access to the default folder path for the current (frontmost) library window. Alternatively or in addition, as requested in a separate thread, provide a command/menu option to copy attachments to the default folder of the current (frontmost) library.

The greatest benefit that Bookends offers to me right now is its ability to split libraries into smaller chunks. One reason is that I can work a focused mode, especially in transit on an iPad. Consider also that a library can also be its own self-contained bibliography for a publication. In both cases, significant advantages are gained when the library is designated to have its own root folder with its own store of attachments. The former situation (focused/iPad mode) should allow the library to sync cleanly. The latter situation will allow the library default folder to be archived as one part of the entire publication dossier at the completion of the work.

For the above reasons, I really want to be able routinely as needed to confirm that all attachments for a library are resident (copied into) the default folder for the library.

--
JJW

DrJJWMac
Posts: 127
Joined: Sat Jun 22, 2019 8:04 am
Location: south east USA

Re: Default attachments sub-folder for an open library

Post by DrJJWMac »

Follow up ...

I can GET the path for an attachment. Once I copy over an attachment to the new folder, how do I reset/change the attachment path?

I tried deleting the attachment item. I tried removing the attachment item.

I tried adding the other attachment item.

Jon
Site Admin
Posts: 9107
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Default attachments sub-folder for an open library

Post by Jon »

Bookends doesn't store attachment paths, it stores just the name of the attachment. Bookends will then look in the default folder or subfolders for that attachment. So you must move, not copy, the file to the subfolder, or Bookends will find the pdf of the same name in the default folder.

This is why Bookends always ensures that attachment names are unique when they are added.

Jon
Sonny Software

DrJJWMac
Posts: 127
Joined: Sat Jun 22, 2019 8:04 am
Location: south east USA

Re: Default attachments sub-folder for an open library

Post by DrJJWMac »

> Bookends doesn't store attachment paths, it stores just the name of the attachment.

Well, the library knows its default attachment folder. I just want an AppleScript call to return that value.

Code: Select all

default attachments path of frontmost library window
> So you must move, not copy, the file to the subfolder, or Bookends will find the pdf of the same name in the default folder.

I prefer to have the PDF file in the folder that is directly associated with the source library itself. Hence ... I prefer to copy as needed.

> This is why Bookends always ensures that attachment names are unique when they are added.

Perhaps this approach could be changed. Duplicate file names can be allowed when files are identified by their full paths and the full paths are different.

Jon
Site Admin
Posts: 9107
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Default attachments sub-folder for an open library

Post by Jon »

Of course it's not going to change, it's a fundamental aspect of how Bookends deals with attachments (and has many advantages). You can rename the attachment when you move it (e.g. add a random number, or whatever) and then update the attachment field in the library to contain the new name. Or not.

Jon
Sonny Software

DrJJWMac
Posts: 127
Joined: Sat Jun 22, 2019 8:04 am
Location: south east USA

Re: Default attachments sub-folder for an open library

Post by DrJJWMac »

> Of course it's not going to change,

Ok. I'll work around this as I need.

I leave this thread how I entered it ... requesting an AppleScript command to get the default attachments (sub)-folder for an open library.

Jon
Site Admin
Posts: 9107
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Default attachments sub-folder for an open library

Post by Jon »

It's already done.

Jon
Sonny Software

Post Reply