Link to home
Start Free TrialLog in
Avatar of Luis Diaz
Luis DiazFlag for Colombia

asked on

Open a containing folder of an adobe file with AutoHotkey

Hello experts,


I have the following AutoHotKey script that should open containing folder of an Adobe file. However I don't know why is not working.

<^>!+a:: App := ComObjCreate("AcroExch.App") ; Acrobat Application Object AVDoc := App.GetActiveDoc() ; Acrobat View Object PDDoc := AVDoc.GetPDDoc() ; PDF Document Object JSO   := PDDoc.GetJSObject ;  JavaScript Object MsgBox % JSO.Path ; Path of JavaScript Object in JavaScript format Return 

Open in new window

Thank you in advance for your help.


ASKER CERTIFIED SOLUTION
Avatar of Joe Winograd
Joe Winograd
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Luis Diaz

ASKER

Hello Joe,

Please find attached the video that shows that the script is not working for me.

Regards,
Luis.
Open-containing-folder-autothotkey-L.wmv
Hi Luis,

The script works perfectly here with Adobe Acrobat Pro DC (32-bit), which seems to be the same version that you're running. Your script is failing on the ComObjCreate call ("No such interface supported"). The rest of the script can't possibly work until we figure out why the ComObjCreate fails. It may be because of a bad installation...perhaps you did not select to have the COM (Component Object Model) components installed. My first thought is to reinstall Acrobat Pro and make sure that the COM components are installed.

Btw, to stop the "An older instance..." dialog, put this line at the top of the script:

#SingleInstance Force ; replace old instance immediately

I didn't have that in the posted code because I thought you would put the hotkey in your main AutoHotkey hotkeys/hotstrings script, which should already have that line. Regards, Joe
Hello Joe,

I am having the same issue as before and after uninstalling and installing Adobe Acrobat.

Please find bellow the video that describe the issue:

https://drive.google.com/file/d/1C3iLYSJpWBuPyNTlyF8hmY8sW_JvKUZy/view?usp=share_link

I couldn't send you attached to this message as I have a size limitation for attached videos.

If you don't have access to the video, please request the access but I've already gave you access to the e-mail address that I have from you.

Best,
Luis Diaz.
Hi Luis,

It is difficult to hear your voice on the video because there is loud music on it during the entire video (you forgot to turn off that screen recording option). Anyway, even without your words, I can see from the video that you installed Adobe Acrobat Reader:

User generated image
The COM components are not available in Reader — they are in Standard and Pro. Your first video showed that you were using Pro:

User generated image
So, please reinstall Acrobat, but make sure it is Pro this time, and be sure to install the COM components (that's probably an installer option, but it's been a long time since I did an Acrobat install, and I don't remember if the default is to install COM or not).

I want to be clear that your problem has nothing whatsoever to do with AutoHotkey or the AutoHotkey script. Any other script in any other language that attempts to create the Acrobat COM object will have the same result. You must solve this problem first. Regards, Joe
Hello Joe,

I am trying to install Adobe Pro but unfortunately my French debit card has been blocked as I am in United States my French bank (BNP Paribas) let me know that several transactions from Amazon, Walmart and Target were done without my approval. As a result, I cannot subscribe to the Adobe Pro free trial.

If you know another way to install Adobe Pro without using a debit card, please let me know.

Best,
Luis.
PayPal is another way.
Also blocked as I opened my PayPal account in Grenoble France and today I am in Miami and tomorrow in Bogotá Colombia. I should wait till the 17 of January 2023 to be able to use PayPal account through France as I will be in France the 17 of January 2023. Or with my French debit card as the new card will arrive the 16 of January to my new apartment in France.
OK, let's revisit this when you get Acrobat Pro installed with the COM components. Wishing you a Happy New Year! Regards, Joe
Ok Joe, noted, Wish you a happy new year from Miami! All the best for you and for your family!
Adobe Acrobat version cost me 23.99 euros per month. Amount doesn't justify the exclusive need which is to open a containing folder of a PDF file.
Anyway Joe, Thank you for your help.
Regards,
Luis.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Noted Joe. Thank you for your help.
Another option:
Open .pdf file.
1) CTRL + O to save as file
2) CTRL + L to select path
3) CTRL + C to copy path (et voilà in french) (se acabo in spanish).

Regards,
Luis.
4) Need something after CTRL + C to open the containing folder.
Indeed. Thank you Joe.