Reputation: 1130
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
Upvotes: 2
Views: 1384
Reputation: 10603
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
Upvotes: 1