Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

perl or python or autohotkey

Status
Not open for further replies.

rk_19

Structural
Aug 7, 2012
71
Hi, i wish to automate windows applications with a script. which one is best to learn - perl or python. My plan is to
1. automate windows applications, eg; invoke a software and make it run with certain inputs
2. read/write/replace text at specific locations inside the file
3. built small gui's
- no intention to work on web programing,

personally for my programing, fortran is ok, and i use it very often for engg calcs - if i could avoid perl/python and do above items with autohotkey, i rpefer that
i am new to perl,python, autohotkey, so wish to know which one wud b the best

thanks
 
Replies continue below

Recommended for you

You might also want to look into Pulover's Macro Creator. It is open source and works very well. I have only used it to edit PDF files, ie make the same change to 100+ pages, but I believe you can use it to do what you are asking.

 
Why not VBA.

Included with all MS Office products and made to do exactly what you say you want to do.
 
MintJulep, VBA is great for doing stuff in whatever microsoft platform you're using.

If you're wanting to manipulate files and content (across different platforms, not just Office) then it probably isn't necessarily the best for that task.
An example: Outlook does not provide the same FileDialog interface that Word and Excel do, thus automating the storage of emails in Outlook via VBA is much harder than it needs to be.

The example of read / write / replace text inside MS Word files is relevant though, its much easier to do that inside Word than it is via 3rd party scripting functions.

EDMS Australia
 
hi JG2828, is it possible to include bit of programming into macro recorder - ie; i wish to run a 3rd party software - after the first run (invoked by the the macro), the macro should be capable of reading the output text file, search for some specific values in it, do some calculations with them and then edit the input file (for 3rd party) based on some calculations, followed by rerun of the 3rd party software. this should happen till particular criteria is met. i wish to know whether macro recorder can do it...i know that perl can do it because i have seen people do it, just not sure whether perl/python/autohot key. personally, i use fortran for general engineering program, so wish to learn a new lang/scripting which has definite advantage over fortran. (as i said, not planing for web/game developemnt)
 
Hi rkr19,
Macrocreator is actually based on Autohotkey, like a GUI interface for Autohotkey. I think it can do all you are asking, but I don't know for sure. I have never attempted anything that complex. Download it for free and give it a try.
 
ShortKey is a utility that inserts itself after the keyboard and before everything else, enables you to expand keystrokes anytime. Might be worth looking at. The underlying programming is not that hard, just monitor the keyboard interrupt.
 
I would recommend Python, which has many 3rd party libraries and is good at OS automation.
 
AutoIt is my preference. There are a lot of examples already available and the syntax is pretty simple, but only for Windows. It has an active forum and a tremendous feature list. It would be easy enough to convert program logic from AutoIt to any other language
Next in line would be VBA, but it is only when it's the only alternative. It does have much better integration with the Office applications, but each application has a unique set of APIs, some that should be similar, but aren't.

Python is an interesting alternative, but it has a bunch of libraries coming from all over the place. It's popular among programmers and it's multiplatform
 
@3DDave, any book you recommend for Autoit - or is it just forums?
 
The docs that come with it are pretty good. I just read through the available built-in functions and the examples. People are doing amazing things on the forums, so if you need inspiration, there it is. The syntax is straightforward and it has plenty of specialized functions to work with applications that aren't welcoming.

My favorite, though available in other languages, is the ability to read and write the Windows text clipboard - so copy, run the program to transform the data, and paste. But AutoIt can be compiled, so it becomes copy, double-click program icon, paste.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor