A question about Applescript

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
Dellu
Posts: 268
Joined: Sun Mar 27, 2016 5:30 am

A question about Applescript

Post by Dellu »

I was trying to simplify the process of copying "Title", "Author" and "date" from the Pdf files in Bookends to the reference.

It is very hectic process to copy each of these items and past into the menu, one by one.

(Google scholar is not working for me).

So, what I want to do is to copy all the three items, and insert them once.

Code: Select all

tell application "Bookends"
	tell the front library window
		set myRefs to selected publication items
		set myItem to first item of myRefs
		set myData to (the clipboard as list)
		set title of myItem to item 1 of myData
		set authors of myItem to item 2 of myData
		set date of myItem to item 3 of myData
	end tell
end tell
the idea was to use KM to collect all the 3 clipboards into a single clipboard; and then, split that last clipboard into items.

the following KM script correctly concatenates all the clipboards (which bear the Title, Author and Year) into a single clipboard to be used in Apple script.

Image
https://take.ms/P3FHG

Now, the problem is, the AppleScript is packaging all these items into one. I am unable to get the clipboard as a proper list.

Code: Select all

set MyData to (the clipboard as list)

This one picks out the words, not the comma separated items.

Is there an easy way to pick up the Title, author and Year as separate items in Applescript?
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: A question about Applescript

Post by Jon »

You might have better luck getting an answer if you post to the Bookends AppleScript forum instead of the general one.

Jon
Sonny Software
Dellu
Posts: 268
Joined: Sun Mar 27, 2016 5:30 am

Re: A question about Applescript

Post by Dellu »

I find the solution https://stackoverflow.com/questions/672 ... pplescript

If anyone is interested in the macro, here it is: https://www.dropbox.com/s/sam966o2vcq1q ... acros?dl=0

its function is to get reference data from the pdf.

- first copy the Title, Author and Year from the pdf--in exactly that order
- hit the hotkey

That is all. The macros fills the data to the reference field in BE.
You can make it insert a complete data by adding Publisher and Address fields.
Dellu
Posts: 268
Joined: Sun Mar 27, 2016 5:30 am

Re: A question about Applescript

Post by Dellu »

Oh, sorry, I didn't know that you have a separate section to discuss Applescript.
Post Reply