2
votes

I am trying to write an autohotkey script to open a pdf file with Drawboardpdf. Drawboardpdf file is a UWP app and I found the following command to launch the Drawboardpdf app:

^#r::

run, "drawboardpdf"

return

But while I was trying the following code to open a specific pdf file, the code didn't work:

^#r::

run, "drawboardpdf" "C:\Users\Dropbox\book1r.pdf"

return

Can anyone help me with this? Thanks a lot for your help!

Jason

1
Does Drawboard PDF has permission to read this file? It won't be able to access it unless you specifically opened this file or it's parent folder within the app. Also, Drawboard PDF has to support deep linking to open file from path and it might not support that.Andrei Ashikhmin
looks like not supporting. I'll check out @user3419297's answer. The UWP app does make the file IO more complex....Jason

1 Answers

1
votes

This works (for me) with Microsoft Edge:

; Open "C:\myFile.pdf" with Microsoft Edge:

IApplicationActivationManager := ComObjCreate("{45BA127D-10A8-46EA-8AB7-56EA9078943C}", "{2e941141-7f97-4756-ba1d-9decde894a3d}")
DllCall(NumGet(NumGet(IApplicationActivationManager+0)+3*A_PtrSize), "Ptr", IApplicationActivationManager, "Str", "Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge", "Str", "C:\myFile.pdf", "UInt", 0, "IntP", processId)
ObjRelease(IApplicationActivationManager)

https://msdn.microsoft.com/de-de/library/windows/desktop/hh706902(v=vs.85).aspx