Cedeq Community Forum

Full Version: How do I use ShortKeeper to launch a selected file within an application?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Shortkeeper is a capable product and I have a hunch it can do something I'd like to do, but I just don't know the particulars on how to do it!

On my Windows 10 systems, I have set my default PDF application to be the Sumatra PDF viewer.  This is the application I use most with PDF files.  However, I also frequently use a software product called PDF-XChange to edit PDF files.  I would like to set up a ShortKeeper hotkey to launch a selected file within PDF-XChange when I have selected the file within Windows File Explorer (by left clicking on the file); second best, the I'd use the hotkey on a file my mouse is hovering over from within the File Explorer window to launch that file within PDF-XChange.  I surmise there are two ShortKeeper approaches available to accomplish what I'm wanting to do:
1) Use "Start application by path and file name"
2)  Use "Run AutoHotkey code"
I've tried using both approaches but due to my limited knowledge (and probably making several syntax errors, or other errors) I haven't been successful with either approach (even after using some AutoHotkey snipets of code I've found on AutoHotkey forums).  It's tricky telling ShortKeeper/AutoHotkey which file to launch in the application because the file name is dynamic.

The path of my PDF viewer/editor software is as follows:  C:\Program Files\Tracker Software\PDF Viewer\PDFXCview.exe  

Any help you can provide on solving the above issue will be much appreciated!  ShortKeeper is awesome, thanks for providing such a useful product.  It has saved me an incredible amount of time on repetitive tasks.
Since PDF-XChange is not your default viewer, I suggest that you create your shortcut with the command "Run AutoHotkey code" (by adapting one of the following two scripts):

Open a PDF document with PDF-XChange

run % "C:\Program Files\Tracker Software\PDF Viewer\PDFXCview.exe ""C:\Path\FileName.pdf"""

Open a selected PDF document (in Windows File Explorer or on the desktop) with PDF-XChange

ClipSaved := ClipboardAll
Clipboard =
SendInput, ^c
ClipWait, 2
if ErrorLevel
  MsgBox % "No file selected"
  run % "C:\Program Files\Tracker Software\PDF Viewer\PDFXCview.exe """ Clipboard """"
Clipboard := ClipSaved
Thanks so much for the post.  The second option works like a charm and is exactly what I needed!