stafe Posted January 10, 2016 Posted January 10, 2016 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
JohnOne Posted January 10, 2016 Posted January 10, 2016 You will need to help yourself a little more, by saying exactly what you mean by "open/loaded".Be very specific. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
stafe Posted January 10, 2016 Author Posted January 10, 2016 Thanks,What I mean is to open the file on the screen for reading with acrobat. Then after I have read the file I want to execute the same script to close it.Simon
TheSaint Posted January 10, 2016 Posted January 10, 2016 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)
JohnOne Posted January 10, 2016 Posted January 10, 2016 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.
JohnOne Posted January 10, 2016 Posted January 10, 2016 Just to be clear.If WinExists("My_File_Name") Then WinClose("My_File_Name") Exit EndIf ShellExecute("My_File_Name.pdf") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
stafe Posted January 10, 2016 Author Posted January 10, 2016 Thank youThat works perfectly, It is precisely what I wanted.Simon
JohnOne Posted January 10, 2016 Posted January 10, 2016 Ace AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now