My new favorite way to write (this week)

There’s nothing groundshaking here, but I’ve discovered a new, comfortable way to write.

I open two windows into the DT database for the thing I’m working on. The sidebar is turned off in each window. I also open up my document in my word processor.

One DT window is looking at a single tag. That’s where I see the context I want.

The other DT window, typically on my second display, is used to browse and search the database. If I want to bring another note into my focus, I find it in that second windows and add the tag I’m looking at in the first window. That adds the note to the first window.

It’s not high tech stuff, it’s just a comfortable arrangement and it’s a good candidate to save in a workspace.

5 Likes

Thanks for sharing your thoughts on this.

Is this personal or professional writing you’re doing?

I do work-related documentation, all for internal use. I haven’t used this setup for that, yet, but I probably will.

The project I’m using this setup on is tire-kicking for a novel I think I’d like to write.

It will be about cyber security in the real world, like sending a small speaker on a fish tape from the roof of the house through a hot water heater vent and bellowing commands to Alexa. Things like turn off the alarm system and unlock the front door.

Nerds gone wild, something along those lines.

2 Likes

I actually use my Script menu > Edit > Open in two windows script when I’m working on our documentation - selecting source notes and my documentation file :slight_smile:

2 Likes

Sounds handy. I don’t have that in my Scripts menu - I need to check my extras notifications. Is that were I’d find it?

Hmmm… I found the script in the extras and clicked on it. It appeared in the script menu, but doesn’t seem to do anything.

I also don’t see the layout shown in the manual with install and remove buttons - I may be completely lost. That happened, once. Fortunately, both hands and a flashlight saved the day.

I found the Support Assistant and installed from there - still no apparent effect. It is in the scripts menu as Open in two windows DT3.

It works for me: select two records in DT and run (click on) the script. I then end up with the records displayed in each of the two new windows.

Stephen

Well, I wasn’t using it correctly.

I tried with two files selected before running the script. Still no apparent effect.

It’s also possible I don’t yet understand what the script does. If I select two files and then double-click on either of them, they open up in two windows.

Does the script do something other than that?

Yes - for me those windows are on top of each other.

It displays the windows very neatly side by side.

Stephen

Ah, that’s cool. Not sure why it’s not working here. A nice mystery to work on this evening.

It is not working on my computer as well. Keep us informed if you find a solution.

If it’s not working for you it’s probably helpful to mention the version numbers of your macOS and DT—just in case that makes a difference. I’m using DT 3.7.2 on macOS 11.5.1.

How I use the script:

  • select two files in DT;
  • click on the DT script icon in the menu bar and go to Edit > Open in two windows (see note below as to name of the script);
  • click on the script Open in two windows.

Note: I appear to have three versions of the script (Open in two windows DT3, Open in two windows_DT3, and Open in two windows.) However all work for me.

Stephen

I’m running MacOS Big Sur 11.5.1 on a late 2015 iMac. Devonthink is Devonthink Server Edition 3.7.2.

I’ve fiddled with a few options like double-click to open externally, which is what I like, but the script is not doing anything.

The log window remains empty.

It’s going to be a busy weekend. When I can get some troubleshooting time in, I’ll post results.

I wish I were a native speaker in Applescript, but I can work through it.

As a final suggestion, try rebooting!

Stephen

Let me double-check on my Big Sur machines.


Interesting.
Window width is calculating strangely on Big Sur on my M1 Air.
Works as expected on my Intel Mini.

I’ll have to look at that for M1 Macs.

Bonus Feature!

If you weren’t aware of it @Stephen_C, et al: This script can open the same file in two separate windows, if desired.
This was actually the original intent when I wrote it.

Back in the days, before @cgrunenberg implemented side-by-side in DEVONthink 3, it was an ad-hoc way to edit the source of a Markdown file, save it, and see the rendered change in the same file in the second window. Kind of a poor man’s Marked.

Bonus Feature #2!

If you select a single file and that file has an associated annotation file, they should both open up in side-by-side windows. Perhaps less necessary with the Annotation inspector but stil perhaps useful.

2 Likes

Thanks @Stephen_C and @BLUEFROG

I have DT 3.7.2, MacOs 11.4, Mac Intel.

I deleted all “two windows” scripts and installed them again. Now, it is working. However, I do not get the two files that I selected in two windows side-by-side.

Can you share with us the outcome of this script on the screen?

You’re welcome :slight_smile:
This is on an Intel Macbook on Catalina…

Note: The current version of macOS Big Sur is 11.5.1. We suggest you stay current with operating system point releases.

This line is where things are running off the rails:

set xWidth to (w / divisor) as integer

The problem starts earlier, in this line:

set displayRes to (do shell script “system_profiler SPDisplaysDataType | grep Resolution | head -n 1 | sed -E 's_.* ([0-9]) x ([0-9])\1 \2’”)

sed isn’t getting just the [0-9]* x [0-9]* part.

Here’s my change:

– set displayRes to (do shell script “system_profiler SPDisplaysDataType | grep Resolution | head -n 1 | sed -E 's_.* ([0-9]) x ([0-9])\1 \2’”)
– set {w, h} to {word 1, word 2} of displayRes

set displayRes to (do shell script “system_profiler SPDisplaysDataType | grep Resolution”)

set {w, h} to {word 4, word 6} of displayRes

I was in the middle of fixing the sed when my wife started yelling about lunch. Er, sweetly suggesting it was time to eat, that is.

The script runs now, but the widths of the new windows are wider than intended.

Also, I have two displays on my system.

Gotta dash…

1 Like

Thanks.very useful.

1 Like