I feel like I’m overlooking something obvious, but I’ve searched in DT help and online and haven’t yet found the answer.
Scenario: I have an account at Medium, and I drag a Medium post into DT to bookmark it. Of course, the DT browser needs to be logged in to access the actual content. Medium has a somewhat nonstandard login procedure. There’s a login link at the top of a page that prompts you for your email address. They then email you a link that, when you click on it in your email client, opens a Medium web page that signs you in.
Maybe you can see the problem. If I click on the link in the email, it opens in my browser, not in DT. In DT, the browser displays the URL for the Medium page I’ve bookmarked, and were it a regular browser, I’d just paste the link from my email into the URL field and all would be well. But the DT URL field is read-only.
If I click on a link in a web page displayed in a DT browser window, it goes there. So I figured there must be a way that I can just enter a URL for it to go to. But I haven’t found it. Is there one?
I did try dragging the button in the email into the DT browser window, but that does not work. Dragging the button into a normal browser window does work, so macOS is recognizing the email button as a URL object.
What I’ve done instead is create a new (empty) bookmark, paste the Medium login URL into it, let it log in, and then delete the bookmark from DT. This is awkward to say the least. I also found that I could drag the email button into DT’s item list pane and create a new bookmark object that way. That’s a little easier, but again I have to briefly create an entry that I then immediately have to delete.
Is there a better way to log in to Medium in DT? Have I overlooked something obvious?
Not exactly. It’s not editable in the GUI, but can be accessed via scripting.
Copy the link from the email, and then run the following AppleScript.
tell application id "DNtp"
set theURL to the clipboard
if (theURL does not start with "http") then -- very basic error catching
display alert "No valid URL is copied"
return
end if
set theWindow to viewer window 1 -- use think window 1 if desirable
set newTab to open tab for URL theURL in theWindow
set current tab of theWindow to newTab
set index of theWindow to 1 -- move window to front
end tell
I would try this…
Control-click the link in the email and choose Copy Link. Then in DEVONthink, choose Scripts menu > Tabs > Open Location, paste in the URL, and press OK. The page should open a new tab in the window.
I thought I’d try either approach, by first signing out in Medium, and then signing back in. Well, Medium certainly is peculiar about their user accounts. There’s no log out command in the user account menu! However, even though I’m signed in, there’s a login link and I can sign in again. I tried that using DT’s built-in AppleScript, and it worked (i.e., it brought up the Medium login in-progress window, and eventually a login acknowledgment).
If any of you Devonian devs need to moonlight, maybe you can offer Medium a hand to put some sense into their login process.
In their defense, this time the login brought up what looked like a somewhat different interface (from when I wasn’t logged in, though perhaps I missed it before). It had small print with a link indicating that if one had trouble with the mailed link, they could instead email a code. So it looks like I may be able to avoid having to do this in the future, though it’s easy enough via the built-in script.