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.
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.
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
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 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.
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.
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.
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?
This line is where things are running off the rails:
set xWidth to (w / divisor) asinteger
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.