Solved

Autohotkey- PDF,XLS and DOC files inside Internet Explorer

Posted on 2009-06-30
1
893 Views
Last Modified: 2013-11-10
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
Comment
Question by:awesomejohn19
1 Comment
 
LVL 20

Accepted Solution

by:
alainbryden earned 500 total points
ID: 24898962
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now