1brightcopy
(Discussion continued from here.)
LT Copy Book - LibraryThing
Edit: Updated script from Keeline
LT Copy Book - LibraryThing
This script adds buttons for "Add to library" and "Add to wishlist" onto every Book Detail screen. When clicked, these buttons copy data from the book currently on screen and take you to the manual entry page. Data from the previous screen is pasted into the fields on the manual entry screen.

Edit: Updated script from Keeline
LT Copy Book - LibraryThing
This script adds buttons for "Add to library" and "Add to wishlist" onto every Book Detail screen. When clicked, these buttons copy data from the book currently on screen and take you to the manual entry page. Data from the previous screen is pasted into the fields on the manual entry screen.

2brightcopy
One thing I also wanted it to be able to do is let you choose a collection from a dropdown and click a button to add it to that (rather than just Your library and Wishlist). But I had no way of getting all the names of the collections from this page. My only solution was that I could have an edit box and let you type the collection name there and it would remember it for next time.
3anglemark
And it works on a localised site. Shall I burn offerings to you, or is it OK with a more general, low-key worship?
4brightcopy
3> Thanks. :) I've tried from the beginning to make all my scripts not care if you're on www.librarything.com or not. The only ones where I had to compromise was if there was simply no way grab the element for the data I need and had to depend on the language-specific text. That's pretty rare and I think I've been good to note when it happens.
This is also one of the reasons this script doesn't grab physical stats. The html where those are listed is completely devoid of any useful ids and such that I can use to figure out what the data is. So even if I went to all the trouble of coding something to try to get it, it'd be limited to English-only. Just not worth it at this point. Besides, I think the people who really care about physical stats may be doing their own measuring just to be sure. ;)
This is also one of the reasons this script doesn't grab physical stats. The html where those are listed is completely devoid of any useful ids and such that I can use to figure out what the data is. So even if I went to all the trouble of coding something to try to get it, it'd be limited to English-only. Just not worth it at this point. Besides, I think the people who really care about physical stats may be doing their own measuring just to be sure. ;)
5brightcopy
3> Oh yeah, I should mention there is a spot that does prefer English. Author names are listed on the Book Details page as Firstname Lastname. That means I have to try to do some voodoo to flip them back around. I basically take the bit after the last space and assume that must be last name. But I have a bit in there that cheats and tries to fix suffixes.
So: Martin Luther King Jr.
Becomes: King, Martin Luther, Jr.
The strings it looks for are JR|SR|III|IV|V|VI|VII|VIII|IX. This is definitely very English-centric. I'll look at adding a menu option where you can enter your own list of suffixes for it to use.
So: Martin Luther King Jr.
Becomes: King, Martin Luther, Jr.
The strings it looks for are JR|SR|III|IV|V|VI|VII|VIII|IX. This is definitely very English-centric. I'll look at adding a menu option where you can enter your own list of suffixes for it to use.
6jjmcgaffey
Thank you! This is wonderful. I don't actually add books from others' listings very often...but every time I do it's an utter frustration. Saved! (one more download...)
7Noisy
If you could do a version that just did title and author, that would be wonderful. A suppose the alternative is to find a page which only has those elements on it.
Of course it's FF only, isn't it? I just access my wishlist account from MSIE to stop having to switch logins
Of course it's FF only, isn't it? I just access my wishlist account from MSIE to stop having to switch logins
8brightcopy
It should work in chrome, especially if you install the tampermonkey addon.
When you say just title and author, do you still mean from book details or from the work, where there are already the add to buttons?
ETA: If it doesn't work for you in chrome, give me a shout and I'll check it out.
When you say just title and author, do you still mean from book details or from the work, where there are already the add to buttons?
ETA: If it doesn't work for you in chrome, give me a shout and I'll check it out.
9Aerrin99
Wow. I don't do much of this sort of thing, but I can definitely appreciate how awesome this can be for folks who do.
10jjmcgaffey
I just used this a couple dozen times to enter my new volumes of a...well, a sort of magazine (filk songbook, bi-monthly). It was fantastic - _so_ much easier than entering or even copy-pasting - I just started with one issue I already had and only had to modify the issue number and the publication date.
Well. Actually I had to modify/add rather more than that, because I needed to add them to a second collection (besides Your Library), and needed to add the tags. The script doesn't notice either of those, and I'm not sufficiently proficient to write them in. I did use the try/catch to open up the collection list so I didn't have to click on Show All each time (commented out the if and the checked(false), which left Your Library checked and the list open). But I couldn't figure out how to add it to another collection, nor how to copy the tags. Any chance of that dialog box, or even a place to put collection numbers? I can find the numbers on the Stats/Memes>Collections page (click on an overlap and see what the one you don't know is), but I don't know where to put it to make it add. I tried a second variable just below the $x1 (same data except not the variable collection), but that blanked everything - nothing copied.
I'm perfectly willing to go messing around in the script to make it do different tricks for different uses (I want the tags from my own books, probably don't want someone else's), I just don't know what to mess with. A GUI would be nice (checkboxes for different elements?)...but a lot of trouble, right? and this is so nice as is I don't want to seem greedy.
Well. Actually I had to modify/add rather more than that, because I needed to add them to a second collection (besides Your Library), and needed to add the tags. The script doesn't notice either of those, and I'm not sufficiently proficient to write them in. I did use the try/catch to open up the collection list so I didn't have to click on Show All each time (commented out the if and the checked(false), which left Your Library checked and the list open). But I couldn't figure out how to add it to another collection, nor how to copy the tags. Any chance of that dialog box, or even a place to put collection numbers? I can find the numbers on the Stats/Memes>Collections page (click on an overlap and see what the one you don't know is), but I don't know where to put it to make it add. I tried a second variable just below the $x1 (same data except not the variable collection), but that blanked everything - nothing copied.
I'm perfectly willing to go messing around in the script to make it do different tricks for different uses (I want the tags from my own books, probably don't want someone else's), I just don't know what to mess with. A GUI would be nice (checkboxes for different elements?)...but a lot of trouble, right? and this is so nice as is I don't want to seem greedy.
11brightcopy
Glad it's been useful for you. I probably won't have any time to update it anytime soon because, well, busy. Having it let you pick collections was one of those features I wanted but just never got a chance to add.
But I do think you should be able to hack around it and force the collection by changing line 239 from:
var collection = GM_getValue(ltcbCollection.key);
to
var collection = 5;
Or whatever your collection id is.
A better solution for you might be to hijack the "add to wishlist" button. Change line 114:
function addToWishlistClick() {
addToClick(4)
}
to
function addToWishlistClick() {
addToClick(/* your collection id */)
}
Or are you wanting to add it to more than one collection at the same time? My sleep deprived brain has just thought of that. This is doable, too. Just let me know.
But I do think you should be able to hack around it and force the collection by changing line 239 from:
var collection = GM_getValue(ltcbCollection.key);
to
var collection = 5;
Or whatever your collection id is.
A better solution for you might be to hijack the "add to wishlist" button. Change line 114:
function addToWishlistClick() {
addToClick(4)
}
to
function addToWishlistClick() {
addToClick(/* your collection id */)
}
Or are you wanting to add it to more than one collection at the same time? My sleep deprived brain has just thought of that. This is doable, too. Just let me know.
12jjmcgaffey
Yes, it's the two collections at once that gets complicated. Though...I just thought...if I replace the $x1 variable collection (line 243) with my other collection ID, then use the try/catch to check the first child, that would work (I want Your Library and a different one (Working On)).
And congrats - I'd missed your news! He's a cutie.
ETA - OK, so it works fine if I tell $x1 to check both of them (using the variable collection and the ID, in a second, duplicated line). That's even easier, and will work with Wishlist as well.
And I figured out tags, too - copied the lines with ltcbTitle and changed them to ltcbTags. Works! I'll have to comment out three lines if I don't want tags, but that's fine.
Heh. So all I had to do was ask for help, and I'd figure it out myself... Thanks!
And congrats - I'd missed your news! He's a cutie.
ETA - OK, so it works fine if I tell $x1 to check both of them (using the variable collection and the ID, in a second, duplicated line). That's even easier, and will work with Wishlist as well.
And I figured out tags, too - copied the lines with ltcbTitle and changed them to ltcbTags. Works! I'll have to comment out three lines if I don't want tags, but that's fine.
Heh. So all I had to do was ask for help, and I'd figure it out myself... Thanks!
13brightcopy
Ain't that always how it is? ;)
And thanks. He needs to be a cutie at times like these...
And thanks. He needs to be a cutie at times like these...
14rosalita
I love the idea of this script, but I don't seem to be able to make it work properly. I'm sure I'm just doing something stupid.
First, I installed the script using TamperMonkey in Chrome.
Here's what I did: I was on my recommendations page and saw Jane Eyre listed. I've already read it, but apparently had not added it to my catalog. I clicked on the title and it took me to the work page, but there was no link to the Book Details page. So I clicked on one of the member names under Recently Added By, navigated to their catalog, searched for Jane Eyre, and clicked on it. That took me back to the Jane Eyre page, but now there was a link for Book Details. I clicked it, and sure enough I had a second set of "Add to your Library" and "Add to Wishlist" buttons, located just where you show them in your screenshot in message 1. I clicked on "Add to Library", and it did indeed open up the manual entry form, but Title, Author and the other fields all said Undefined instead of being filled in with the Jane Eyre data.
Obviously I must be doing something wrong to even get to that page, because the way I did it is even more unwieldy than the built-in way, but then what did I do wrong to not get the pre-filled fields? Sorry for being such a dunderhead.
First, I installed the script using TamperMonkey in Chrome.
Here's what I did: I was on my recommendations page and saw Jane Eyre listed. I've already read it, but apparently had not added it to my catalog. I clicked on the title and it took me to the work page, but there was no link to the Book Details page. So I clicked on one of the member names under Recently Added By, navigated to their catalog, searched for Jane Eyre, and clicked on it. That took me back to the Jane Eyre page, but now there was a link for Book Details. I clicked it, and sure enough I had a second set of "Add to your Library" and "Add to Wishlist" buttons, located just where you show them in your screenshot in message 1. I clicked on "Add to Library", and it did indeed open up the manual entry form, but Title, Author and the other fields all said Undefined instead of being filled in with the Jane Eyre data.
Obviously I must be doing something wrong to even get to that page, because the way I did it is even more unwieldy than the built-in way, but then what did I do wrong to not get the pre-filled fields? Sorry for being such a dunderhead.
15brightcopy
After exhaustive testing (well, *I'M* exhausted!), I tracked this down to a bug in TamperMonkey and have posted to their forum:
http://forum.tampermonkey.net/viewtopic.php?f=17&t=237
If they get it fixed, the script should work again. I'll keep an eye on it and post here if I hear anything.
Thanks for letting me know!
http://forum.tampermonkey.net/viewtopic.php?f=17&t=237
If they get it fixed, the script should work again. I'll keep an eye on it and post here if I hear anything.
Thanks for letting me know!
17brightcopy
Don't worry about it. :)
That was a bad bug that probably would have affected several of my scripts (not to mention plenty of other peoples). And the author of TM had been trying to track it down a for a while so I was in a good position to know exactly how to reproduce the problem. Everybody wins.
The TamperMonkey author has fixed the bug in the beta version of TM. I've posted to ask when it will hit the main TM extension because switching to the Beta means you have to reinstall all your scripts (a pain). Hopefully it will be soon.
I'll keep you posted.
That was a bad bug that probably would have affected several of my scripts (not to mention plenty of other peoples). And the author of TM had been trying to track it down a for a while so I was in a good position to know exactly how to reproduce the problem. Everybody wins.
The TamperMonkey author has fixed the bug in the beta version of TM. I've posted to ask when it will hit the main TM extension because switching to the Beta means you have to reinstall all your scripts (a pain). Hopefully it will be soon.
I'll keep you posted.
18rosalita
Wow, that does sound like a win-win-win situation! I'll look forward to your "all-clear" message.
19brightcopy
It looks like the most current version of Tampermonkey has the fixes. So you might want to update now. Have fun!
20rosalita
#19 by @brightcopy> Works like a charm! Thanks so much for this.
21guido47
Just followed the link in #1. Downloaded.
All I got was "another" toolbar 'Utility chest' which also tried to change my default home page.
Umm. What did I do wrong?
All I got was "another" toolbar 'Utility chest' which also tried to change my default home page.
Umm. What did I do wrong?
22brightcopy
That sounds odd. When you say you downloaded it, do you mean you clicked on the Install button on the "LT Copy Book" page?
What browser do you have?
Nothing like that should have been installed. It sounds like some kind of adware.
What browser do you have?
Nothing like that should have been installed. It sounds like some kind of adware.
23rsterling
21 - What you clicked on was an ad with a "download" button image in it. What you needed to click on was the "install" button at the top right of the page.
Those "download" ads -- ads with fake download buttons -- are ruses used by spammers, adware, etc. You should uninstall the toolbar then run a scan for malware or adware. Then, it probably wouldn't be a bad idea to install some kind of ad-blocker in your browser.
Those "download" ads -- ads with fake download buttons -- are ruses used by spammers, adware, etc. You should uninstall the toolbar then run a scan for malware or adware. Then, it probably wouldn't be a bad idea to install some kind of ad-blocker in your browser.
24guido47
Thanks rsterling, done. And it did take over my home page. I'm used to that and do watch for that.
Does that script work on IE8. If not I guess I could have a separate shortcut which opens LT in "Firefox".
I usually don't worry too much about which browser I use, and refuse to engage in any "wars", which even in my day, "...CDC is better than IBM..." were silly (of course I am talking about mainframes :-) .
Does that script work on IE8. If not I guess I could have a separate shortcut which opens LT in "Firefox".
I usually don't worry too much about which browser I use, and refuse to engage in any "wars", which even in my day, "...CDC is better than IBM..." were silly (of course I am talking about mainframes :-) .
25guido47
I wasn't sure, but should I download Grease monkey? Except the download button was grayed out for me. In IE. Should I be in FF?
G.
PS. I have forgotten how to make a desktop shortcut in FF. Any prod to my 'grey matter' appreciated :-(
G.
PS. I have forgotten how to make a desktop shortcut in FF. Any prod to my 'grey matter' appreciated :-(
26brightcopy
Sorry to say, but IE had terrible GM support. You'll have to use FF or Chrome. If you use Chrome, install the TamperMonkey addon before any scripts.
27guido47
OK, feeling a bit fragile (birthday soon past, whatever...)
So to use your script I should:
1) be logged into LT under FF.
2) I should down load the script.
3) I should download Greasemonkey (still grayed out for me) but I'll get around that (I hope)
4) what next?
Guido.
ETA. What is the difference between 'GreaseMonkey' & 'TamperMonkey' and which should I use?
So to use your script I should:
1) be logged into LT under FF.
2) I should down load the script.
3) I should download Greasemonkey (still grayed out for me) but I'll get around that (I hope)
4) what next?
Guido.
ETA. What is the difference between 'GreaseMonkey' & 'TamperMonkey' and which should I use?
28brightcopy
If you are using Firefox, first install the Greasmonkey addon from: https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
If you are using Chrome, first install the Tampermonkey addon from: https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldm...
Once you do that, then go to this page: http://userscripts.org/scripts/show/102522
Click on the green "Install" button at the top-right.
To use it, follow the instructions and screenshots here: http://userscripts.org/scripts/show/102522
Give me a shout if it's still confusing.
Happy Birthday!
If you are using Chrome, first install the Tampermonkey addon from: https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldm...
Once you do that, then go to this page: http://userscripts.org/scripts/show/102522
Click on the green "Install" button at the top-right.
To use it, follow the instructions and screenshots here: http://userscripts.org/scripts/show/102522
Give me a shout if it's still confusing.
Happy Birthday!
29guido47
Thanks brightcopy, old age is still just that.
Well, I'm in FF, installed 'greasemonkey'.
installed the script. then went to a NON MINE book on LT.
Went to add book to "my library", then went to Manual entry, expecting to see the details in the
book details. Nope. Next baby steps please :-)
Well, I'm in FF, installed 'greasemonkey'.
installed the script. then went to a NON MINE book on LT.
Went to add book to "my library", then went to Manual entry, expecting to see the details in the
book details. Nope. Next baby steps please :-)
30brightcopy
The step you may have missed it to make sure you go to that non-mine book and click on Book Details. Then click the Add to your library button on the right.
It used to be less confusing because LT didn't put its own buttons on the Book Details page when I created the script. I should probably re-write to take over theirs.
It used to be less confusing because LT didn't put its own buttons on the Book Details page when I created the script. I should probably re-write to take over theirs.
31jjmcgaffey
No, please - yours are in a different place, if you took over theirs I wouldn't know which ones to click (I'd never be sure I was in the right place to use your script).
guido - you have to be in book details, which means you have to find the book through a person (anyone who owns it) rather than getting to the work page as usual. You'll see _two_ sets of green and pink pluses on the right page - click either of the lower, right-hand ones to activate the script.
Here's an image - I went to your library, found a book we didn't share, went to the Book Details page and (after some difficulty, see below) saw the proper script buttons.

The proper buttons are circled in red - and on the left, you can see I'm in the book details page (also look at the URL). If you just go to the work, there's no Book Details available - you have to be in a particular library.
brightcopy, just another weirdity (nothing to do with your script, really, just FYI). I went to the page and there were no script buttons; in surprise, I looked at the URL and saw https - and a globe! So if people haven't done the workaround to unhide the http and https, the globe and lock can lie.
guido - you have to be in book details, which means you have to find the book through a person (anyone who owns it) rather than getting to the work page as usual. You'll see _two_ sets of green and pink pluses on the right page - click either of the lower, right-hand ones to activate the script.
Here's an image - I went to your library, found a book we didn't share, went to the Book Details page and (after some difficulty, see below) saw the proper script buttons.

The proper buttons are circled in red - and on the left, you can see I'm in the book details page (also look at the URL). If you just go to the work, there's no Book Details available - you have to be in a particular library.
brightcopy, just another weirdity (nothing to do with your script, really, just FYI). I went to the page and there were no script buttons; in surprise, I looked at the URL and saw https - and a globe! So if people haven't done the workaround to unhide the http and https, the globe and lock can lie.
32brightcopy
Yeah, maybe I should just change my buttons to say something different.
Bleh about the https. I should probably just update all my scripts to load on https as well as http.
Bleh about the https. I should probably just update all my scripts to load on https as well as http.
33r.orrison
Since you call it the Copy Book script, how about changing the buttons to "Copy to your library" and "Copy to your wishlist"? (or even "Copy Book to your ..")
35brightcopy
#33 by @r.orrison> Because that would require new screenshots, silly!
Okay, okay, I've taken your suggestion. I've also made it work with both http/https. The new version is uploaded.
guido: you don't have to update, but if you want to just go to the userscripts link above and click the green Install button.
Okay, okay, I've taken your suggestion. I've also made it work with both http/https. The new version is uploaded.
guido: you don't have to update, but if you want to just go to the userscripts link above and click the green Install button.
36rosalita
So, when I checked for userscript updates in TamperMonkey, it said there were no updates. Should I be doing it differently?
37brightcopy
Hmm, not sure as I don't use TM regularly. When you use the script, do you see "Add to your library" (on the right, in Book Details) or do you see "Copy to your library"? If the latter, you are up to date.
If not, try going to the script page and clicking the green Install button and then do the above test. Let me know what happens and then we'll both know how well the TM update works. :D
If not, try going to the script page and clicking the green Install button and then do the above test. Let me know what happens and then we'll both know how well the TM update works. :D
38rosalita
I went to your library and selected Cod to add to my wishlist. When I went to the Book Details screen, it did indeed say 'Copy to ..." so I guess it updated automagically!
Thanks again for a super-useful script. I hope the book's good, too. :-)
Thanks again for a super-useful script. I hope the book's good, too. :-)
39brightcopy
Huzzah!
Edit: And yes, I found it quite enjoyable. As was Salt, which overlaps in some places but is much larger in scope.
Edit: And yes, I found it quite enjoyable. As was Salt, which overlaps in some places but is much larger in scope.
41Pebblesgmc
You are all so smart,
I've no idea how to any of what you are doing really.
But I sure admire that you can do what your doing.
Keep up the great work what you doing will reach my
computer illitate self some day in a form for
Computer Dummies:)
I've no idea how to any of what you are doing really.
But I sure admire that you can do what your doing.
Keep up the great work what you doing will reach my
computer illitate self some day in a form for
Computer Dummies:)
42Ealhmund
Brightcopy,
On another thread, you asked what fields I would want from your script that it doesn't provide.
The simple answer is: all of them, except the personal fields such as 'Comments', just as LT used to allow. I want the cover, the dimensions, page count, etc. You see, my primary need is for books, such as Easton Press and Folio Society, which have no ISBN's. Collectors of these editions maintain pretty accurate catalogues, often with very nice images. But many cannot be found using the 'Add-books' search function. When I can go to an FS or EP collector's catalogue and see all the data I need, it's pretty annoying to have to manually enter every field and then go searching for the cover among what is sometimes over 100 covers. But, I'd be okay without the cover if the rest were easily captured.
The real problem, though, is that my main browser is IE. I have Chrome as an alternative, and I got it setup with add-ons to allow your script to run, but the add-on was unstable - it fought with Norton anti-virus/firewall. So, for now, I can't use your script. I'll probably just get off my rear and get Firefox installed. But for now, I can't run your script to see what it does and does not capture.
Consider my comments simply as input for any future work you may put into your script.
Thanks,
Os.
On another thread, you asked what fields I would want from your script that it doesn't provide.
The simple answer is: all of them, except the personal fields such as 'Comments', just as LT used to allow. I want the cover, the dimensions, page count, etc. You see, my primary need is for books, such as Easton Press and Folio Society, which have no ISBN's. Collectors of these editions maintain pretty accurate catalogues, often with very nice images. But many cannot be found using the 'Add-books' search function. When I can go to an FS or EP collector's catalogue and see all the data I need, it's pretty annoying to have to manually enter every field and then go searching for the cover among what is sometimes over 100 covers. But, I'd be okay without the cover if the rest were easily captured.
The real problem, though, is that my main browser is IE. I have Chrome as an alternative, and I got it setup with add-ons to allow your script to run, but the add-on was unstable - it fought with Norton anti-virus/firewall. So, for now, I can't use your script. I'll probably just get off my rear and get Firefox installed. But for now, I can't run your script to see what it does and does not capture.
Consider my comments simply as input for any future work you may put into your script.
Thanks,
Os.
43brightcopy
Thanks for posting. Was the addon for Chrome TamperMonkey? If not, that's what you should be using. I've never heard of it being unstable but browsers are odd creatures (on one machine, the Delicious bookmarks toolbar just suddenly and stubbornly started refusing to show).
Just to recap:
What it captures
Title
Author
Other authors
Publication Date
Publication
ISBN
LCCN
Dewey
Primary/Secondary/Original Language
What it doesn't capture that you'd probably want
Number of volumes
Number of copies
Pagination
Dimensions
Weight
Lexile measure
Summary
What it doesn't capture that's probably not what you want
Tags
Comments
From where
BCID
What I probably can't capture
Physical Summary (doesn't appear on add books page)
Cover (see below)
I'll look into the other data when I get a chance (working on a big LT script at the moment - stay tuned!) I think I remember looking into the dimensions but it was just too tricky for me to want to spend time on, since that data has a more complex structure and required digging deeper into the guts of the LT javascript code. And then there's some data that's simply lost when it shows it on the Book Details page. For example, if you have Pagination set to 10 pages of the form i,ii,iii and 20 pages of the form 1,2,3, that shows on the Book Details page as "10; 20". It just totally leaves off what kind of pages. So I'd never be able to do anything there other than just always defaulting to 1,2,3 type pages.
The covers are, alas, not really possible due to the way the LT code works. I can't add a book and specify the cover at the same time. I could try to hack up some kind of multi-step thing, but it'd probably be far too error-prone. In fact, now that I think of it, it's almost impossible due to the way LT names the cover image on the book page versus when you have to pick the cover off the covers page.
Just to recap:
What it captures
Title
Author
Other authors
Publication Date
Publication
ISBN
LCCN
Dewey
Primary/Secondary/Original Language
What it doesn't capture that you'd probably want
Number of volumes
Number of copies
Pagination
Dimensions
Weight
Lexile measure
Summary
What it doesn't capture that's probably not what you want
Tags
Comments
From where
BCID
What I probably can't capture
Physical Summary (doesn't appear on add books page)
Cover (see below)
I'll look into the other data when I get a chance (working on a big LT script at the moment - stay tuned!) I think I remember looking into the dimensions but it was just too tricky for me to want to spend time on, since that data has a more complex structure and required digging deeper into the guts of the LT javascript code. And then there's some data that's simply lost when it shows it on the Book Details page. For example, if you have Pagination set to 10 pages of the form i,ii,iii and 20 pages of the form 1,2,3, that shows on the Book Details page as "10; 20". It just totally leaves off what kind of pages. So I'd never be able to do anything there other than just always defaulting to 1,2,3 type pages.
The covers are, alas, not really possible due to the way the LT code works. I can't add a book and specify the cover at the same time. I could try to hack up some kind of multi-step thing, but it'd probably be far too error-prone. In fact, now that I think of it, it's almost impossible due to the way LT names the cover image on the book page versus when you have to pick the cover off the covers page.
44Ealhmund
>43 brightcopy:
Yeah, that about summarizes what I'd add and what I wouldn't expect and/or want.
Re: trouble with TamperMonkey on Chrome, I had it working just fine. But, I've had problems with Norton related to Chrome and IE and have had to disable its firewall/virus protection on IE just to get it to work. Chrome add-ons are disabled upon loading, and I get an error message identifying Norton as the problem. It's Norton, not the browsers, and seems to be related to an update from about 6 weeks ago. In the process, I lost access to my cloud backup files and lost the data in their 'password vault' app, meaning, I've lost the login info for dozens of websites, right when I'm in the middle of an extended job search, logging on to many corporate and job hunt websites. I'm sick of spending hours with customer support, and will probably look into McAfee.
Anyway, that means I won't be able to use your script for awhile anyway. But, being out of work, I'm also not buying books right now, so no loss. I appreciate your volunteer efforts and look forward to whatever updates you decide on.
Os.
Yeah, that about summarizes what I'd add and what I wouldn't expect and/or want.
Re: trouble with TamperMonkey on Chrome, I had it working just fine. But, I've had problems with Norton related to Chrome and IE and have had to disable its firewall/virus protection on IE just to get it to work. Chrome add-ons are disabled upon loading, and I get an error message identifying Norton as the problem. It's Norton, not the browsers, and seems to be related to an update from about 6 weeks ago. In the process, I lost access to my cloud backup files and lost the data in their 'password vault' app, meaning, I've lost the login info for dozens of websites, right when I'm in the middle of an extended job search, logging on to many corporate and job hunt websites. I'm sick of spending hours with customer support, and will probably look into McAfee.
Anyway, that means I won't be able to use your script for awhile anyway. But, being out of work, I'm also not buying books right now, so no loss. I appreciate your volunteer efforts and look forward to whatever updates you decide on.
Os.
45JerryMmm
I would prefer people took the time to check for their own covers, as as time goes by, better covers get uploaded, and far too few are updated after initial selection.
There is a quality continuum of course, from illegible to decent to good to perfect, but blindly copying the cover, even decent or good ones, misses the chance of finding the perfect version for your edition.
I haven't installed this script on Opera yet, is your omission of Opera an indication as to whether it will work or not?
Your Search directly in member's catalogue script works fine btw.
There is a quality continuum of course, from illegible to decent to good to perfect, but blindly copying the cover, even decent or good ones, misses the chance of finding the perfect version for your edition.
I haven't installed this script on Opera yet, is your omission of Opera an indication as to whether it will work or not?
Your Search directly in member's catalogue script works fine btw.
46brightcopy
Well, I can't copy the cover so it's really a moot point. :D
As far as Opera goes, god only knows. I don't go out of my way to support it, but since I try to make things not Firefox-specific there's a good chance it will. But often there are quirks, like a thing I'm running into where I'm using a perfectly good bit of code that causes weirdness in Chrome. So YMMV.
You also apparently need to install a script for a few bit of GM support:
http://www.howtocreate.co.uk/operaStuff/userjs/aagmfunctions.js
I believe this would be necessary for this script as it uses GM_setValue.
As far as Opera goes, god only knows. I don't go out of my way to support it, but since I try to make things not Firefox-specific there's a good chance it will. But often there are quirks, like a thing I'm running into where I'm using a perfectly good bit of code that causes weirdness in Chrome. So YMMV.
You also apparently need to install a script for a few bit of GM support:
http://www.howtocreate.co.uk/operaStuff/userjs/aagmfunctions.js
I believe this would be necessary for this script as it uses GM_setValue.
47rosalita
This may be too extreme an edge case, but just in case anyone else is like me ... I would love if the button for Copy To My Wishlist could be customized to point to a different collection as specified by the user. For me, I have two wishlists: the default LT wishlist is for books I know I want to buy, and the To Borrow collection is for books I want to check out of the library. Most books I add using this script go into the Borrow collection. As it is, it is not at all difficult to just switch the checkbox before saving, but if I could set the default as To Borrow, that would save me, well, hundreds of thousands of nanoseconds every year. :-)
48brightcopy
Wouldn't be TOO bad to change. The major challenge is that the Wishlist (and Your library) have fixed collection IDs. In other words, everyone's wishlist is collection ID 4.
If you look in message 11 above, I show how to change your script so you can put any collection ID you want in there. The easiest way to get your collection id is probably to go "Your books" and change the collection to the one you want. Then go down to the bottom of the page to the "permanent link" link. It will look something like:
http: // www.librarything.com / catalog.php?view=brightcopy&collectionname=allcollections&collection=57293&shelf=list&sort=copies&sort=copiesREV
Where it says "collection=57293" is the collection ID. Just use that collection ID in my instructions above. You can also change lines 221/222 where it says "your library"/"your wishlist" to a different text if you want it to show on the button that way.
There could be a nicer way of doing it, but honestly I'm just not going to find the time. I have two or three scripts that are broken right now that I really need to find time to update first. Good luck!
If you look in message 11 above, I show how to change your script so you can put any collection ID you want in there. The easiest way to get your collection id is probably to go "Your books" and change the collection to the one you want. Then go down to the bottom of the page to the "permanent link" link. It will look something like:
http: // www.librarything.com / catalog.php?view=brightcopy&collectionname=allcollections&collection=57293&shelf=list&sort=copies&sort=copiesREV
Where it says "collection=57293" is the collection ID. Just use that collection ID in my instructions above. You can also change lines 221/222 where it says "your library"/"your wishlist" to a different text if you want it to show on the button that way.
There could be a nicer way of doing it, but honestly I'm just not going to find the time. I have two or three scripts that are broken right now that I really need to find time to update first. Good luck!
49rosalita
Ah, that solution in Message 11 appears to be exactly what I need. I don't know I could have missed it (except that it was posted way back in 2011, and I can barely remember what I had for breakfast this morning). Thanks! :-)
50brightcopy
Who are you and what did you do to my typewriter it has all these blinky lights and I can't figure out where to put the paper in!
:D
:D
51rosalita
Ha! Take a tip from me: Don't try to use the Liquid Paper correction fluid on the screen!
53brightcopy
That would explain all the sneezing.
54divinenanny
Hi Brightcopy. I'm working on my own local library database (using MySQL and PHP). I would love to code something that would take my entry in my database and copies the data into the Manual Add form. Can you tell me how (or which part of your code) you pass the values you copied into the Manual Add form?
55nandadevi
Note that the location where GreaseMonkey scripts were stored (and where the links on previous posts point to) has been closed down. These scripts, and links, previously pointed to userscripts.org. If you try to link to that location you MIGHT be taken to a mirror site, but the mirror site has very little of the functionality of the original site, and will not take you directly to the LibraryThing scripts. Manually navigating (there is no search function...) to the scripts could take days (browsing over 5000 pages)
HOWEVER, all the scripts previously stored in userscripts.org (including the librarything ones) are now available at http://www.webextender.net/index.html To get to the LT scripts from the webextender home page simply use 'librarything' as your search criteria.
HOWEVER, all the scripts previously stored in userscripts.org (including the librarything ones) are now available at http://www.webextender.net/index.html To get to the LT scripts from the webextender home page simply use 'librarything' as your search criteria.
56jjmcgaffey
Thank you! I've been finding scripts in various places, but none of them had full functionality - particularly, none of the ones I found had good searching.
Want to post this in the general thread too? I mean the Sound Off thread - http://www.librarything.com/topic/82389 . I see you posted it separately as well, that's good.
Want to post this in the general thread too? I mean the Sound Off thread - http://www.librarything.com/topic/82389 . I see you posted it separately as well, that's good.
57Shimmin
Hi Brightcopy,
I've just installed and tried using this script. The buttons appear, but the information is not copied across into the manual entry page. Any suggestions?
I'm on Firefox 34 on Windows 8 if that helps.
I've just installed and tried using this script. The buttons appear, but the information is not copied across into the manual entry page. Any suggestions?
I'm on Firefox 34 on Windows 8 if that helps.
58jjmcgaffey
It hasn't worked for a few versions of FF - at least since 32, probably further back. Or possibly it's an LT change that coincided with a new FF version. And brightcopy hasn't been around much, unfortunately.
I've done some poking around in the script and fixed something before, but haven't tried with the latest null results. You could try it...open up the script and see if you can figure out what's supposed to do what, compare what it's trying to link to with what's actually on the page (View Source), and see if you can make it behave itself.
I'll do the same...if I ever get a free minute! I've been intending to for months.
I've done some poking around in the script and fixed something before, but haven't tried with the latest null results. You could try it...open up the script and see if you can figure out what's supposed to do what, compare what it's trying to link to with what's actually on the page (View Source), and see if you can make it behave itself.
I'll do the same...if I ever get a free minute! I've been intending to for months.
59Shimmin
Thanks JJ (should I call you JJ? something else? it feels weird using full names...), that's good information.
Okay, I might take a look at it as I should have some time this week. That being said, I've never touched Greasemonkey before, so don't get your hopes up! But I can roughly handle Javascript.
For info: do we know if Add Book pages always have the same number of fields in the same order, and in every language? It's possible that this would offer a slightly different way to handle things than the current approach, or a handy backup.
Okay, I might take a look at it as I should have some time this week. That being said, I've never touched Greasemonkey before, so don't get your hopes up! But I can roughly handle Javascript.
For info: do we know if Add Book pages always have the same number of fields in the same order, and in every language? It's possible that this would offer a slightly different way to handle things than the current approach, or a handy backup.
60jjmcgaffey
>59 Shimmin: JJ's fine, or Jenn, or Jennifer (my name - though you'd have to go to my profile to find that out).
Yeah - I know a little Javascript and a little Java and a little bit of a lot of things, and was able to change the script to do what I wanted (put things in two collections, copy tags, etc). That was my first venture into Greasemonkey, and so far my last - too much else going on.
I don't know for certain about the page, but there isn't any way of rearranging things (the way the profile and the book pages can), so I suspect it is the same. However, that doesn't mean it will stay the same down the line - Tim et al do a lot of reconfiguring of one sort and another, from adding new fields to support new features to cleaning up old odd code. Which may just mean that someone else will have to fiddle it again, if you get it working and LT staff break it with new stuff.
Yeah - I know a little Javascript and a little Java and a little bit of a lot of things, and was able to change the script to do what I wanted (put things in two collections, copy tags, etc). That was my first venture into Greasemonkey, and so far my last - too much else going on.
I don't know for certain about the page, but there isn't any way of rearranging things (the way the profile and the book pages can), so I suspect it is the same. However, that doesn't mean it will stay the same down the line - Tim et al do a lot of reconfiguring of one sort and another, from adding new fields to support new features to cleaning up old odd code. Which may just mean that someone else will have to fiddle it again, if you get it working and LT staff break it with new stuff.
61Shimmin
Hi JJ,
success! The problem seems to be the lack of two metablock imperatives, which need adding to the header. Just adding in these two lines before // ==/UserScript== will get things running:
// @ grant GM_getValue
// @ grant GM_setValue
EDIT: so using an at symbol creates a link to a user profile, apparently. Take out the space between at and grant to get the working code...
Incidentally, there's a ton of LT scripts that come up if you search Webextender. The one you want is called LT Copy Book - LibraryThing for Greasemonkey. It's currently at http://www.webextender.net/scripts/show/102522.html - hopefully it'll stay there!
success! The problem seems to be the lack of two metablock imperatives, which need adding to the header. Just adding in these two lines before // ==/UserScript== will get things running:
// @ grant GM_getValue
// @ grant GM_setValue
EDIT: so using an at symbol creates a link to a user profile, apparently. Take out the space between at and grant to get the working code...
Incidentally, there's a ton of LT scripts that come up if you search Webextender. The one you want is called LT Copy Book - LibraryThing for Greasemonkey. It's currently at http://www.webextender.net/scripts/show/102522.html - hopefully it'll stay there!
62jjmcgaffey
It works, great! It also complained so I added //@ grant metadata (same thing, take out the space). Yes, webextender seems to have taken over from userscript.org - thank goodness.
Now I need to put my changes back in - as I mentioned above, I'd altered it to copy tags as well and to check off more than one collection (and have the collections list open on the Manual Add page). When it stopped working, I went and got a fresh new copy (in case that was the problem) and wiped out my changes...hopefully I saved them somewhere. Or I'll have to figure them out again.
And then I'll try that fix on a few others that have stopped working. Thanks, Shimmin!
Now I need to put my changes back in - as I mentioned above, I'd altered it to copy tags as well and to check off more than one collection (and have the collections list open on the Manual Add page). When it stopped working, I went and got a fresh new copy (in case that was the problem) and wiped out my changes...hopefully I saved them somewhere. Or I'll have to figure them out again.
And then I'll try that fix on a few others that have stopped working. Thanks, Shimmin!
63Shimmin
Glad it works for you too! I'll grab the metadata one too, good tip.
I have started working on getting physical data, vols and copies in. The last two work in my test version, but I'm having trouble with the way data is transferred into the new record, plus the weird and wacky HTML behind the forms. Not quite what I'm used to. Then I remembered I was supposed to accomplish things today and I was still in my pyjamas at lunchtime playing with code.
I have started working on getting physical data, vols and copies in. The last two work in my test version, but I'm having trouble with the way data is transferred into the new record, plus the weird and wacky HTML behind the forms. Not quite what I'm used to. Then I remembered I was supposed to accomplish things today and I was still in my pyjamas at lunchtime playing with code.
64jjmcgaffey
LOL! So easy to do - "just a couple more minutes, I've almost got this working..."
65Shimmin
#64 - tell me about it! Also, apparently I can only code when I should really be doing something else.
So, update - I think it isn't actually possible to get physical data in the way I was hoping, because of the way it's structured. Travelling through HTML nodes only works with a consistent data structure, but LT pages only generate those fields that contain data, so you can't predict whether (say) weight or height actually exist. As such, actually getting the data is just as troublesome as Brightcopy said.
Fundamentally, short of some really complicated stuff analysing the text of fields and comparing to various languages... I don't think we can do this. And who has time to code that?
What would quickly and easily solve the problem would be if those other fields had ids. I have no idea why they don't, and would think it should be easy to add them. So the best way forward might be to just ask Tim to have ids added to the remaining fields so everything is consistent.
So, update - I think it isn't actually possible to get physical data in the way I was hoping, because of the way it's structured. Travelling through HTML nodes only works with a consistent data structure, but LT pages only generate those fields that contain data, so you can't predict whether (say) weight or height actually exist. As such, actually getting the data is just as troublesome as Brightcopy said.
Fundamentally, short of some really complicated stuff analysing the text of fields and comparing to various languages... I don't think we can do this. And who has time to code that?
What would quickly and easily solve the problem would be if those other fields had ids. I have no idea why they don't, and would think it should be easy to add them. So the best way forward might be to just ask Tim to have ids added to the remaining fields so everything is consistent.
66macsbrains
Unfortunately, I'm not having any luck with the suggested changes (assuming I did them correctly). Alas.
67jjmcgaffey
There's a // ==UserScript== section that ends with // ==/UserScript== - put the //@ lines in just above the end of that (and make sure to take out the space between @ and grant. And save. That's all I can think of (all the errors I made...).
68jjmcgaffey
It occurs to me (see the RSI thread) that one of us should upload the corrected script to WebExtender. Do you want to do it? If not, I will. It probably means making an account, and entering the script there...so it won't link directly to brightcopy's version. Not sure if that's possible, though it would be nice.
70Shimmin
#68 Jenn, if you have time that would be great, especially as you already have the extra work you did. If you post a link here, people using LT can probably find it, but as you say, a link on WebExtender may not be possible.
71jjmcgaffey
I've asked brightcopy if he wants to put the corrected script up; if he's not interested, I'll do it.
73jjmcgaffey
Yeah, I PMed him. We'll see.
74jjmcgaffey
brightcopy says just put it up, it's a public domain script. Missing the point a little, but whatever - I'll put it up shortly.
76jjmcgaffey
No, sorry, I'm a little swamped - taking a class on Android programming. I'll get it up soon. And link here when I do.
78jjmcgaffey
I lost both my computers simultaneously - hard drive failure on one and I have no idea what was going on with the other one. I'm not sure I still have the script, some of my backups also failed. So no, sorry, I haven't gotten it up (now I have both computers back, but not all the data, and some of it is in weird places). @macsbrains, if you have a working copy, could you put it up?
79omargosh
Ugh, sorry to hear about your computer failures. That's a nightmare. I sprung for remote backup after one hard drive failure, which saved me another time when I had to wipe my drive due to a virus. Anyway ... I put up what I think is a working version of brightcopy's Copy Book script here: https://greasyfork.org/en/scripts/20899-lt-copy-book-librarything
Let me know if it still has problems and I can try my hand at fixing them.
Let me know if it still has problems and I can try my hand at fixing them.
80Keeline
@omargosh, somehow I missed the availability of this update. My installed copy was identified as v. 0.0 and this is v. 2. It does seem to work for me. I will compare the code to see if I can learn something about this kind of coding. I mainly do PHP and sometimes have JS/JQ for sites. Thank you for reminding me of the availability.
James
_____
James
_____
81Keeline
Comparing version 0 with version 2, I see only these lines added. I assume they are designed to allow access to some Grease Monkey functions.
Aha: https://tampermonkey.net/documentation.php#_grant
This makes sense since I am using TamperMonkey on Chrome on Mac.
// @@grant GM_setValue
// @@grant GM_getValue
// @@grant GM_deleteValue
// @@version 2
It is interesting that version 0 stopped working and version 2 works with these changes.
I'd love to see a commented version of this and other GM for LT scripts. In the meantime I'm glad to have the function working again. Thanks again, @brightcopy and @omargosh for this.
James
Aha: https://tampermonkey.net/documentation.php#_grant
This makes sense since I am using TamperMonkey on Chrome on Mac.
// @@grant GM_setValue
// @@grant GM_getValue
// @@grant GM_deleteValue
// @@version 2
It is interesting that version 0 stopped working and version 2 works with these changes.
I'd love to see a commented version of this and other GM for LT scripts. In the meantime I'm glad to have the function working again. Thanks again, @brightcopy and @omargosh for this.
James
82omargosh
>81 Keeline:
Yeah, those were the only changes I made. It seems that Grease/Tampermonkey used to allow scripts without the grant stuff explicitly set. And Greasyfork barked at me about not having a version number, so I just added something. But if you find other things that weren't working like before, lemme know and I can try to look into it. (And I try to comment my scripts with what I'm doing ... often for my own benefit when I later can't remember :-) ... but if you'd like more verbiage in the future, I can try to oblige ... though I'm not sure if comments are even allowed in those first lines).
Yeah, those were the only changes I made. It seems that Grease/Tampermonkey used to allow scripts without the grant stuff explicitly set. And Greasyfork barked at me about not having a version number, so I just added something. But if you find other things that weren't working like before, lemme know and I can try to look into it. (And I try to comment my scripts with what I'm doing ... often for my own benefit when I later can't remember :-) ... but if you'd like more verbiage in the future, I can try to oblige ... though I'm not sure if comments are even allowed in those first lines).
83Opteryx
>79 omargosh: If anyone can figure out how to get the Copy Book script working again, that would be sweet... I saw the first include URL needed updating, but that alone doesn't make it work again, and I couldn't figure out the rest of it.
84Keeline
The 2.0 version of the script does seem to work. Remember that it is looking for the book details page in this format:
https://www.librarything.com/work/1812/details/113872148
When Chrome : Tampermonkey is on with the script installed, there will be two buttons added to the page labeled "copy to your library" and "copy to your wishlist". The first one is the one I use and it goes to the "addnew.php" script. The key is that most of the fields will be filled in.
I have a notion that if LT2 ever comes about, there will be enough changes that this will break again.
James
https://www.librarything.com/work/1812/details/113872148
When Chrome : Tampermonkey is on with the script installed, there will be two buttons added to the page labeled "copy to your library" and "copy to your wishlist". The first one is the one I use and it goes to the "addnew.php" script. The key is that most of the fields will be filled in.
I have a notion that if LT2 ever comes about, there will be enough changes that this will break again.
James
85Maddz
OK, how does this work? I'm adding comic issues, and doing it manually is a slow process. (Admittedly, I'm towards the end of the process, having 1.25 boxes to go - Cerebus and Promethea, but it will be useful for when I get to obscure small press RPG titles.)
I've enabled Tampermonkey, and got the script, but for the life of me I can't see the extra buttons. Is there a step-by-step guide somewhere?
(Chrome Version 90.0.4430.93 (Official Build) (x86_64), macOS High Sierra version 10.13.6)
ETA: Oh, I see. Instead of the script being able to access the work page, I have to find a member with it to access the book details page which adds several steps to the process. Whether this is less tedious than my current workflow, I don't know - there still seems to be significant typing involved, but at least the entry should auto-combine.
ETA 2: It would be useful if you are duplicating an entry in your library to be able to duplicate the tags used. Pity that the media type isn't included on the book details page as that I have to add manually.
ETA 3: Annoying that the collections automatically include 'Your library' (I have to remember to de-select it). The collection(s) should be taken from the entry (or entries) currently selected on your 'Add books' page.
I've enabled Tampermonkey, and got the script, but for the life of me I can't see the extra buttons. Is there a step-by-step guide somewhere?
(Chrome Version 90.0.4430.93 (Official Build) (x86_64), macOS High Sierra version 10.13.6)
ETA: Oh, I see. Instead of the script being able to access the work page, I have to find a member with it to access the book details page which adds several steps to the process. Whether this is less tedious than my current workflow, I don't know - there still seems to be significant typing involved, but at least the entry should auto-combine.
ETA 2: It would be useful if you are duplicating an entry in your library to be able to duplicate the tags used. Pity that the media type isn't included on the book details page as that I have to add manually.
ETA 3: Annoying that the collections automatically include 'Your library' (I have to remember to de-select it). The collection(s) should be taken from the entry (or entries) currently selected on your 'Add books' page.
86cns1000
I see that this has been a long-running thread. Apologies; this is something I have just discovered. I was looking for a way to quickly copy books to minimize manual effort in entering a whole collection of periodical issues, and it looked like this would be very helpful. ATM I am using Firefox / Greasemonkey and have installed the plugin. I see the two option buttons on the work page, but when I select the work from my books and use the Copy button, apparently nothing gets copied. It looks the same as the Manual Entry page. Am I missing something here ? Would appreciate any assistance.
87Maddz
>86 cns1000: No, that's right. When you select the 'Copy to my Library' button it brings up a pre-filled manual entry page.
The Title, Author, Author Role, Other Authors and publication details are copied from the source record.
Collections: Your Library is always selected, plus if you have a collection selected on the Add books page, that will also be selected.
Tags will need to be entered if you use them, as will Media Type and any other information further down the page.
Provided you don't alter the author and title, the record will be automatically combined with the existing (source) record. Once you've added the book, you can then change the cover and edit the author/title.
The Title, Author, Author Role, Other Authors and publication details are copied from the source record.
Collections: Your Library is always selected, plus if you have a collection selected on the Add books page, that will also be selected.
Tags will need to be entered if you use them, as will Media Type and any other information further down the page.
Provided you don't alter the author and title, the record will be automatically combined with the existing (source) record. Once you've added the book, you can then change the cover and edit the author/title.
88cns1000
Thanks for the reply. By the way, just to confirm, it is on the Book Details page that I am seeing the buttons. The book I am trying to copy is this one:
https://www.librarything.com/work/27106264/details/206331188
When I click Copy to My Library, I do get the Manual Add screen, but nothing has been copied, other than that the "Your Library" checkbox is marked. Everything else is blank. Am I doing something wrong ? Appreciate your help, thanks
https://www.librarything.com/work/27106264/details/206331188
When I click Copy to My Library, I do get the Manual Add screen, but nothing has been copied, other than that the "Your Library" checkbox is marked. Everything else is blank. Am I doing something wrong ? Appreciate your help, thanks
89Maddz
>88 cns1000: Odd, I get this when I click copy to my library:
screenshot
So I don't understand why it doesn't seem to be working for you. Do you have an ad blocker installed?
screenshotSo I don't understand why it doesn't seem to be working for you. Do you have an ad blocker installed?
90SandraArdnas
>89 Maddz: You seem to be using Chrome, as opposed to FF.
91Maddz
>90 SandraArdnas: Yes, I am...
93cns1000
Not running any ad blocker or popup blocker. Firefox is the latest version, 92.0.1. Restarted and cleared cache; made no difference. Most of the settings are default; security level is standard.
Block pop-up windows
was on
Warn you when websites try to install add-ons
was also on
I set both of them to off; that made no difference either. Will try all this with Chrome and see what happens.
Any other suggestions would be appreciated
Thanks
Block pop-up windows
was on
Warn you when websites try to install add-ons
was also on
I set both of them to off; that made no difference either. Will try all this with Chrome and see what happens.
Any other suggestions would be appreciated
Thanks
94cns1000
Ok, apparently there is no Chrome option since this is just a Greasemonkey script. So I guess I can forget about the Copy function ?
Edited later: actually, reading more carefully, there is a way to install the script in Chrome with Tampermonkey. And it works; tested it with the same entry.
Would be really nice if it copied a few more fields, but for now I won't complain.
Thanks
Edited later: actually, reading more carefully, there is a way to install the script in Chrome with Tampermonkey. And it works; tested it with the same entry.
Would be really nice if it copied a few more fields, but for now I won't complain.
Thanks
95jjmcgaffey
Yeah. Not complete, but _very_ helpful. It stopped working in Firefox/Greasemonkey some time ago, and no one's gone in and fiddled with it to see if the problem can be fixed. But if it works in Chrome, that's a decent workaround for entering a bunch of stuff.
96Keeline
If you find that there are specific fields that are not being copied by the current script, you can try your hand at following the pattern used for the current fields and adding the ones you want. There are a couple places where the data is collected from the detail page and written to the blank entry form.
I use Chrome / TamperMonkey on a Mac for this.
I think there were choices made to exclude certain fields (like tags) because one person's tags may not be another's.
James
I use Chrome / TamperMonkey on a Mac for this.
I think there were choices made to exclude certain fields (like tags) because one person's tags may not be another's.
James
97Maddz
>96 Keeline: It's sometimes useful to copy tags when you're cloning one of your own entries (looks at the comic books I entered over the summer) but I agree it's not useful when you're cloning someone else's record.
Is there a way to toggle fields?
Is there a way to toggle fields?
98Keeline
Probably not at the front-end side of things. However, if you looked at the script, you could comment out any defined value that you do not want to copy. For example, I see:
The double slashes at the beginning of a line in the script are comments.
James
var ltcbLanguage2 = { key:'ltcbLanguage2' , id:'bookedit_lang2' , field:'field_lang2' };
var ltcbLanguageO = { key:'ltcbLanguageO' , id:'bookedit_lang_original' , field:'field_lang_original' };
//var ltcbVolumes = { key:'ltcbVolumes' , id:'bookedit_numVolumes' , field:'numVolumes' , path:'//tdtext()="Number of Volumes"/../td@class="bookeditfield"'};
//var ltcbPages = { key:'ltcbPages' , id:'bookedit_pagecount' , field:'pagecount' , path:'//tdtext()="Pages"/../td@class="bookeditfield"'};
The double slashes at the beginning of a line in the script are comments.
James
99bnielsen
I wonder if one could use Selenium to automate a kind of restore from an export file or maybe more useful: something like Power Edit just under program control. Would that make sense? Has anyone tried something like that?
100Keeline
One thing I notice about the displayed content for Tags: is that the content includes a lot of links so you can show the other books in your catalog with that tag:
This could make it hard to work with since what you'd really want to paste into the input field on the blank form is:
ULTB, science
So it might take some extra Javascript to strip out the unwanted tags before pasting into the form in the function defined lower in the script.
Some programming is trial and error before occasional success. If you mess up the script badly, you can remove it and reinstall it.
James
<tr class="visible"><td class="left">Tags</td><td class="bookeditfield" id="bookedit_tags"><a href="/tag/ULTB" target="_top">ULTB</a>, <a href="/tag/science" target="_top">science</a> </td></tr>
This could make it hard to work with since what you'd really want to paste into the input field on the blank form is:
ULTB, science
So it might take some extra Javascript to strip out the unwanted tags before pasting into the form in the function defined lower in the script.
Some programming is trial and error before occasional success. If you mess up the script badly, you can remove it and reinstall it.
James
101Maddz
>98 Keeline: Unfortunately, I'd be thinking along the lines of a pop-up that allowed you to either select the field as is or to replace the content with your desired content. The selection should persist record to record; effectively, you're pre-selecting the content, a bit like how collections and tags work on the Add Books page.
Either way, it's probably best not to fiddle too much until LT2 is fully rolled out...
Either way, it's probably best not to fiddle too much until LT2 is fully rolled out...
102Keeline
We’ve been waiting a very long time for promised changes. Maybe they will be available soon, “in two weeks,” or not at all.
James
James
103bnielsen
>101 Maddz: "it's probably best not to fiddle too much until LT2 is fully rolled out..."
Yes, stationary targets are better than moving targets.
Yes, stationary targets are better than moving targets.
105cns1000
Caution regarding Tampermonkey: I had it installed in Chrome though had not used it much lately. I am using latest version of Chrome on Windows 7. Yesterday I suddenly began to get errors: STATUS_ACCESS_VIOLATION. Was not able to access ANY web sites in Chrome, though the internet connection was fine and Firefox worked on same computer without problem. Referencing the error, I find posts referencing issues with extensions and specifically Tampermonkey (which was one of only two or three extensions I have installed). I could not access the settings page either in order to disable the extensions. Oddly enough, the ONLY site I could access in Chrome at that point was LT.
Only way out of it was to uninstall Chrome, reboot, and reinstall it from scratch. Seems to be working ok now; the first thing I did was disable Tampermonkey.
Only way out of it was to uninstall Chrome, reboot, and reinstall it from scratch. Seems to be working ok now; the first thing I did was disable Tampermonkey.
106Maddz
What scripts did you have installed? I've only got the LT script and it's not given me any trouble and I've used it today. It may be another script?
107cns1000
I only have three other extensions: DOCs/PDF/Powerpoint viewer (by Google), Mailto:, and Google Docs offline. I don't think any of those would present problems. Anyway, at this point I don't know. There was a freeze (not typical) which required me to do a hard reset just before this happened, so maybe something else had gotten corrupted. All seems ok now but I have not reenabled Tampermonkey. No scripts at all other than the LT Copy script in Tampermonkey
108Keeline
>107 cns1000: Often when someone has TamperMonkey installed, they may install more than one script in it. That was the reason for the inquiry.
I have MacOS X 10.15.7 (Catalina) with Chrome (96.0.4664.110) and TamperMonkey (4.13) and LT Copy Book (2). I just confirmed that it works. I also have some other TamperMonkey scripts installed.
Sometimes permission errors like you mention can be related to other things, including the operating system, its version, and configuration settings.
James
I have MacOS X 10.15.7 (Catalina) with Chrome (96.0.4664.110) and TamperMonkey (4.13) and LT Copy Book (2). I just confirmed that it works. I also have some other TamperMonkey scripts installed.
Sometimes permission errors like you mention can be related to other things, including the operating system, its version, and configuration settings.
James
109Keeline
With a little Google research I see that the STATUS_ACCESS_VIOLATION is a transitory memory-related error where something tried to access a part of memory to which it was not entitled. This can occur when a program has been running for a long time and exceeds its allocated block of memory. Thus, it is probably not specific to TamperMonkey or the LT Copy Book script. The freeze and hard reset solution is consistent with an out-of-memory problem that sometimes occurs on computers.
https://appuals.com/status_access_violation-error/
After a restart, you may not run into it again for a long time.
James
https://appuals.com/status_access_violation-error/
The STATUS_ACCESS_VIOLATION is a random error encountered by the users while browsing the web on Google Chrome. Even some users also reported the error on the most stable version of the Microsoft Edge browser....
After a restart, you may not run into it again for a long time.
James
110cns1000
>109 Keeline:
Thank for doing the research on it. I'm hoping I won't see it again for a long time, because it was very messy. And yes, the computer had been on for a long time (like weeks probably).
Thank for doing the research on it. I'm hoping I won't see it again for a long time, because it was very messy. And yes, the computer had been on for a long time (like weeks probably).
111pnppl
Is this still working for anyone? Edit: I got it working by commenting out a line in the writeData function:
$x1('//td@id="bookedit_tags"//input@value=' + collection + '').checked = true;
I... honestly have no idea why. I don't remember commenting it out while I was trying to fix it. It wasn't an avenue I was pursuing. A coding fugue? I'm not even sure what it does, but it seems to work just fine without it.
Anyway, hope this helps someone. This is on Debian Bookworm with Violentmonkey 2.13.0. I can't get it to work with Greasemonkey, but it does work in both Chromium 98.0.4758.102 and Firefox 91.5.0esr.
Went ahead and put it up on Greasyfork: https://greasyfork.org/en/scripts/440672-lt-copy-book-fixed-2022-02-27-libraryth...
$x1('//td@id="bookedit_tags"//input@value=' + collection + '').checked = true;
I... honestly have no idea why. I don't remember commenting it out while I was trying to fix it. It wasn't an avenue I was pursuing. A coding fugue? I'm not even sure what it does, but it seems to work just fine without it.
Anyway, hope this helps someone. This is on Debian Bookworm with Violentmonkey 2.13.0. I can't get it to work with Greasemonkey, but it does work in both Chromium 98.0.4758.102 and Firefox 91.5.0esr.
Went ahead and put it up on Greasyfork: https://greasyfork.org/en/scripts/440672-lt-copy-book-fixed-2022-02-27-libraryth...
112whbclibrary
I have just tried both the original LT Copy Book script and the 'Fixed' Version on Chrome using the latest Tampermonkey and scripts from greasyfork. Tampermonkey says it's enabled, but I am not seeing any buttons added to LT pages. I went to the library item cited by cns1000 in post #88, clicked on the Add To Library button and it brought me to the pre-filled in manually add page. I had tried restarting Chrome but to now effect. Any ideas?
113bnielsen
I don't get it. Isn't "it brought me to the pre-filled in manually add page" precisely what the script is supposed to do? I.e. copy the details from someone elses catalogued book into the manually add page, so you can either just click Save or fix any differences before saving?
114whbclibrary
Interesting: I did a search on all of LibraryThing for a book (not my library) and found it in other libraries. The Add To Your Books button showed up on the right but when I clicked that button, it only added the title to the Add books search box and no titles were found. Perhaps, these buttons were always there, I can't remember, but they did not function as the script says.
115whbclibrary
To bnielson: I want to make duplicate copies of books from my own library that are in a series and edit them a bit so I don't have to re-enter everything. The location of the buttons in cns1000's book were right on the details page, whereas the book I searched for was off to the side. It seems the script was working in his library, but not mine. I looked at cns1000's book page and the add to library button was also on the right-hand side. When I clicked the right-hand side button, it added the tile to Add Books search box as with the other one, so I think that is a standard button in LibraryThing.
116bnielsen
>115 whbclibrary: Ah, that makes sense. Maybe the script acts differently in your own library. I haven't used it so I'm certainly no expert :-)
117Keeline
I just checked the script from a book in my collection.
First you want to start with the detail page for a work (not the work page).
I notice that holding a command key (Mac) and clicking on the button does open the form in a new tab but it is blank.
However, if I just click on the green "Copy to your library" button, the detail page is replaced with a form that has most fields filled in (as designed).
I am using the version 2.1 (2022-02-27) of the script with TamperMonkey on Chrome.
James
First you want to start with the detail page for a work (not the work page).
I notice that holding a command key (Mac) and clicking on the button does open the form in a new tab but it is blank.
However, if I just click on the green "Copy to your library" button, the detail page is replaced with a form that has most fields filled in (as designed).
I am using the version 2.1 (2022-02-27) of the script with TamperMonkey on Chrome.
James
118sbisson
for anyone else who comes along and is struggling with this script the way I have been, it only works on the book detail page so when you find the book you want to add, you have to click on the number of other members who have it, pick on and find it in their library and open it so you can see *their* book details page. currently working for me in Edge (Microsoft's Chromium browser) and about to save me a LOT of time entering SFF magazines the iOS app couldn't find!
119brightcopy
When @sbisson messaged me to ask about it working on the Works page, I spent a bit of time to make it do so. This can come in handy if you want a super-generic entry. I also fixed a couple of bugs that had either been there all along or cropped up with site updates. Like it not actually picking the correct collection to put it in when you clicked on the My Library vs My Wishlist buttons. I think this was related to @pnppl's issue, as that bit of code was related to the collections.
I uploaded it here: https://pastebin.com/raw/ez58XFXr
It can replace the copies at GreasyFork now. And yes, all my scripts for LT and 100% public domain, and can be marked as such. Share and enjoy.
I uploaded it here: https://pastebin.com/raw/ez58XFXr
It can replace the copies at GreasyFork now. And yes, all my scripts for LT and 100% public domain, and can be marked as such. Share and enjoy.
120pnppl
>119 brightcopy:
Awesome! Thanks for such a useful script! Updated it on Greasyfork.
Awesome! Thanks for such a useful script! Updated it on Greasyfork.
121Maddz
>119 brightcopy: Aw, just finished entering my remaining White Dwarfs last week…. Still, I have digital versions yet to add…
122Keeline
We have acquired a massive collection of more than 5,000 juvenile series books. Some are variants of editions we have. Thus, I have been using LT Copy Book several times recently. I use Chrome on a MacBook Pro so use TamperMonkey (v. 5.3.2) and the script from GreaseMonkey ("fixed" v. 2.2).
This afternoon when I tried to use it, I visited a detail page from my catalog. I don't see the buttons normally added by this script. I have tried shift-reloads and turning the script off/on (and reloading).
It occurs to me that there could be some structural change in the LT detail page. This is the URL I am looking at. If you view it, do you see the buttons as usual when the script is installed and active?
https://www.librarything.com/work/10696308/details/274921566
I am hoping that it is a temporary issue OR that it can be resolved with an update to the script.
It was only a couple days ago when I used it last. It is a time saver for me and I have a lot of work to do before Thanksgiving as I integrate the two collections.
James
This afternoon when I tried to use it, I visited a detail page from my catalog. I don't see the buttons normally added by this script. I have tried shift-reloads and turning the script off/on (and reloading).
It occurs to me that there could be some structural change in the LT detail page. This is the URL I am looking at. If you view it, do you see the buttons as usual when the script is installed and active?
https://www.librarything.com/work/10696308/details/274921566
I am hoping that it is a temporary issue OR that it can be resolved with an update to the script.
It was only a couple days ago when I used it last. It is a time saver for me and I have a lot of work to do before Thanksgiving as I integrate the two collections.
James
123Maddz
>122 Keeline: I'm seeing the buttons in The Green Man's Gift from my catalogue, as well as the book you link to above.
124Keeline
>123 Maddz:, OK. So it is just me. Interesting but harder to resolve perhaps. I don't know what would have changed in the past few days.
I did recently restart the computer which would have restarted Chrome. I currently have Chrome 130.0.6723.117.
James
I did recently restart the computer which would have restarted Chrome. I currently have Chrome 130.0.6723.117.
James
125Keeline
I have some progress.
TamperMonkey wanted to have Developer Mode active. On the Mac version of Chrome this was under Window >> Extensions with a toggle on the upper right.
It still wasn't working so I removed both versions of the script (one was active) and installed fresh from GreasyFork.org.
After doing this, I reloaded the detail pages and saw the buttons again. It does seem to work. The Manual Entry form is opened with the expected data.
James
TamperMonkey wanted to have Developer Mode active. On the Mac version of Chrome this was under Window >> Extensions with a toggle on the upper right.
It still wasn't working so I removed both versions of the script (one was active) and installed fresh from GreasyFork.org.
After doing this, I reloaded the detail pages and saw the buttons again. It does seem to work. The Manual Entry form is opened with the expected data.
James
126OregonGS.org
Hi
New user to librarything and greasemonkey. I'm unable to get the Copy Book to copy.
Mac OS ver: 15.0.1 (Sequoia)
Firefox ver: 132.0.2
GreaseMonkey ver: 4.13
Copy Book ver: 2
Added & enabled GreaseMonkey
restarted Firefox
Added Copy Book
restarted Firefox
Located page that has "Copy to your library" / "Copy to your wishlist"
Clicking on "Copy to your library" loads a BLANK manual add book page ( https://www.librarything.com/addnew.php ). As in no title, author etc.
Any suggestions for additional troubleshooting steps?
Thanks
J Sadler
EDIT: Added actual problem.
New user to librarything and greasemonkey. I'm unable to get the Copy Book to copy.
Mac OS ver: 15.0.1 (Sequoia)
Firefox ver: 132.0.2
GreaseMonkey ver: 4.13
Copy Book ver: 2
Added & enabled GreaseMonkey
restarted Firefox
Added Copy Book
restarted Firefox
Located page that has "Copy to your library" / "Copy to your wishlist"
Clicking on "Copy to your library" loads a BLANK manual add book page ( https://www.librarything.com/addnew.php ). As in no title, author etc.
Any suggestions for additional troubleshooting steps?
Thanks
J Sadler
EDIT: Added actual problem.
127Maddz
>126 OregonGS.org: No, that's correct. The manual entry form should have the Title, Author and ISBN of the entry you are copying. It's very important to check the ISBN as I find if the entry doesn't have an ISBN you get a placeholder not a blank.
Don't edit author or title, but check the collection is correct for your library, add tags and media and any other information. Save the form, and you should have a new title in your library that is combined with the existing entry.
Go into your newly entered book, and now you can edit title and author, and change the cover to match your book. As ever, take the time to check things like the publication details. If the book is on the obscure side, it's worth doing a site search to hoover up any uncombined versions before you add your new book (but be careful with comic book individual issues and comic book collections).
Don't edit author or title, but check the collection is correct for your library, add tags and media and any other information. Save the form, and you should have a new title in your library that is combined with the existing entry.
Go into your newly entered book, and now you can edit title and author, and change the cover to match your book. As ever, take the time to check things like the publication details. If the book is on the obscure side, it's worth doing a site search to hoover up any uncombined versions before you add your new book (but be careful with comic book individual issues and comic book collections).
128OregonGS.org
>127 Maddz: Thanks for the response. Sorry I forgot to add one word: blank
that the all of the entries for the add page are blank, no title not author no call numbers or ISBN etc.
Thanks
that the all of the entries for the add page are blank, no title not author no call numbers or ISBN etc.
Thanks
129Keeline
>128 OregonGS.org:, from the description, it sounds like it is not working as it should. This image shows what you should expect:

You are correct. When it is used, a blank manual entry form is opened but it should be populated with some entries. Author and title are among them.
Recently I had issues with "LT Copy Book" on TamperMonkey on Chrome on Mac. There was an issue with checking a developer mode to allow for an external user script. It is possible that something similar is occurring on Firefox with GreaseMonkey.
On Chrome the Extensions page has a toggle switch for Developer Mode.
Is there something similar in Firefox that might be relevant? Or, are you willing to try doing it in Chrome + TamperMonkey?
James

You are correct. When it is used, a blank manual entry form is opened but it should be populated with some entries. Author and title are among them.
Recently I had issues with "LT Copy Book" on TamperMonkey on Chrome on Mac. There was an issue with checking a developer mode to allow for an external user script. It is possible that something similar is occurring on Firefox with GreaseMonkey.
On Chrome the Extensions page has a toggle switch for Developer Mode.
Is there something similar in Firefox that might be relevant? Or, are you willing to try doing it in Chrome + TamperMonkey?
James
130OregonGS.org
>129 Keeline: In Firefox I think the equivalent is Tools -> Browser Tools -> Web Developer Tools. But it's not a "mode"(?). But it does bring up a suite of dev tools.
(I tried to upload screenshots, but I only ended up with an image in the "Junk drawer" that was a single pixel and clicking on that single pixel link led to a 502 Error from Cloudfront
( https://pics.cdn.librarything.com//picsizes/c2/73/c273b11bdec7645654d6c503951436... ))
Looking at the Warnings/Errors/Logs info I see this:
ReferenceError: GM_setValue is not definedsandbox eval code:132:3
addToClick user-script:http://userscripts.org/users/brightcopy/LT Copy Book - LibraryThing:132
addToLibraryClick user-script:http://userscripts.org/users/brightcopy/LT Copy Book - LibraryThing:117
This page is in Almost Standards Mode. Page layout may be impacted. For Standards Mode use “”. addnew.php
This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”. addnew.php
Cookie warnings 24
------loading translated vars via basics1------ basics1.js:35:12
ReferenceError: GM_getValue is not defined LT Copy Book - LibraryThing:347:11
writeData user-script:http://userscripts.org/users/brightcopy/LT Copy Book - LibraryThing:245
userScript user-script:http://userscripts.org/users/brightcopy/LT Copy Book - LibraryThing:345
scopeWrapper user-script:http://userscripts.org/users/brightcopy/LT Copy Book - LibraryThing:368
user-script:http://userscripts.org/users/brightcopy/LT Copy Book - LibraryThing:369
basics1.js: prettify_content_lt1( page ready ) mmlog.js:115:13
Initializing date pickers on the page 2 mmlog.js:94:19
Source map error: Error: URL constructor: is not a valid URL.
Resource URL: user-script:http%3A//userscripts.org/users/brightcopy/LT%20Copy%20Book%20-%20LibraryThing
Source Map URL: null
basics1.js: prettify_content_lt1( ajax loaded - /js2/translated_vars.js.php?_=1732391936295 ) mmlog.js:115:13
I'll try installing Chrome, but may not get to it till Monday.
Thanks for your help.
131OregonGS.org
I installed Chrome added the extensions, userscript & mode change. It works with Chrome, so it appears to be a Firefox issue. Looks I'll keep Chrome for use when I need to copy books.
I'll need to discuss with the bosses about having volunteers (in their 60's & 70's) adding the Chrome changes to their personal laptops. But having the Firefox users switch is likely a nogo.
Did the Warnings/Error log from Firefox give any help?
Thanks
J Sadler
I'll need to discuss with the bosses about having volunteers (in their 60's & 70's) adding the Chrome changes to their personal laptops. But having the Firefox users switch is likely a nogo.
Did the Warnings/Error log from Firefox give any help?
Thanks
J Sadler
132Maddz
Unfortunately, I think it's been a while since anyone looked at the script. I can't help you - I wouldn't know the first place to start. My other half has cast his eye over the error log and he thinks the Resource URL: user-script:http%3A//userscripts.org/users/brightcopy/LT%20Copy%20Book%20-%20LibraryThing line may be what's causing the script to fail - %20 is the correct encoding for a space, but he's not sure about %3A being the correct encoding for a colon - he says it looks odd. Googling it does say it's the correct encoding, though.
User brightcopy was the person to create the script - see posts >119 brightcopy: & >120 pnppl:. Have you got the v2.2 'fixed' script from GreasyFork as per >122 Keeline:?
User brightcopy was the person to create the script - see posts >119 brightcopy: & >120 pnppl:. Have you got the v2.2 'fixed' script from GreasyFork as per >122 Keeline:?
133Keeline
>131 OregonGS.org:, there are probably a small number of LT members who use this script. Fewer still will notice the new comments on this thread.
Although I understand several programming languages, I have not gained a full understanding of how this one works. It is probably straightforward when the context is understaood because it is not especially long.
The Firefox complaints about a sandbox may inticate that the equivalent of developer mode needs to be active for it to function as I already suggested.
There also seems to be a complaint that a variable is being used which has not been defined. This seems strange since I suppose you are using the same code that works on Chrome.
I know that the Chrome version complains about the excess spaces put there to improve human readability. There is a line one can add to suppress this warning. I tried it but that was not the nature of my problem. So I'd have to find it again with the error message and see if I can get it to work. Fewer warnings/errors makes it easier to see real problems and not just complaints about its ideal source code.
James
Although I understand several programming languages, I have not gained a full understanding of how this one works. It is probably straightforward when the context is understaood because it is not especially long.
The Firefox complaints about a sandbox may inticate that the equivalent of developer mode needs to be active for it to function as I already suggested.
There also seems to be a complaint that a variable is being used which has not been defined. This seems strange since I suppose you are using the same code that works on Chrome.
I know that the Chrome version complains about the excess spaces put there to improve human readability. There is a line one can add to suppress this warning. I tried it but that was not the nature of my problem. So I'd have to find it again with the error message and see if I can get it to work. Fewer warnings/errors makes it easier to see real problems and not just complaints about its ideal source code.
James
135Keeline
>134 Maddz:, LT certainly uses https and so does userscripts.org. The error messages refer to the latter.
When the script is installed, it uses regular expression wildcards for the URL matching which can handle http or https URLs.
So I think this is OK.
James
When the script is installed, it uses regular expression wildcards for the URL matching which can handle http or https URLs.
So I think this is OK.
James
136OregonGS.org
>132 Maddz: >133 Keeline:
I think, considering the age of the script and that there doesn't appear to be a fix that a neophyte like myself can overcome, I'll call it good and use Chrome. Until we get to periodicals I don't think it'll be an overwhelming issue.
re: http vs https, since it works on Chrome I don't think it's an issue.
Thank you both for responding!
J Sadler
I think, considering the age of the script and that there doesn't appear to be a fix that a neophyte like myself can overcome, I'll call it good and use Chrome. Until we get to periodicals I don't think it'll be an overwhelming issue.
re: http vs https, since it works on Chrome I don't think it's an issue.
Thank you both for responding!
J Sadler
137Maddz
>136 OregonGS.org: Reading through the entire thread, it seems that using Firefox means that the script is more likely to break. Chrome seems less affected for some reason.
138brightcopy
Have you tried using Tampermonkey for Firefox instead of Greasemonkey? I just did and it worked fine still.
I also tried it in Greasemonkey, and found that apparently GM has changed the name of several function calls, thus making scripts written for old GM and Tampermonkey, et al. no longer work. (insert eyeroll here)
But as I said, it works great with Tampermonkey. On a freshly installed Firefox, so I didn't even have to futz with any settings.
Also, I edited the first post to have a link to Keeline's script instead of the defunct userscripts link. Don't know why I didn't do that before.
While I'm not really active on LT on a day-to-day basis, I usually can get around to checking any issues with the scripts. You can always feel free to drop me an LT mail, which will ping my email and make me check it sooner. I find that most scripts can be fixed pretty easily.
I also tried it in Greasemonkey, and found that apparently GM has changed the name of several function calls, thus making scripts written for old GM and Tampermonkey, et al. no longer work. (insert eyeroll here)
But as I said, it works great with Tampermonkey. On a freshly installed Firefox, so I didn't even have to futz with any settings.
Also, I edited the first post to have a link to Keeline's script instead of the defunct userscripts link. Don't know why I didn't do that before.
While I'm not really active on LT on a day-to-day basis, I usually can get around to checking any issues with the scripts. You can always feel free to drop me an LT mail, which will ping my email and make me check it sooner. I find that most scripts can be fixed pretty easily.
139Keeline
>138 brightcopy:, we are glad to see you here, even occasionally.
I would like to better understand this script. For example, if I was copying my own records, perhaps I would want to copy the Comments field so I might modify my copy of the script.
I have familiarity with PHP and have done some Javascript work but it is not a primary language for me.
James
I would like to better understand this script. For example, if I was copying my own records, perhaps I would want to copy the Comments field so I might modify my copy of the script.
I have familiarity with PHP and have done some Javascript work but it is not a primary language for me.
James
140Maddz
>138 brightcopy:, >139 Keeline: There's some things that could be tweaked in the script. For example, if you're cloning a work in your library (not from a different library), it would be useful to copy the tags field and media type, as well as any selected collections (although I seem to recall you said there were technical reasons why the latter couldn't be done).
One thing I have noticed recently is if the work being cloned hasn't got an ISBN, the script is adding a placeholder for some reason. It would be useful to stop that as it prevents auto-combination.
One thing I have noticed recently is if the work being cloned hasn't got an ISBN, the script is adding a placeholder for some reason. It would be useful to stop that as it prevents auto-combination.
141Keeline
>140 Maddz:, most of the books I have copied with the script in the past month have been (a) from my collection and (b) did not have ISBNs. They were older books (1890-1935).
I did not encounter any combination problems.
I have also seen collections selected which are either from the original catalog entry or the last ones that I was used.
But on the topic, my books that I am presently working with are nearly all hardcover and I would like to set this as a media default.
It is a remarkably useful script and my work would take much longer if I didn't have it.
I am merging a larger 5,000+ book collection to my own. Initially I am working with authors and series that we both collected. There are lots of upgrades but also additions of variant editions.
Library of Congress is seldom available as a data source these days. OverCat doesn't always work. I wish LT would let us pick a cascade list of data sources (perhaps 3-5). But that is not in scope for this script as all. But it emphasizes why copying the entries is more important than having to hit 3-5 data sources with LoC failing most of the time, etc.
James
I did not encounter any combination problems.
I have also seen collections selected which are either from the original catalog entry or the last ones that I was used.
But on the topic, my books that I am presently working with are nearly all hardcover and I would like to set this as a media default.
It is a remarkably useful script and my work would take much longer if I didn't have it.
I am merging a larger 5,000+ book collection to my own. Initially I am working with authors and series that we both collected. There are lots of upgrades but also additions of variant editions.
Library of Congress is seldom available as a data source these days. OverCat doesn't always work. I wish LT would let us pick a cascade list of data sources (perhaps 3-5). But that is not in scope for this script as all. But it emphasizes why copying the entries is more important than having to hit 3-5 data sources with LoC failing most of the time, etc.
James
142Maddz
>1 brightcopy:, >141 Keeline:,
We're going to need an updated script once the LT2 work pages settle down.
I no longer see the buttons ;), although most of my really obscure stuff and the comics collection is catalogued (I buy the occasional graphic novel these days rather than single issue floppies). There may be some uncatalogued works in the attic I want to keep, but generally they are print versions of ebooks I own.
The script tends to get used when I'm cataloguing Kickstarter rewards some time after the fact.
We're going to need an updated script once the LT2 work pages settle down.
I no longer see the buttons ;), although most of my really obscure stuff and the comics collection is catalogued (I buy the occasional graphic novel these days rather than single issue floppies). There may be some uncatalogued works in the attic I want to keep, but generally they are print versions of ebooks I own.
The script tends to get used when I'm cataloguing Kickstarter rewards some time after the fact.
143Keeline
I wonder if this update is also causing images to fail to load or load VERY slowly. I was trying to view 18 books from a series to show the covers and do a screen grab. I do this all the time and it normally takes less than a minute. I have reloaded the page about 10 times and many of the images are still not there.
I looked at the edit book page and the book details page and I see what you mean about the buttons disappearing. I hope we can get it going once things settle down again.
James
I looked at the edit book page and the book details page and I see what you mean about the buttons disappearing. I hope we can get it going once things settle down again.
James
144keristars
>143 Keeline:
Yes, the image servers are having to cache new image sizes when the pages are accessed. Refreshing will unfortunately make it take longer by adding to the load queue, rather than aborting and restarting.
also this from Tim! https://www.librarything.com/topic/368208
Yes, the image servers are having to cache new image sizes when the pages are accessed. Refreshing will unfortunately make it take longer by adding to the load queue, rather than aborting and restarting.
also this from Tim! https://www.librarything.com/topic/368208
145Maddz
>143 Keeline: I added some recent purchases the other day and trying to change the cover was an exercise in frustration; a bit like the last major pics outage. Fortunately, they were all ebooks so I was able to upload covers from Calibre.
It would be good to get the script working again; maybe more book data points could added in.
It would be good to get the script working again; maybe more book data points could added in.
146Keeline
>144 keristars: , the banner mentioned between midnight and noon today was not present when I was trying to get the cover collage.
As I posted in that thread, some aspects are still slow compared to recent memory so some more work will have to be done.
For this topic, it means that we may have to wait a week or two before things are settled down.
James
As I posted in that thread, some aspects are still slow compared to recent memory so some more work will have to be done.
For this topic, it means that we may have to wait a week or two before things are settled down.
James
147Keeline
I think that the book detail and blank form entry pages are stabilized. So I took a run at updating the LT Copy Book and it seems to work. I have it copying more fields than before, including Comments and Private Comments (if you are looking at one of your own records to duplicate) and tags. These can be turned off if you don't want to copy some of them.
There may be some fields that have not copied over. I have not tried to make an every field filled record to make sure that it is thorough. The code is commented and I have a document of how it was done for those who want to try this in the future.
It will probably work until LT changes something in the DOM or structure of the pages. Then it will have to be updated like any screen scraping enterprise. But I'm happy to have the feature back since it was essential for me from time to time.
Before posting to a repository like GreasyFork, I'd like it to be tested by some. Let me know if there is interest.
James
There may be some fields that have not copied over. I have not tried to make an every field filled record to make sure that it is thorough. The code is commented and I have a document of how it was done for those who want to try this in the future.
It will probably work until LT changes something in the DOM or structure of the pages. Then it will have to be updated like any screen scraping enterprise. But I'm happy to have the feature back since it was essential for me from time to time.
Before posting to a repository like GreasyFork, I'd like it to be tested by some. Let me know if there is interest.
James
149Keeline
>148 Maddz: @Maddz, see if you can get this to work. You will probably want to copy-paste the script into TamperMonkey. I suggest visiting an LT book detail page and then on the TamperMonkey menu start to make a new script and paste this code. Disable the previous version in the manager.
https://Keeline.com/pics/LT-copy-book-3.0.js
It is about 32 kB in size.
If anyone else tries this, collect specific feedback on any shortcomings.
Here is the documentation:
https://Keeline.com/pics/LT-Copy-Book-3.0.pdf
This is 274 kB in size.
James
https://Keeline.com/pics/LT-copy-book-3.0.js
It is about 32 kB in size.
If anyone else tries this, collect specific feedback on any shortcomings.
Here is the documentation:
https://Keeline.com/pics/LT-Copy-Book-3.0.pdf
This is 274 kB in size.
James
150Maddz
>149 Keeline: Error: GM_setValue is not defined when I click Copy to My Books
151Keeline
>150 Maddz: , that error can occur if you are not using the TamperMonkey plugin.
Please tell me more about your:
1. Operating system and version
2. Browser and version — Expecting Chrome, I have 138.0.7204.101.
3. Plugin and version — Expecting TamperMonkey, I have 5.33.
Be sure the old version is turned off in the manager.
It is possible to use local storage but the code will have to be modified. If I know more about the above, I can perhaps work something out.
It does work for me. I just tried again with the copy I provided.
Make sure the header looks like this:
James
Please tell me more about your:
1. Operating system and version
2. Browser and version — Expecting Chrome, I have 138.0.7204.101.
3. Plugin and version — Expecting TamperMonkey, I have 5.33.
Be sure the old version is turned off in the manager.
It is possible to use local storage but the code will have to be modified. If I know more about the above, I can perhaps work something out.
It does work for me. I just tried again with the copy I provided.
Make sure the header looks like this:
// ==UserScript==
// @name LT Copy Book v3.0 - LibraryThing LT2.0 Compatible
// @namespace http://userscripts.org/users/brightcopy
// @description Copies book data and automatically pastes it to a manual entry. Updated for LT2.0.
// @include http*://*.librarything.com/work*/details/*
// @include http*://*.librarything.com/addnew.php
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_deleteValue
// @version 3.0
// ==/UserScript==
James
152Maddz
That works! I think when I initially copied the script I mucked up the headers.
What I'd love it to do is when you clone a work from your collections, that it selects the collection the original work is in, but I suppose it would be too complicated to do. Maybe if there was a third button to select the collection? I use neither Your Library nor Wishlist (that's over on Kobo).
Oh, and while I remember
Mac OS Sequoia 15.3.1
Latest Chrome 138.0.7204.158 (Official Build) (arm64)
What I'd love it to do is when you clone a work from your collections, that it selects the collection the original work is in, but I suppose it would be too complicated to do. Maybe if there was a third button to select the collection? I use neither Your Library nor Wishlist (that's over on Kobo).
Oh, and while I remember
Mac OS Sequoia 15.3.1
Latest Chrome 138.0.7204.158 (Official Build) (arm64)
153Keeline
>152 Maddz:, The collections is a different sort of input so probably that is not possible. But this should reduce the work greatly.
James
James
154kleh
Will it now include additional authors?
That's what I really missed from the previous incarnation.
That's what I really missed from the previous incarnation.
155Keeline
I worked on LT Copy Book 3.1 today and this is where it stands:
For @Maddz, Collections are only relevant when trying to copy one's own books. Other members will have different collection names and philosophies. The complex means of selecting a collection is not easily automated. I tried several methods without success. The collections used in the form are the ones set as defaults on https://www.librarything.com/addbooks
For @kleh, the Other Authors are now included. But for the primary and other authors, if a custom role is selected, it is not copied over. Only the standard roles can be copied. Attempts to do so brought up the "name the custom role for this person" dialog and I could not work out a way to get input into it. Since custom roles are tedious to use every book input (e.g. Other... => "Pseud.", it is likely that few people use them. So this will cover most use cases.
There are some fields that are unique to a member's copy. This includes reviews, ratings, reading and acquired dates, etc. We could detect whether the user is looking at their own book and copy conditionally. But at the moment unless there is a big demand for it, I don't want to do so. If someone does and wishes to modify the code, share it and maybe it will be the version I use.
Naturally this began with the code developed by @Brightcopy though it is rather different in the current 3.1 form. I have saved both the Javascript code and a PDF of the documentation (updated). When it is tested, I can see about putting it on GreasyFork for traditional storage and ease of adding the User Script to TamperMonkey (tested on Chrome on Mac) rather than the copy-paste method needed now.
https://Keeline.com/pics/LT-Copy-Book-3.1.js md5: 9e6489c8be53c0655f367f0a23589d85
https://Keeline.com/pics/LT-Copy-Book-3.1.pdf md5: 4829e96466d91773bb5d60edd9b0f240
I hope this works for you and is useful. It has worked in my testing but that is always somewhat limited. I did make an entry for a book that had all of the fields populated as a test bed:
https://www.librarything.com/work/2217888/details/290772104
The ISBN selected (97801234567890) led to the cover chosen.
James
For @Maddz, Collections are only relevant when trying to copy one's own books. Other members will have different collection names and philosophies. The complex means of selecting a collection is not easily automated. I tried several methods without success. The collections used in the form are the ones set as defaults on https://www.librarything.com/addbooks
For @kleh, the Other Authors are now included. But for the primary and other authors, if a custom role is selected, it is not copied over. Only the standard roles can be copied. Attempts to do so brought up the "name the custom role for this person" dialog and I could not work out a way to get input into it. Since custom roles are tedious to use every book input (e.g. Other... => "Pseud.", it is likely that few people use them. So this will cover most use cases.
There are some fields that are unique to a member's copy. This includes reviews, ratings, reading and acquired dates, etc. We could detect whether the user is looking at their own book and copy conditionally. But at the moment unless there is a big demand for it, I don't want to do so. If someone does and wishes to modify the code, share it and maybe it will be the version I use.
Naturally this began with the code developed by @Brightcopy though it is rather different in the current 3.1 form. I have saved both the Javascript code and a PDF of the documentation (updated). When it is tested, I can see about putting it on GreasyFork for traditional storage and ease of adding the User Script to TamperMonkey (tested on Chrome on Mac) rather than the copy-paste method needed now.
https://Keeline.com/pics/LT-Copy-Book-3.1.js md5: 9e6489c8be53c0655f367f0a23589d85
https://Keeline.com/pics/LT-Copy-Book-3.1.pdf md5: 4829e96466d91773bb5d60edd9b0f240
I hope this works for you and is useful. It has worked in my testing but that is always somewhat limited. I did make an entry for a book that had all of the fields populated as a test bed:
https://www.librarything.com/work/2217888/details/290772104
The ISBN selected (97801234567890) led to the cover chosen.
James
156Maddz
>155 Keeline: Thought the ability to use the selected collection(s) from an entry already in your library was going to be too difficult. Still, if you don't ask, you don't get. Thanks anyway; I expect to be picking up some more duplicate works at the convention next weekend.
157Keeline
>156 Maddz:, set up the default target Collections before making copies and it should work as desired.
James
James
159Keeline
>158 Felagund:, when another member of this thread had that error, it was related to the header information at the top of the script.
It also has to be used inside the TamperMonkey framework which provides the GM (GreaseMonkey) data storage.
Try again as it can be made to work if everything is set up correctly.
As with the other person, knowing ALL of the details is important for a diagnosis:
* Computer operating system and version
* Browser name and version
* TamperMonkey plugin version
I have tested on Chrome on Mac. But it should work in other configurations.
If this all fails, I can see about using the local storage from the browser and maybe this will work.
James
It also has to be used inside the TamperMonkey framework which provides the GM (GreaseMonkey) data storage.
Try again as it can be made to work if everything is set up correctly.
As with the other person, knowing ALL of the details is important for a diagnosis:
* Computer operating system and version
* Browser name and version
* TamperMonkey plugin version
I have tested on Chrome on Mac. But it should work in other configurations.
If this all fails, I can see about using the local storage from the browser and maybe this will work.
James
160Felagund
I see, I was trying to use the script in Greasmonkey, which now has a slightly different API. Simply replacing the GM_* function calls with their GM.* equivalents isn't enough apparently... maybe I'll try to adapt the script, or I'll use Chrome/Tampermonkey just for this purpose. Anyway, thanks for everybody's time!
161Keeline
>160 Felagund: , do let me know if it works with TamperMonkey on your setup.
If there are bugs remove, I'd like to do so before sharing it more generally on GreasyFork.
James
If there are bugs remove, I'd like to do so before sharing it more generally on GreasyFork.
James
162Felagund
It seems to work properly using Tampermonkey 5.3.3 on Firefox 140, Mac OS 15.5.
FYI, in my quick Greasemonkey test the GM_* -> GM.* subtitution gets rid of the error I observed initially but it leads to a buggy behavior where all free-text LT fields contain the value object Promise. Just an observation in case someone is interested :-)
FYI, in my quick Greasemonkey test the GM_* -> GM.* subtitution gets rid of the error I observed initially but it leads to a buggy behavior where all free-text LT fields contain the value object Promise. Just an observation in case someone is interested :-)
163Keeline
>162 Felagund:, that's a good observation. If we wanted this to be compatible with GreaseMonkey and TamperMonkey, it might be necessary to use local storage. At least it would be worth trying.
But lately the script has been set up for TamperMonkey so I was not trying to make it work with the differences of GreaseMonkey.
For the moment we'll call it a requirement that TamperMonkey be used for compatibility with this code.
James
But lately the script has been set up for TamperMonkey so I was not trying to make it work with the differences of GreaseMonkey.
For the moment we'll call it a requirement that TamperMonkey be used for compatibility with this code.
James
166AHHSWG
Hi,
the script doesn't work for me (tampermonkey, firefox , macos, chrome doesn't work either) . When I click on the link at the top of thread I'm taken to a script that was last updated in 2016. Am I clicking on the wrong thing?
EDIT: I found the code further down this thread and copied it into TM, and it works! yay! and thanks!
the script doesn't work for me (tampermonkey, firefox , macos, chrome doesn't work either) . When I click on the link at the top of thread I'm taken to a script that was last updated in 2016. Am I clicking on the wrong thing?
EDIT: I found the code further down this thread and copied it into TM, and it works! yay! and thanks!
167quaeker.org
>149 Keeline: This worked for me today. Thank you Keeline and James and everyone else who took part in this - this will help me immensely. Looking forward to a lot of "cloning" over the holidays ... (a library with two venues, lots of duplicates, and lots of grey literature that cant be easily imported via ISBN etc.)
A very grateful volunteer librarian
A very grateful volunteer librarian
168Keeline
I am pleased that this is working out. But if there are issues, I can take another run at improving the code.
Sometimes if we can't get a feature we want from a site, this kind of technique can work. It fills a need until (and if) the site developers can make something.
But as the site evolves, the user script will need to be adjusted to work with the new DOM (document object model) structure.
James
Sometimes if we can't get a feature we want from a site, this kind of technique can work. It fills a need until (and if) the site developers can make something.
But as the site evolves, the user script will need to be adjusted to work with the new DOM (document object model) structure.
James
169cns1000
It is amazing to see that this is still being maintained ! Thank you to the good souls who have been doing this !
This plugin has been very helpful to me in the past, in terms of copying of journal issues and magazine issues. Indispensable in fact. But I haven't been back to LT for a while and now I am having trouble getting this to work. If I go to greasyfork, the version I find of LT Book Copy is 2.2:
LT Copy Book (fixed) - LibraryThingv2.2
Author
Description Copies book data and automatically pastes it to a manual entry.
Source https://update.greasyfork.org/scripts/440672/LT%20Copy%20Book%20%28fixed%29%20-%20LibraryThing.user.js
Where do I get the newer version 3.0 ? Sorry if I missed this. I am using Windows 11 Pro, Chrome 145.0 (the most recent), and Tampemonkey 5.4.1 in Developer Mode. I am not seeing the expected buttons. Is there anything else I am missing ?
Thanks for any help !
This plugin has been very helpful to me in the past, in terms of copying of journal issues and magazine issues. Indispensable in fact. But I haven't been back to LT for a while and now I am having trouble getting this to work. If I go to greasyfork, the version I find of LT Book Copy is 2.2:
LT Copy Book (fixed) - LibraryThingv2.2
Author
Description Copies book data and automatically pastes it to a manual entry.
Source https://update.greasyfork.org/scripts/440672/LT%20Copy%20Book%20%28fixed%29%20-%20LibraryThing.user.js
Where do I get the newer version 3.0 ? Sorry if I missed this. I am using Windows 11 Pro, Chrome 145.0 (the most recent), and Tampemonkey 5.4.1 in Developer Mode. I am not seeing the expected buttons. Is there anything else I am missing ?
Thanks for any help !
170cns1000
Followup: I have found and installed the 3.1 version with the configuration above and developer mode enabled. The script shows in dashboard as installed. Still no buttons, however. Would appreciate any help !
Additional followup: The buttons do show up in Firefox (147.0.4). Haven't tested yet but will post a followup if I find issues.
Charles
Additional followup: Works great in Firefox ! Two small requests for additional fields to be copied over: (1) Media (2) Other call number system (Since I am using this copy function mostly for journals / periodicals, I use this field for the ISSN).
Additional followup: The buttons do show up in Firefox (147.0.4). Haven't tested yet but will post a followup if I find issues.
Charles
Additional followup: Works great in Firefox ! Two small requests for additional fields to be copied over: (1) Media (2) Other call number system (Since I am using this copy function mostly for journals / periodicals, I use this field for the ISSN).
171Keeline
>170 cns1000: , LT developers have been making changes to book detail pages so we will have to wait until they are stable. I also don’t have access to one of my dev tools.
The first step will be to test on my computer where it hasworked before and see if the code works still.
I believe I am the third person to work on this.
James
The first step will be to test on my computer where it hasworked before and see if the code works still.
I believe I am the third person to work on this.
James
172cns1000
>171 Keeline: Thanks for the update, and for the work you are putting into this !
173cns1000
Update: I have gone back and am trying to use this now in Firefox once again, latest version. I do get the Copy buttons showing up but in the manual entry that comes up, nothing at all is now populated other than the Title and Author fields. James: Is this the result of some changes to those pages ? Have you had time to look into this lately ? Let me know
Thanks for your help !
Thanks for your help !
174Keeline
>173 cns1000:, I have not had time to look at this. I have been transitioning to a new computer day job.
But I would say it is very likely that the DOM of the detail pages changed which broke the User Script. Since I also use this myself, I will work to get it functional again. I can't say when I will be able to do so.
James
But I would say it is very likely that the DOM of the detail pages changed which broke the User Script. Since I also use this myself, I will work to get it functional again. I can't say when I will be able to do so.
James
175cns1000
>174 Keeline: Thanks ! Understandably you have other commitments. Post on here when you have been able to look at it and I will test out any changes.
176Keeline
>175 cns1000: , I lost one computer job of 6.5 years (Senior Infrastructure Architect) and had to find and start another one (Senior Site Reliability Engineer). But things will settle down.
James
James
177Maddz
>176 Keeline: Luckily I'm semi-retired so loosing my current job won't make much difference apart from more time to read and work on my catalogue (and manage the house and garden). I went through that nearly 10 years ago when I was made redundant from a job I'd held for 13 years because I didn't care to be downgraded with no means of restoring my position (blasted HR consultants), did a period as a consultant before taking a new permanent job - where I'm now 4 pay scales higher. This will be my last permanent job; it suits the council to keep me on as I have an old skill set which won't be needed in a few years and to get a new person is prohibitive in terms of London salaries.
178cns1000
>176 Keeline: Lost my most recent computer systems job 22 years ago but have managed to survive since then and am definitely not looking for another one

