Sign in to follow this  
Followers 0
End_of_Eternity

Noob Questioon Regarding Input Boxes

6 posts in this topic

I found out about autoit on shellcity.net. Pretty cool concept IMHO, although I did hope it would provide a GUI. But anyways, even without a GUI, I find this a potentially very useful tool.

Now my end aim is to create a method for easy conversion of DVDs into dynamic MKV files (MKV is a container format that contain several audio, video and even subtitle streams in one file, it also supports other cool stuff like chapters and detailed comments and metadata).

The problem is that I have to use several progams to accomplish this:

DvD Decrypter for getting an IFO rip on my HDD

AutoGK for converting MPEG2 to Xvid

BeSweetGUI for conversion of AC3 to ogg

Subrip for .srt files

mkvmergeGUI for muxing the MKV file and chapter manipulation

I am hoping to eventually build a script that automate all these functions, however my guess I'll need to make a mini application as there a lot choices involved in the conversion process that need to be taken in account for (which segments to rip, which audio track to convert, labelling chapters).

But I am starting from the basics and trying to get basic scripting funcionality to work. I went through the tutorials and I am trying to exapnd on them, but I am sort of stuck.

I decided to extend the notepade tutorial and tried to get the autoit script to save a an rtf file with the words "hello world" via notepad. But I always get stuck at the "Save as" dialouge. No matter what I try.

Here is my script:

Run("notepad.exe")

WinWaitActive("Untitled - Notepad")

Send("Hello World!")

WinClose("Untitled - Notepad")

WinWaitActive("Notepad", "The text in the Untitled file has changed")

Send("!y")

WinWaitActive("Notepad", "Save As")

ControlClick ("Save As", "", "1148")

Send("hello.rtf")

Send("!s")

Now I tried several variations to this script including using the ControlFocus function and using only a send fuction after the "WinWaitActive("Notepad", "Save As")" bit. But to no luck. I also tried substituting the 1148 bit with "Edit1" that's what the info viewer called the input area where you decided the name of the file to be saved.

Can someone please help me and show me how to write a proper script that would make notepade save the text file with my choice of extension and name?

P.S. While I am into tech (I can build you a PC with no problems) and software, my programming skills are limited to very basic HTML. Though I would love to learn more. Before using autoit I though programming was quite a bit harder,

Thank you for your time!

Share this post


Link to post
Share on other sites



Might be easier to do something like this?

$SomeText = 'I want to save this to a txt file'
$MyFileAndExtension = @DesktopDir & '\SomeFileName.txt'
FileWrite($MyFileAndExtension, $SomeText)
Run('Notepad.exe ' & $MyFileAndExtension)


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Well maybe it is, I don't know the whole concept is pretty new for me. But I would like to find a method to save the file my way. This is because a lot of the application involved in making the MKV file will have these sort of input boxes and I need to know how deal wiht them.

Share this post


Link to post
Share on other sites

Well maybe it is, I don't know the whole concept is pretty new for me. But I would like to find a method to save the file my way. This is because a lot of the application involved in making the MKV file will have these sort of input boxes and I need to know how deal wiht them.

You asked for the "proper" way to save a txt file with the extension you want. So why would you still want to do it "your" way?

I'm not saying by anymeans that it's the proper way, but much more effective, and gives you control to name the extension to what you want.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

As I stated in my first post, my end aim is to build a script for converting DVD to an MVK container. In order to do this I have to run a whole range of GUI apps throughtout the whole process. This is annoying as there are gaps between various sub sections of the process. So while the the MPEG2 stream is still not converted, I can't mux it into MKV. So the only way to do would be to use mkvmergeGUI. And if I want to make a script that that automatically muxes several streams into a MKV file I can't use the method you described in your post.

Okay, my method is the incorrect way to do it. Could someone please explain how to accomplish my aim using the incorrect method? I am not a programmer and I am just learning the things I need to build my script and I would appreciate if someone would help me with specifically the issue I mentioned in my first post.

Share this post


Link to post
Share on other sites

As I stated in my first post, my end aim is to build a script for converting DVD to an MVK container. In order to do this I have to run a whole range of GUI apps throughtout the whole process. This is annoying as there are gaps between various sub sections of the process. So while the the MPEG2 stream is still not converted, I can't mux it into MKV. So the only way to do would be to use mkvmergeGUI. And if I want to make a script that that automatically muxes several streams into a MKV file I can't use the method you described in your post.

Okay, my method is the incorrect way to do it. Could someone please explain how to accomplish my aim using the incorrect method? I am not a programmer and I am just learning the things I need to build my script and I would appreciate if someone would help me with specifically the issue I mentioned in my first post.

Your concept sounds intriguing, but without the tools to work with, and the understanding of how they work, I'm afraid I won't be of much help. I was only replying to the saving issue. I hope someone else has done something like this and knows which direction you need to go to achieve your goal.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
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
Sign in to follow this  
Followers 0