Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 940
  • Last Modified:

Autohotkey- PDF,XLS and DOC files inside Internet Explorer

When you use the Active Window Info that comes with Autohotkey, ahk_class for any file opened inside Internet Explorer remains as IE frame. For example, if we open a pdf file inside internet explorer it still has a ahk_class of IE Frame. However I need autohotkey to understand if it is a web page, pdf file, doc or xls in order to print each one of them in a certain way (this is because all software (word, excel, adobe) has different print shorcuts or different print dialogue boxes). So I found a solution for this. The autohotkey grabs the title and searches if there is a ".pdf", "xls"..... in the title. And then decides how to proceed with printing. But sometimes because the document names or webpage titles are too long, the title is grabbed partially therefore it does not contain the file extension in the page title. in those cases my solution does not work. I was wondering if anyone has a better way to do this.

thanks
0
awesomejohn19
Asked:
awesomejohn19
1 Solution
 
alainbrydenCommented:
Don't read the page title (which gets truncated). Read the page URL.

Also, if you like, instead of searching for whether there is a ".pdf" in the title, just check the last 4 characters of the URL, and see if it matches with ".pdf", ".xls" etc, or if the last 5 match ".xlsx", ".docx", etc.

If you want further help with this just post your code.

--
Alain
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now