Desktop app doesn't use online username when exporting URI
When I use "Export Item..." to export a URI, the format of the URI is (for example):
http://zotero.org/users/9677/items/HW6XKIU7
When I click on this link, however, I get a "Page Not Found" error. To get it to work I have to manually edit the link to change "users/9677" to "docja" (my online username). Is there a way to have this happen automatically when the URI is exported?
Thanks!
ja
http://zotero.org/users/9677/items/HW6XKIU7
When I click on this link, however, I get a "Page Not Found" error. To get it to work I have to manually edit the link to change "users/9677" to "docja" (my online username). Is there a way to have this happen automatically when the URI is exported?
Thanks!
ja
What format are you exporting the item to? It'd certainly be possible to customize an export script that just did the search & replace for you.
Yes, they used to work for me, too, but not now. I'm exporting it as "Item URI" to an HTML file called "Exported Items.html", which I open with Notepad++. In NPP the URI is an HTML link. When I copy and paste that into my notes in OneNote it pastes as a link. I don't want to take the time to make a script file to do the change, so I just edit the link in OneNote and it then works. But it seems like this is something that ought to be made to still work. Or is there another way to directly get a link to the online file in the desktop app? I haven't found one yet.
Bu it literally just takes adding
.replace("/users/9677", "/docja/items")
to the relevant line in the export translator for Item URI to get a working link..
{
"translatorID":"064ef4ee-61b8-4bb4-ba16-5501d09aed0c",
"translatorType":2,
"label":"Item URI",
"creator":"Sebastian Karcher",
"target":"html",
"minVersion":"2.0",
"maxVersion":"",
"priority":200,
"inRepository":false,
"lastUpdated":"2012-07-17 22:27:00"
}
function doExport() {
var item;
while(item = Zotero.nextItem()) {Zotero.write(item.uri + "\n");}
}
Which line is the relevant one? And won't my modification be lost when Zotero updates?
@dstillman, I and I'm sure others will be glad to see that "coming soon" functionality.
Thanks again to both of you.
while(item = Zotero.nextItem()) {Zotero.write(item.uri.replace("/users/9677", "/docja/items") + "\n");}
Zotero's built-in translators would potentially be overwritten on update, but a custom translator won't auto-update and would only disappear when you use reset translators in the Zotero preferences (and that would also apply to the current Item URI translator).
edit: I've added /items to the replacement because I don't get that as part of the item URI, but if you are, then simply change the replacing string to just "/docja"