@koottova
Never one to give up, I think I may have your desired answer, and ALL on One shortcut ALTFT.
Note it can only work in a recent https://www.sumatrapdfreader.org/prerelease.html version unlike the one above it will not work in version 3.2 or earlier.
Beware it is a very long line and the " % and 4 tabs (the big space) are critical since the current session stores the open file names in exactly that fashion.
DO read the notes below that explain how you will need to make two adjustments for YOUR pc
ExternalViewers [
[
CommandLine = C:\Windows\System32\cmd.exe /c Find " FilePath =" "SEE NOTES\SumatraPDF-settings.txt">%temp%\pdflist.txt & FOR /F "tokens=3* skip=3 delims= " %G IN (%temp%\pdflist.txt) DO start "" "c:\program files\SumatraPDF\SumatraPDF.exe" "%G %H"
Name = another app ALL current &Tabs
]
]
NOTE to anyone copying/pasting the above command, beware when copying command lines that quotes may be changed from required simple double " marks to non working “curly quoted”
When current pre-release is running it keeps track of the current tabs in a TabStates [
area towards the end of the SumatraPDF-settings.txt. This was "not always" the case in previous versions, including 3.2.
So now we can search for the current tabs filenames by looking for those with 4 TAB characters. That is what the “Find” part does, so the big gap infront of “FilePath” is important otherwise it will find other entries not currently open.
Where it says "SEE NOTES\
then YOU need to replace that with the location of the settings file so it might be "C:\users\*your name*\appdata\local\
for a more recent installed pre-release version or if you are using a portable version it could be the folder with the SumatraPDF.exe . The easiest way to check is in Advanced settings using “Save AS” and note where that file is located.
ALSO note where I have put "c:\program files\SumatraPDF\SumatraPDF.exe"
as my file handler for the tab set to be reopened you will need to replace that with wherever your acrobat.exe is located . you can usually find that by looking at the properties of an acrobat shortcut.
There are at least two restrictions to avoid with this method
- ALL open tabs filenames will be sent to the receiving app so if you have an epub open in a tab that name will also be sent but acrobat should just say it cant open it ?
- I had allowed for filenames with spaces in the filename ( previously the reason for %G…) however on revisiting this on another machine I find there seems to be a bug in the way sumatrapdf and windows handle the end part of command line so it is now %G %H and sumatrapdf/windows will add the current tab again to each line !! I cant seem to find out how to avoid that without changing the method (see alternative below) but again acrobat should ignore the extra entry.
- The number of tabs that can be processed may depend on how long their filenames are and possibly could fail on those with odd non latin characters. I had no problems with a set of 10 mixed files with reasonable lengths of file path. Best to keep your filename paths short and simple. (filenames with - or _ were not a problem for me, but avoid any with ! or = etc, they may not always work)
Good luck
Alternative method
to make this much easier for other uses such as simply save all current tabs to a list or a command list.
in pre-release \ SumatraPDF-settings.txt use a simpler external call, change "some where to a folder of your choice e.g. "c:\my scripts\
ExternalViewers [
[
CommandLine = C:\Windows\System32\cmd.exe /c "some where\CurrentTabs.cmd"
Name = another app ALL current &Tabs
]
]
If you want to automatically run the list like above then
copy and paste the following in NotePad and save as (without the extension .txt) “some where\CurrentTabs.cmd”
FIND " FilePath =" "SEE NOTES\SumatraPDF-settings.txt" > %temp%\pdflist.txt
FOR /F "tokens=3* skip=2 delims= " %%G IN (%temp%\pdflist.txt) DO start "" "the target application\handler.exe" "%%G %%H"
SEE NOTES\ as per above and
the target application\handler.exe
could be SumatraPDF
If you dont want to automatically run the list but say save it to use later e.g. to start SumatraPDF with a saved list then copy and paste the following in NotePad and it save as (without the extension .txt)
"some where\CurrentTabs.cmd"
FIND " FilePath =" "SEE NOTES\SumatraPDF-settings.txt" > %temp%\pdflist.txt
FOR /F "tokens=3,2,1 delims=/" %%i in ("%date%") do set IsoDate=%%k-%%j-%%i
FOR /F "tokens=2,1 delims=: " %%m in ("%time%") do set IsoTime=-%%m-%%n-
FOR /F "tokens=3* skip=2 delims= " %%G IN (%temp%\pdflist.txt) DO echo start "" "the target application\handler.exe" "%%G %%H" >> "some where\%IsoDate%%IsoTime%SumatraPDFSavedSession.cmd
If you want it even simpler as a text list, then change second half of last line from
DO echo start "" "the target application\handler.exe" "%%G %%H" >> "some where\%IsoDate%%IsoTime%SumatraPDFSavedSession.cmd
to
DO echo "%%G %%H" >> "some where\SumatraPDFSavedSession.txt