Open same PDF twice

Hi,
how can i open the same record (in this case, a PDF) twice within DTPO?
best and thanks,
bosie

Wouldn’t Replicating it do the trick? Alternatively - if you’re not wanting any changes to be carried over between them - Duplicating it?

you are right but that would require me to handle resources afterwards. then i would probably just open it in another app, though i wouldn’t want that if i can avoid it

Yep - figured I would pop up the obvious, since I know I’ve missed some obvious ‘tricks’ before! :laughing:

Maybe if you clarify why you’d need to have two instances of the same source open at once, someone could drop in a different suggestion?

Try this… it’s just something I hacked together quickly.

tell application id "DNtp"
	activate
	if selection ≠ {} then
		set {w, h} to {word 1, word 2} of ((do shell script "system_profiler SPDisplaysDataType | grep Resolution | sed -E 's_^.* ([0-9]*) x ([0-9]*)_\\1, \\2_'") as string)
		set {x, y, w} to {0, (h as real) - 75, (round ((w as real) / 2))}
		repeat 2 times
			open tab for record (item 1 of (selection as list))
			set properties of think window 1 to {bounds:{x, 0, x + w, y}}
			set x to x + w
		end repeat
	end if
end tell

that is wicked, smoother solution than i expected. and easy to change so it takes a number as a param:

tell application id "DNtp"
	activate
	if selection ≠ {} then
		set n to 3
		set {w, h} to {word 1, word 2} of ((do shell script "system_profiler SPDisplaysDataType | grep Resolution | sed -E 's_^.* ([0-9]*) x ([0-9]*)_\\1, \\2_'") as string)
		set {x, y, w} to {0, (h as real) - 75, (round ((w as real) / n))}
		repeat n times
			open tab for record (item 1 of (selection as list))
			set properties of think window 1 to {bounds:{x, 0, x + w, y}}
			set x to x + w
		end repeat
	end if
end tell

Glad you like it (and yes, I would have wired it as you did but couldn’t think of a use case - plus I am on a 13" MacBook Pro. Three wide gets small pretty fast!). :mrgreen:

30" display… brings ruler :wink:

13" display - sheds bitter tears of shame. :mrgreen:

I am intrigued by this, as a matter of interest why would you want to open the same pdf twice?

Was wondering the same thing? :smiley:

Tried the script - works a charm. Can see use in possibly having it act like a type of “split screen”, where you have one instance on a particular part of the pdf, and the other instance on a different section – but cannot really see that happening all too much in my workflow…

So was simply curious about what the OP would be using it for?

I like the script – thank you Dr. Bluefrog 8)

I do this when I have a longish document and want to look at different pages side by side. But I don’t do anything fancy. I view the document in the preview panel of 3-pane view (or some other view) and then press command-O open a second window on the same document. Then, put the two side by side.

:mrgreen:

I can definitely think of useful modifications of this script but rather for laying out multiple selected documents ready to use i.e. select 4 docs and have them laid out side by side for you across two spaces automatically.

The one think I can’t seem to work out how to get the script to do, is to force a window to open in a particular space say left or right of the current space. Any ideas?

Frederiko

Moom

scripted though?

I think what Korm means is that you could use UI scripting to activate Moom’s built in functions to move windows between spaces and it that way quickly layout the selected documents. I have Bettertouchtool setup to do something similarly manually so it should be trivial to:
a) open the first DT document in the list and place it left or right
b) apply the keystrokes that Bettertouchtool (or Moom) would use to move the window to a different space using UI scripting.
c) Repeat for each document, placing them left and right alternately

As soon as I get a chance I will try and knock something together and put it here.

Frederiko

Moom (for example) is scriptable. If you have a “snapshot” (pre-defined window arrangement) defined, then tell Moom


arrange windows according to snapshot named <whatever>

Can also be done with Keyboard Maestro (which has actions to position windows) as a keystroke macro.

Or you could load the Bluefrog script into a single macro that runs the script and invokes a short Moom script and/or uses KM features to move windows.