Feature Request: Modifications to Improve Renaming
Posted: Fri May 06, 2022 10:49 pm
I am restructuring an AppleScript that copies attachments into a sub-folder under the Attachments folder. In doing this, I realized why I had to rename the attachment after it was copied. To identify an attachment, Bookends flattens the Attachments folder and parses the list. It does not distinguish these three PDF files ...
Attachments (folder)
- SomePDF.pdf
- Library 1 (sub-folder)
-- SomePDF.pdf
- Library 2 (sub-folder)
-- SomePDF.pdf
I have a way to do this by prefixing the filename with the name for the attachments folder. The result is
Attachments (folder)
- SomePDF.pdf
- Library 1 (sub-folder)
-- Library 1 SomePDF.pdf
- Library 2 (sub-folder)
-- Library 2 SomePDF.pdf
I have one request as a result of my explorations. Can Bookends provide an AppleScript command "rename attachment using format (format name)". This will allow me (and others) to employ the power and flexibility built into Bookends rather than rolling my own fixed renaming code. If not, I will continue instead as below.
My AppleScript will put the window name into field U20. My AppleScript renaming will mimic manual renaming using format with u20 d - a. But ...
I make note of a confusion in the Format Manager inputs. Under Special Characters, the command ! (exclamation point) is given as a way to input the Database name. In truth, it inputs the full Database path. I'd prefer that ! would input only the Database NAME (as appears in the bibliography window), not the full path to the database. In the format manager for my renaming format, I could instead use ! d - a rather than u20 d - a, and I will not have to rely on running my AppleScript to populate the U20 field prior to manually adding attachments and/or re-running to rename the attachment after it is attached.
Summary
--
* Have an AppleScript command to rename an attachment using a specific format
* Have ! insert only the NAME for the database (the name for the frontmost window) not the full path to the database file
I hope this is clear enough to follow.
Attachments (folder)
- SomePDF.pdf
- Library 1 (sub-folder)
-- SomePDF.pdf
- Library 2 (sub-folder)
-- SomePDF.pdf
I have a way to do this by prefixing the filename with the name for the attachments folder. The result is
Attachments (folder)
- SomePDF.pdf
- Library 1 (sub-folder)
-- Library 1 SomePDF.pdf
- Library 2 (sub-folder)
-- Library 2 SomePDF.pdf
I have one request as a result of my explorations. Can Bookends provide an AppleScript command "rename attachment using format (format name)". This will allow me (and others) to employ the power and flexibility built into Bookends rather than rolling my own fixed renaming code. If not, I will continue instead as below.
My AppleScript will put the window name into field U20. My AppleScript renaming will mimic manual renaming using format with u20 d - a. But ...
I make note of a confusion in the Format Manager inputs. Under Special Characters, the command ! (exclamation point) is given as a way to input the Database name. In truth, it inputs the full Database path. I'd prefer that ! would input only the Database NAME (as appears in the bibliography window), not the full path to the database. In the format manager for my renaming format, I could instead use ! d - a rather than u20 d - a, and I will not have to rely on running my AppleScript to populate the U20 field prior to manually adding attachments and/or re-running to rename the attachment after it is attached.
Summary
--
* Have an AppleScript command to rename an attachment using a specific format
* Have ! insert only the NAME for the database (the name for the frontmost window) not the full path to the database file
I hope this is clear enough to follow.