Jump to content

checking if a file is loaded


stafe
 Share

Recommended Posts

I want to write a script to toggle the opening and closing of a pdf file.

For example if i have a flie called myFile.pdf I want the script to open/load it.  However if myFile.pdf is open then i want the same script to close it. 

Could someone please tell me how I can know if the pdf file is open/loaded?

Thank you 
Simon

Link to comment
Share on other sites

Obviously you are opening the file in Adobe Reader, but what are you reading it with?

Are you continuing on to another pdf file or doing some other process, or are you wanting to close both Adobe Reader and your script after reading it with your eyes, etc?

If the latter, then have a look at the ProcessClose function and other related functions perhaps.

You may also benefit from looking at WinExists and related.

But really from your description neither JohnOne or I are getting much understanding of your overall purpose, so it is hard to help.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

I don't have acrobat to test, I use foxit reader, but here's how easy it is with that.

If WinExists("My_File_Name") Then
    ; The file is open in foxit reader
    Exit
EndIf

ShellExecute("My_File_Name.pdf")

Try it with acrobat.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...