Selected Text... pop up

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
Kowalski
Posts: 3
Joined: Mon Dec 04, 2023 9:10 am

Selected Text... pop up

Post by Kowalski »

When reading a PDF via attachment, could you please give me the option to have the "Selected Text..." popup appear automatically when I drag text (so that users who don't want it don't see it automatically).

It's becoming very frustrating for me to keep seeing the popup even though I don't intend to interact with it after dragging, so I have to keep giving it one more mouse click. Please give me the option to control the popup so that it doesn't happen automatically.
Attachments
selected Text....png
selected Text....png (78.84 KiB) Viewed 12817 times
Jon
Site Admin
Posts: 10073
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Selected Text... pop up

Post by Jon »

There are several downsides to that. Why are you frequently selecting text if you aren't doing anything with the selection? And note that pressing Esc will dismiss the popover, too.

Jon
Sonny Software
Kowalski
Posts: 3
Joined: Mon Dec 04, 2023 9:10 am

Re: Selected Text... pop up

Post by Kowalski »

@Jon

Thanks for your quick reply.

My main objective is to get the following values in the form I want.

Code: Select all

tell application id "com.sonnysoftware.bookends2"
	tell front library window
		set link to link to selected text of displayed PDF
		set selectedText to selected text of displayed PDF
		set selectedTextInfo to selected text info of displayed PDF
	end tell
end tell

set the clipboard to "> " & selectedText & linefeed & linefeed & "[" & selectedTextInfo & "](" & link & ")" & linefeed & linefeed
From what I've tried, the best way to do this is to just drag over the text.

Being able to do the above has been a huge benefit of Bookend for me.
Jon
Site Admin
Posts: 10073
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Selected Text... pop up

Post by Jon »

I see. A few things:

1. I don't know if you're aware, but you can copy the markdown link (and some explanatory text, which you may not want) from that popover. An advantage to this vs. your script is that Bookends actually creates a link to the selected text, not just the PDF. So when it's invoked Bookends will scroll right to it.

2. If you still prefer to highlight and invoke a script, though, I have a suggestion. Bookends already has too many preferences, and the ability to turn off the popover would be used by very few people. I think I could, however, make it so that creating a selection while the Command key is held down would bypass the popover. So if you still want to use your script, let me know if you agree this would solve the issue for you.

Jon
Sonny Software
Kowalski
Posts: 3
Joined: Mon Dec 04, 2023 9:10 am

Re: Selected Text... pop up

Post by Kowalski »

Thank you for your quick reply.
Thank you for your thoughtful explanation.
I didn't expect the communication to be as good as it is now when I posted my question.

1.
I'm aware of what you said. I would expect the link to open directly to that location in the PDF, just like you said.
There is a slight difference between what I'm getting and what I want, and I'd like to explain.

1-1. When I click Copy
```text
MI involves not only particular skills, but also an underlying attitude, a particular state of mind and heart with which you engage in a helping rela- tionship.
```

1-2. If I clicked Copy Link
```text
[Motivational Interviewing.pdf, p. 6, Selection: MI involves not only particular...](bookends://sonnysoftware.com/selection/Libraries/163408/1701352927/22/54/127/2431/160)
```

The result of my script (Even the whitespace at the bottom is intentional; I use the output below by pasting it into Obsidian.)
```text
> MI involves not only specific skills, but also an underlying attitude, a particular state of mind and heart with which you engage in a helping rela- tionship.

[Motivational Interviewing.pdf, p. 6, Selection: MI involves not only particular...](bookends://sonnysoftware.com/selection/Libraries/163408/1701352927/22/54/127/2431/160)

```

If you look at the above, you'll notice that I've combined the "Copy" and "Copy Link" you're providing into the format I want.

As I understand it, the output of my script will be similar to the output you mentioned in the link below (but I don't know how I can use the functionality mentioned in the link below).
viewtopic.php?t=6065

2-1. it would be really, really best to be able to choose to show the popup itself, but if that's not possible, I'm very grateful to have the option via command.

2-2. how can I use the Copy Selection and Link feature, and is it possible to customize the format of this feature?

2-3. Not having a popup is not what I'm looking for, and if I can get the same result with my script, it would be best for me to use Bookend's built-in functionality for Copy Selection and Link.
Jon
Site Admin
Posts: 10073
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Selected Text... pop up

Post by Jon »

Please see the release notes for 14.2.6:

https://www.sonnysoftware.com/support/version-history

You can copy the text and link to an annotation, such as highlight, by right-clicking on it and choosing Copy Content With Link. It's not scriptable, you must do this via the UI. As the thread you linked to mentions, you can also do this with Hookmark or your own script.

This is what you get, as Markdown, when you copy a highlight of the words "Flow Cytometry":

Flow Cytometry Gieras et al 2017.pdf, p. 2 [Gieras et al 2017.pdf, p. 2](bookends://sonnysoftware.com/annotation/Library1/171557/1690039239/1/-306/-446)

Hm, the text and link work for styled text, but the Markdown is incorrect -- it should be

Flow Cytometry [Gieras et al 2017.pdf, p. 2](bookends://sonnysoftware.com/annotation/Library1/171557/1690039239/1/-306/-446)

I'll fix that for the next update.

If you want to customize the results Bookends provides you can do that with scripts -- the content is in the clipboard so you can manipulate it as you like.

I'll add the Command-selection option (no popup) in an update, too.

Jon
Sonny Software
Post Reply