I would like to do this in one step:
- select text on a Safari web page on my iPhone
- export selected text and name and/or URL of the web page to DEVONthink To Go
Any ideas?
I would like to do this in one step:
Any ideas?
Perhaps a shortcut? By ânameâ of the web document, you mean its title, I suppose?
yes, I mean the title. I tried it with Shortcuts but could not even get the selected text:
These were my very first steps with Shortcuts. So maybe my approach is completely wrong.
Hereâs what I came up with (in German, Iâm afraid)
The DTTG action uses the name
and the URL
from the Shortcut input. The text is taken from the current selection via JavaScript. That works apparently ok here.
But shortcuts is still a mess.
Thanks a lot, you pointed me in the right direction. I reworked my shortcut and simplified it:
Also no need for JavaScript
BUT: Script runs fine on iPad but returns only the name of the document and not URL and selection on iPhone. Youâre right: Shortcuts is a mess.
BTW: I wonder why DEVONthink is available in Apple Shortcuts only on iPhone and iPad but not in MacOSâŚ
I think thatâs because you can easily script DT on macOS. No need for a crutch like Shortcuts if you have The Good Stuffâ˘
Btw: are you using Page URL at all?
yes, to create a hyperlink in the markdown doc
But not to set the recordâs URL?
No. That document is only a note and I may later add quotes from other sources. I use the recordâs URL only for reference docs like bookmarks, PDFs etc.
I may have misunderstood what youâre saying here, but you can end up with different results depending on how you invoke the Shortcut:
Your Shortcut looks correct to me. Hereâs my version, slightly simplified by selecting the variables inline rather than defining them separately (you can insert the âShortcut Inputâ variable multiple times, then just tap on it to select which data you want to use in each instance).
Thatâs a good idea to select the variables inline. I tried exactly your script but Iâm not able to get the selected text. Here it returns:
<blockquote>
</blockquote>
with no selected text in between.
On the iPad I get Page Selection, Name, Page Content and Page URL without problem, on the iPhone I get only Name. Itâs driving me nuts!
Thanks.
I tried this out. Worked as advertised on both my ipad (OS 16.2) and iphone (iOS 16.1.1)!
Finally fixed: my iOS language was German, on the iPad it was English. When I changed the language on the iPhone to English the shortcut worked as expected. Thank you all for your helpful input!
Seriously â the shortcuts are language dependent? This thing is even worse than I thought.
Yes, and it even wasnât enough to set Shortcuts app and Safari to the same language. I had to change the OS language!
Well, English is of course far superior to German, so youâre better off with that anyway
Iâm curious why youâre using the HTML <blockquote>
element in your Markdown document.
Iâm not a Markdown purist by any stretch of the imagination but Iâm surprised @chrillek had no comment on that
PS: Shortcuts
Iâm getting lazy, I guess.
But itâs a good question: why not simply use >
as is standard in MD? Yes, I know that HTML elements are allowed in MD.