From: Christiaan H. <cmh...@gm...> - 2007-06-29 12:50:31
|
Try adding things like "get" in various places (like "get keywords of =20= thePub"). Or separate getting the keywords and comparing it to "" =20 into two statements. Or add a line "set thePub to contents of thePub" after the repeat line (that is usually a good thing to do with a =20 "repeat with" statement, annoying but that's what AppleScript is). BTW, an alternative is also to use the Database Find & Replace panel. Christiaan On 29 Jun 2007, at 2:36 PM, Derick Fay wrote: > You can use this applescript to add keywords without opening the =20 > individual publication records. Select the publication(s) to which =20= > you want to add a keyword, then run the script. You can add as =20 > many keywords as you want; just separate them with commas. I've =20 > also posted a copy here: http://dfay.fastmail.fm/bibdesk/ > > Although the script tries to check for an empty keywords field, it =20 > doesn't detect it for reasons unknown to me, so if the keywords =20 > field is empty when the script is run, the script will add ", " at =20 > the beginning of the keywords. This is immaterial, just messy, but =20= > if someone can tell me how to check the keywords successfully, I'd =20 > appreciate it. > > I have this in a command in OnMyCommand, set to be visible only in =20 > BibDesk. > > Derick > - - - - - > > tell application "BibDesk" > activate > =09 > -- without document, there is no selection, so nothing to do > if (count of documents) =3D 0 then > beep > display dialog "No documents found." buttons {"=95"} = default button =20 > 1 giving up after 3 > end if > set thePublications to the selection of document 1 > =09 > set theKeyword to text returned of (display dialog "Enter = keyword =20 > to add:" default answer "") > =09 > repeat with thePub in thePublications > if ((keywords of thePub) is not "") then > set delimiter to ", " > else > set delimiter to "" > end if > set keywords of thePub to (keywords of thePub & ", " & = theKeyword) > end repeat > =09 > set selection of document 1 to thePublications > =09 > end tell -- Bibdesk > > - - - - - > > > On Jun 29, 2007, at 4:57 AM, Niels Kobsch=E4tzki wrote: > >> On Jun 29, 2007, at 10:48 AM, Christiaan Hofman wrote: >> >>> >>> On 29 Jun 2007, at 9:03 AM, Niels Kobsch=E4tzki wrote: >>> >>>> Hi! >>>> >>>> I want to add keywords to several publications but do not want to >>>> open each time the publication just for adding keywords. >>>> There is now the preview-pane and it would be more or less =20 >>>> optimal to >>>> click there on the keywords-field for adding them there. Is =20 >>>> there any >>>> way to do it? >>>> Or is there any other way to add keywords w/out opening each >>>> publication first? >>>> >>>> Niels >>> >>> >> >> <snip editing in preview pane is not possible> >> >>> What you can do is use the field group: choose Keywords as the >>> grouping field on the left, and drag your publications to the =20 >>> keyword >>> you want to set. If the keyword does not yet exist, use Database > >>> New Field Group With Selection. >> >> Then it's faster to open the publication for adding those two, three >> keywords I want to add to each publication (which differ) >> >> Niels >> ---------------------------------------------------------------------=20= >> ---- >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> _______________________________________________ >> Bibdesk-users mailing list >> Bib...@li... >> https://lists.sourceforge.net/lists/listinfo/bibdesk-users > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Derick A. Fay, Ph.D. > Visiting Assistant Professor > Department of Anthropology > Union College > Schenectady, NY 12308 > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Derick A. Fay, Ph.D. > Visiting Assistant Professor > Department of Anthropology > Union College > Schenectady, NY 12308 > > > > > ----------------------------------------------------------------------=20= > --- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/=20 > _______________________________________________ > Bibdesk-users mailing list > Bib...@li... > https://lists.sourceforge.net/lists/listinfo/bibdesk-users |