Re: [Bibdesk-users] *****SPAM***** Re: URLs in formatted citations, deprecated fields, and such
Hmm. This helps. I will try it post-haste, but there does not seem to be an automatic generation of the linked file on my hard drive when I drop the PDF onto the sidebar. Best, -Nathan -- Nathan A. Paxton Ph.D. Candidate Dept. of Government, Harvard University Resident Tutor John Winthrop House, Harvard University napaxton AT fas DOT harvard DOT edu http://www.fas.harvard.edu/~napaxton = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = When you have to stay eight years away from California, you live in a perpetual state of homesickness. - Ronald Reagan The most courageous act is still to think for yourself. Aloud. -Coco Chanel = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = On 4 Dec 2008, at 7:41 PM, Christiaan Hofman wrote: On 5 Dec 2008, at 1:28 AM, Nathan Paxton wrote: Alex (et al.), That was exactly what I needed. I had sort of inferred that something like that might be the case. And Christiaan's clarification that the hook only gets invoked (in this case) upon some action helps also. So, I'd be happy to write some clarification of what each of the hooks do, after I figure that out. Now, I've added the LinkedFilesToFields script to the Add File or URL hook. My understanding is that when I drop a webpage or PDF document into the entry window sidebar, I should get a Url or Local- Url field generated, with the path to the webpage or document in it. Is that it? Because the Url field generation only occurs when I manually run the script on the entry, not automatically upon dropping a weblink onto the sidebar. The script hook on the Wiki only handles linked files, not linked URLs. It's not too hard though to modify the script to also handle remote URLs. Basically, you should copy the if block for Local File, and add a else if block to it for Remote URL. Something like this: ... else if theField is Remote URL then repeat with thePub in thePubs tell thePub if ((count of (get linked URLs)) 0) then set theURL to linked URL 1 set the value of field Url to theURL end if end tell end repeat end if Also note that the script hook only copies the first linked file, while the script from the list copies all linked files or URLs (if there are more than one). Christiaan Thanks for all the help, all. Best, -Nathan -- Nathan A. Paxton Ph.D. Candidate Dept. of Government, Harvard University Resident Tutor John Winthrop House, Harvard University napaxton AT fas DOT harvard DOT edu http://www.fas.harvard.edu/~napaxton = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = When you have to stay eight years away from California, you live in a perpetual state of homesickness. - Ronald Reagan The most courageous act is still to think for yourself. Aloud. -Coco Chanel = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = On 4 Dec 2008, at 7:06 PM, Alex Hamann wrote: On 04.12.2008, at 22:12, Nathan Paxton wrote: Ah, *that's* what the script hooks pref menu is for! I've never understood that. So I simply go to Script Hooks in the preferences, select Add to File or URL (and Did Auto File), and then select LinkedFilesToFields.scpt for the script file? And this will then automagically take the url/location of the included files (over in the preview sidebar) and put it in URL/file/DOI fields that the script has just created? I would wager that there are other non-beginner users out there who don't quite understand what the script hooks preferences and all are about. How could the BD project go about explaining the script hooks preferences panel, what the hooks are, and so forth? I know there's basic documentation on the wiki, but I can't say that I quite understand what's going on based on that. I'd be happy to help, but since I'm only fuzzily understanding this myself, I'm not good to lead/start a beefing up of the documentation. Best, -Nathan -- Nathan A. Paxton Ph.D. Candidate Dept. of Government, Harvard University Resident Tutor John Winthrop House, Harvard University napaxton AT fas DOT harvard DOT edu http://www.fas.harvard.edu/~napaxton Hi Nathan, I might be too basic here but maybe it helps clarify things. You should be aware of the difference between a script and a script hook. An applescript is a small script file that is being kept in the respective BibDeks scrip folder and that can be invoked
Re: [Bibdesk-users] *****SPAM***** Re: URLs in formatted citations, deprecated fields, and such
Actually, the following was in the script I got: -- convert linked URLs set theCount to count of (get linked URLs) repeat with i from 1 to theCount set theURL to (get linked URL i) set theFieldName to Url if i 1 then set theFieldName to Url- i set the value of field theFieldName to theURL end repeat When I run the script manually, it sets the remote URLs. I'll add the suggestion you had for remote URLs once I can get the automatic action working for local files. Best, -Nathan -- Nathan A. Paxton Ph.D. Candidate Dept. of Government, Harvard University Resident Tutor John Winthrop House, Harvard University napaxton AT fas DOT harvard DOT edu http://www.fas.harvard.edu/~napaxton = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = When you have to stay eight years away from California, you live in a perpetual state of homesickness. - Ronald Reagan The most courageous act is still to think for yourself. Aloud. -Coco Chanel = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = On 4 Dec 2008, at 7:41 PM, Christiaan Hofman wrote: On 5 Dec 2008, at 1:28 AM, Nathan Paxton wrote: Alex (et al.), That was exactly what I needed. I had sort of inferred that something like that might be the case. And Christiaan's clarification that the hook only gets invoked (in this case) upon some action helps also. So, I'd be happy to write some clarification of what each of the hooks do, after I figure that out. Now, I've added the LinkedFilesToFields script to the Add File or URL hook. My understanding is that when I drop a webpage or PDF document into the entry window sidebar, I should get a Url or Local- Url field generated, with the path to the webpage or document in it. Is that it? Because the Url field generation only occurs when I manually run the script on the entry, not automatically upon dropping a weblink onto the sidebar. The script hook on the Wiki only handles linked files, not linked URLs. It's not too hard though to modify the script to also handle remote URLs. Basically, you should copy the if block for Local File, and add a else if block to it for Remote URL. Something like this: ... else if theField is Remote URL then repeat with thePub in thePubs tell thePub if ((count of (get linked URLs)) 0) then set theURL to linked URL 1 set the value of field Url to theURL end if end tell end repeat end if Also note that the script hook only copies the first linked file, while the script from the list copies all linked files or URLs (if there are more than one). Christiaan Thanks for all the help, all. Best, -Nathan -- Nathan A. Paxton Ph.D. Candidate Dept. of Government, Harvard University Resident Tutor John Winthrop House, Harvard University napaxton AT fas DOT harvard DOT edu http://www.fas.harvard.edu/~napaxton = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = When you have to stay eight years away from California, you live in a perpetual state of homesickness. - Ronald Reagan The most courageous act is still to think for yourself. Aloud. -Coco Chanel = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = On 4 Dec 2008, at 7:06 PM, Alex Hamann wrote: On 04.12.2008, at 22:12, Nathan Paxton wrote: Ah, *that's* what the script hooks pref menu is for! I've never understood that. So I simply go to Script Hooks in the preferences, select Add to File or URL (and Did Auto File), and then select LinkedFilesToFields.scpt for the script file? And this will then automagically take the url/location of the included files (over in the preview sidebar) and put it in URL/file/DOI fields that the script has just created? I would wager that there are other non-beginner users out there who don't quite understand what the script hooks preferences and all are about. How could the BD project go about explaining the script hooks preferences panel, what the hooks are, and so forth? I know there's basic documentation on the wiki, but I can't say that I quite understand what's going on based on that. I'd be happy to help, but since I'm only fuzzily understanding this
Re: [Bibdesk-users] *****SPAM***** Re: URLs in formatted citations, deprecated fields, and such
Huh? It does not generate a file, it only generates a Local-Url field. Christiaan On 5 Dec 2008, at 1:46 AM, Nathan Paxton wrote: Hmm. This helps. I will try it post-haste, but there does not seem to be an automatic generation of the linked file on my hard drive when I drop the PDF onto the sidebar. Best, -Nathan -- Nathan A. Paxton Ph.D. Candidate Dept. of Government, Harvard University Resident Tutor John Winthrop House, Harvard University napaxton AT fas DOT harvard DOT edu http://www.fas.harvard.edu/~napaxton = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = == When you have to stay eight years away from California, you live in a perpetual state of homesickness. - Ronald Reagan The most courageous act is still to think for yourself. Aloud. -Coco Chanel = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = == On 4 Dec 2008, at 7:41 PM, Christiaan Hofman wrote: On 5 Dec 2008, at 1:28 AM, Nathan Paxton wrote: Alex (et al.), That was exactly what I needed. I had sort of inferred that something like that might be the case. And Christiaan's clarification that the hook only gets invoked (in this case) upon some action helps also. So, I'd be happy to write some clarification of what each of the hooks do, after I figure that out. Now, I've added the LinkedFilesToFields script to the Add File or URL hook. My understanding is that when I drop a webpage or PDF document into the entry window sidebar, I should get a Url or Local-Url field generated, with the path to the webpage or document in it. Is that it? Because the Url field generation only occurs when I manually run the script on the entry, not automatically upon dropping a weblink onto the sidebar. The script hook on the Wiki only handles linked files, not linked URLs. It's not too hard though to modify the script to also handle remote URLs. Basically, you should copy the if block for Local File, and add a else if block to it for Remote URL. Something like this: ... else if theField is Remote URL then repeat with thePub in thePubs tell thePub if ((count of (get linked URLs)) 0) then set theURL to linked URL 1 set the value of field Url to theURL end if end tell end repeat end if Also note that the script hook only copies the first linked file, while the script from the list copies all linked files or URLs (if there are more than one). Christiaan Thanks for all the help, all. Best, -Nathan -- Nathan A. Paxton Ph.D. Candidate Dept. of Government, Harvard University Resident Tutor John Winthrop House, Harvard University napaxton AT fas DOT harvard DOT edu http://www.fas.harvard.edu/~napaxton = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = When you have to stay eight years away from California, you live in a perpetual state of homesickness. - Ronald Reagan The most courageous act is still to think for yourself. Aloud. -Coco Chanel = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = On 4 Dec 2008, at 7:06 PM, Alex Hamann wrote: On 04.12.2008, at 22:12, Nathan Paxton wrote: Ah, *that's* what the script hooks pref menu is for! I've never understood that. So I simply go to Script Hooks in the preferences, select Add to File or URL (and Did Auto File), and then select LinkedFilesToFields.scpt for the script file? And this will then automagically take the url/location of the included files (over in the preview sidebar) and put it in URL/file/DOI fields that the script has just created? I would wager that there are other non-beginner users out there who don't quite understand what the script hooks preferences and all are about. How could the BD project go about explaining the script hooks preferences panel, what the hooks are, and so forth? I know there's basic documentation on the wiki, but I can't say that I quite understand what's going on based on that. I'd be happy to help, but since I'm only fuzzily understanding this myself, I'm not good to lead/start a beefing up of the documentation. Best, -Nathan -- Nathan A. Paxton Ph.D. Candidate Dept. of Government, Harvard University Resident Tutor John Winthrop House, Harvard University napaxton AT fas DOT harvard DOT edu http://www.fas.harvard.edu/~napaxton Hi Nathan, I might be too basic here but maybe it helps clarify things. You should be aware of the difference