ConstantineGeorgantzas Posted July 23, 2007 Share Posted July 23, 2007 I can only get Run( ) to open applications like calculator and notepad. I need to get Run( ) to open Adobe Acrobat, but it does not work. I'm using AutoItSetOption("WinTitleMatchMode",2), but Run('Adobe Acrobat') is not working. Link to comment Share on other sites More sharing options...
Administrators Jon Posted July 23, 2007 Administrators Share Posted July 23, 2007 I can only get Run( ) to open applications like calculator and notepad. I need to get Run( ) to open Adobe Acrobat, but it does not work. I'm using AutoItSetOption("WinTitleMatchMode",2), but Run('Adobe Acrobat') is not working.Do you mean you want to run a .pdf file? Use ShellExecute() for that Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
Administrators Jon Posted July 23, 2007 Administrators Share Posted July 23, 2007 Or Run("C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe") Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
Developers Jos Posted July 23, 2007 Developers Share Posted July 23, 2007 I can only get Run( ) to open applications like calculator and notepad. I need to get Run( ) to open Adobe Acrobat, but it does not work. I'm using AutoItSetOption("WinTitleMatchMode",2), but Run('Adobe Acrobat') is not working.You need to specify the exact programname to execute including the Path when its not in the searchpath. eg: Run(@ProgramFilesDir & "\Adobe\Reader 8.0\Reader\AcroRd32.exe") SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ConstantineGeorgantzas Posted July 24, 2007 Author Share Posted July 24, 2007 You need to specify the exact programname to execute including the Path when its not in the searchpath. eg: Run(@ProgramFilesDir & "\Adobe\Reader 8.0\Reader\AcroRd32.exe") I don't understand macros, like the @PRogramFilesDir you used. Where can I read up on them. (I am an absolute beginner.) Or perhaps you have a nice succinct explanation. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 24, 2007 Developers Share Posted July 24, 2007 I don't understand macros, like the @PRogramFilesDir you used. Where can I read up on them. (I am an absolute beginner.)Or perhaps you have a nice succinct explanation.The Helpfile is your friend for checking on these and all other keywords/functions/macros and UDF's I would recommend loading SciTE4AutoIt3 (see my sig) and them open the script in SciTE.All you need to do is put you cursor on the "word" you want to search the helpfile on and press F1 ... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Richard Robertson Posted July 24, 2007 Share Posted July 24, 2007 The help file is in the folder you installed or extracted AutoIt to. Read up, and enjoy. Even those of us who have used AutoIt for a while will still check the help file sometimes. Also, I always forget where it is, but look for AutoIt 1-2-3 (I think?) on the forum. Link to comment Share on other sites More sharing options...
blaze451 Posted July 24, 2007 Share Posted July 24, 2007 Hi,I'm a beginner to and have found the AutoIT.chm file included with AutoIT and excellent source for help.BTW @ProgramFilesDir means "path to Program Files folder", useful in cases where its not always in the same locationI don't understand macros, like the @PRogramFilesDir you used. Where can I read up on them. (I am an absolute beginner.)Or perhaps you have a nice succinct explanation. Link to comment Share on other sites More sharing options...
ConstantineGeorgantzas Posted July 24, 2007 Author Share Posted July 24, 2007 Or Run("C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe")In Run("C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe") the "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe" must be the name of a file, right? With the Run() function here are you mentioning both the program and the file?If run is used to only open files how come it can open programs like notepad and not Adobe? Link to comment Share on other sites More sharing options...
RDSchaefer Posted July 25, 2007 Share Posted July 25, 2007 Can the same construction be used to get to any other file. For instance, does @DocumentsFile or something like that take you to your document's folder. Or more specifically, for example, can something like @FreshmanDocumentsFile take you to your folder for the documents you used to store files as a freshman?Here is where we need that qoute about a certain level of competency (or something like that)!Did you find @FreshmanDocumentsFile in the help file? No, you didn't. Have you ever looked in the Documents and Settings folder in Explorer? There is a sub-folder for every user. @MyDocumentsDir contains the path to YOUR My Documents folder.Ralph Link to comment Share on other sites More sharing options...
GEOSoft Posted July 25, 2007 Share Posted July 25, 2007 (edited) Can the same construction be used to get to any other file. For instance, does @DocumentsFile or something like that take you to your document's folder. Or more specifically, for example, can something like @FreshmanDocumentsFile take you to your folder for the documents you used to store files as a freshman?A quick look at the AutoIt help file under Macros will give you the list. Or follow the OnLine help link in my sig to get the same information. Edited July 25, 2007 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
ConstantineGeorgantzas Posted July 25, 2007 Author Share Posted July 25, 2007 Here is where we need that qoute about a certain level of competency (or something like that)!Did you find @FreshmanDocumentsFile in the help file? No, you didn't. Have you ever looked in the Documents and Settings folder in Explorer? There is a sub-folder for every user. @MyDocumentsDir contains the path to YOUR My Documents folder.RalphOf course it was not in the help file. I was just thinking of constructing macros based of the way the @MyDocumentsDir macro looks. I was thinking perhaps such a process could resemble the construction of a user function or the defining of a variable. I guess this is not the case. Link to comment Share on other sites More sharing options...
Bert Posted July 25, 2007 Share Posted July 25, 2007 The helpfile is pretty complete, and only rarely is a error found in it. A better way to run a app is to use ShellExecute. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
ConstantineGeorgantzas Posted July 25, 2007 Author Share Posted July 25, 2007 The helpfile is pretty complete, and only rarely is a error found in it. A better way to run a app is to use ShellExecute.Which macro should I use to access my companies directory using ShellExecute? Link to comment Share on other sites More sharing options...
ConstantineGeorgantzas Posted July 25, 2007 Author Share Posted July 25, 2007 I finally opened Adobe with this: Run("C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe") This is nice, but what I really need to do is open and compress one file after another from a long list of files in a temp folder. I've already written the code to compress, save, and close a file, but I have no I idea how to extract file from the temp file one after the other to run the script I've already written. Opening a file would have opened acrobat anyway. Link to comment Share on other sites More sharing options...
GEOSoft Posted July 25, 2007 Share Posted July 25, 2007 (edited) I finally opened Adobe with this: Run("C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe") This is nice, but what I really need to do is open and compress one file after another from a long list of files in a temp folder. I've already written the code to compress, save, and close a file, but I have no I idea how to extract file from the temp file one after the other to run the script I've already written. Opening a file would have opened acrobat anyway.If you know The parameters for using Acrobat.exe to compress a file then take a look at ShellExecuteWait() Write the file list to an array ($f_Array) and put it all in a loop. For $I = 1 To Ubound($f_Array)-1 ShellExecuteWait("Path to acrobat.exe", "parameters including $f_Array[$I]" Next You may have to look in the registry to see if there is a verb for the compress function. If there is then it's much simpler. For $I = 1 To Ubound($F_Array)-1 ShellExecuteWait($F_Array[$I],"","","Compress") FileCopy($F_Array[$I], "Old File Path & Name", 1) Next EDIT: Syntax Error Edited July 25, 2007 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
ConstantineGeorgantzas Posted July 26, 2007 Author Share Posted July 26, 2007 Thank you very much for your fresh perspective. I have some questions: "Write the file list to an array ($f_Array) and put it all in a loop." -How do I do this? $f_Array[0]=file1, $f_Array[1]=file2...? It is a long list of 14000 files. Where can I find the parameters for acrobat? This just opens each file one at a time, right? But I don't understand how is involved. For $I = 1 To Ubound($f_Array)-1 ShellExecuteWait("Path to acrobat.exe", "parameters including $f_Array[$I]" Next "You may have to look in the registry to see if there is a verb for the compress function." - Where is this registry? If I use the code below do I need to use the code above? This code seems to compress the files without opening a window. For $I = 1 To Ubound($F_Array)-1 ShellExecuteWait($F_Array[$I],"","","Compress") FileCopy($F_Array[$I], "Old File Path & Name", 1) Next Thanks again Link to comment Share on other sites More sharing options...
ReFran Posted July 26, 2007 Share Posted July 26, 2007 (edited) "You may have to look in the registry to see if there is a verb for the compress function."There is no such a verb and also Acrobat actice x (DLL) and Adobe-JS don't support it on a easy way, because compression is normaly done direct from the PDF print driver.With the freeware command line tool PDFTk. exe you can compress PDFs easy. That's a well known and easy to handle command-line tool, so don't be afraid to downlod and use it. I tested the compression and it gave me better results as Adobe Acrobat.http://www.pdfhacks.com/pdftk/To work with that tool, based on that what was tooled before, you may do followingDIM $pdft = C:\.......\PDFtk.exe ;full path to pdftkthen use something like thisRun(@ComSpec & " /c " &$pdftk&" "&$fileNameIN &" output " &$fileNameOut &" compress","",@SW_HIDE,$STDERR_CHILD + $STDOUT_CHILD)Where $fileNameIn is the variable for the Input PDF; $fileNameOut that one for the output PDF. Both names can also be the same.Good luck, Reinhard Edited July 26, 2007 by ReFran Link to comment Share on other sites More sharing options...
GEOSoft Posted July 26, 2007 Share Posted July 26, 2007 "You may have to look in the registry to see if there is a verb for the compress function."There is no such a verb and also Acrobat actice x (DLL) and Adobe-JS don't support it on a easy way, because compression is normaly done direct from the PDF print driver.With the freeware command line tool PDFTk. exe you can compress PDFs easy. That's a well known and easy to handle command-line tool, so don't be afraid to downlod and use it. I tested the compression and it gave me better results as Adobe Acrobat.http://www.pdfhacks.com/pdftk/To work with that tool, based on that what was tooled before, you may do followingDIM $pdft = C:\.......\PDFtk.exe ;full path to pdftkthen use something like thisRun(@ComSpec & " /c " &$pdftk&" "&$fileNameIN &" output " &$fileNameOut &" compress","",@SW_HIDE,$STDERR_CHILD + $STDOUT_CHILD)Where $fileNameIn is the variable for the Input PDF; $fileNameOut that one for the output PDF. Both names can also be the same.Good luck, ReinhardDIM $pdft = C:\.......\PDFtk.exeRun(@ComSpec & " /c " &$pdftkEither $pdft or $pdftk in both places George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
ReFran Posted July 26, 2007 Share Posted July 26, 2007 Either $pdft or $pdftk in both placesIf I write slower, I prefer $pdftk ;-)Thanks, Reinhard Link to comment Share on other sites More sharing options...
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