Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Gui to use ImgBurn in command line


  • Please log in to reply
18 replies to this topic
Da Rossa
  • Members
  • 401 posts
  • Last active: Mar 26 2016 10:20 AM
  • Joined: 06 Dec 2007
Hi folks how u doin? :)

Here is the deal: I decided that ImgBurn is the best, at least for me, CD/DVD Burning software. And, to make things even easier and reduce the # of user interventions needed, I learnt how to use (for some basic commands) the command line to operate the program.

So I type in CMD something like:

imgburn /dest G /speed 4x /verify yes /start /log "IBb___%CurrentDateTime%.log" /mode build /src "D:\go" /volumelabel "label_here"



As you can see, I call the imgburn program and use some switches, which, for a burning app, are pretty intuitive. for example: /dest G means that the destination drive is G:, /speed 4x is the assigned speed, the /volumelabel thing wirtes the disc label and so on.
one of the most important parts is the /mode build, which means that I'm talking about a disc in which I'm going to burn some individual files, but not an image file.

So, using the nicest gui solution (Rajat's SmartGUI Creator), I "painted" this sweet picture:
Posted Image
But it is only sweet and nothing else. That is a gui I created to antecipate the commands I would type in the command prompt. So, looking at the pic, if I choose speed = 4x, mark the options to start but not verify, select the mode = build, type "my disc label" in the label field, then write, at the bigger box in the right, the file list to be burnt, such as:

E:\Desktop\Direito Penal 25-02-10.txt
E:\Desktop\e-mails da galera da social.txt
E:\Desktop\iburn.jpg
E:\Desktop\músicas-da-biliboard.jpg



Then the result would be ahk creating a quick bat file with the command, corresponding to the specifications above:

imgburn /dest G /speed 4x /start /log "IBb___%CurrentDateTime%.log" /mode build /src "!!!" /volumelabel "my disc label"



So, lets stick to the two main questions for now:
1- please tell me just one example of how to give that gui the proper functionality and the rest I'll learn by example?
2- How to have the filelist above to be added as the source files (files to burn, in /src)?

p.s. you might be asking why I'm doing this, why don't I stick to ImgBurn GUI itself and use the mousebuttons to do it. I tested and this, when properly done and configured, can lead me to the desired result with significant less clicks, plus the ability to add the label more easily and saving the log as I like.

Thanks!

Edit: edited mispelled word above in bold due to the damn hotstrings :D
AHK is perfect.

wooly_sammoth
  • Members
  • 644 posts
  • Last active: Jul 03 2013 08:08 PM
  • Joined: 12 May 2009
OK so the first thing you'll want to do is assign variables to each of the controls in your Gui.

that will look something like this
Gui, Add, Radio, [color=red]vSpeed_2X[/color], 2x
Gui, Add, Radio, [color=red]vSpeed_4x[/color], 4X

Give each of the radio buttons, checkboxes and edit controls a uniquely named variable like the example above.

After the Gui section of your script you should create the code that gets executed when the FIRE! button is pressed. The first line of this should be
Gui, Submit

This will assign a value to each of the variables. For example, a selected radio button will give 1 whereas an unselected on will give 0. Using the variables you can determine which options the user has selected and build your command accordingly.

Hope that makes sense
Any questions just ask :D

Murx
  • Guests
  • Last active:
  • Joined: --
DriveGet, Drives, List, CDROM

Loop, Parse, Drives

   DriveIndex .= A_LoopField "|"

StringReplace, DriveIndex, DriveIndex, |, ||



Gui +OwnDialogs

Gui, Add, DropDownList, x10 y4 w40 vSpeed, 2|4|8||16

Gui, Add, CheckBox, xp+52 yp+6 vCB1 checked, Start

Gui, Add, CheckBox, xp+74 yp vCB2, Verify

Gui, Add, DropDownList, xp-126 yp+24 w98 vMode, Write||Build|Read|Discovery|Verify

Gui, Add, DropDownList, xp+104 yp w98 vDrive,

GuiControl,, Drive, % DriveIndex

Gui, Add, Edit, xp-104 yp+24 w200 h100 ReadOnly -Wrap vFilesToBurn,

Gui, Add, Button, xp+209 yp w60 gSelectFile, Browse

Gui, Add, Edit, xp-209 yp+102 w200 vVolumeLabel, Disc label

Gui, Add, Button, xp+208 yp w60 gFire, Fire!

Gui, Show,, Mr.Burns

Return



SelectFile:

		FileSelectFile, SelectedFile, M13, , Open a file, Text Documents (*.txt; *.doc)

		if SelectedFile =

				Return

		Else

				GuiControl,, FilesToBurn, % SelectedFile

		Return



Fire:

		Gui, Submit, NoHide

		If (CB1 = 1)

			SetStart := "/start"

		If (CB2 = 1)

			SetVerify := "/verify"	

		 MsgBox, imgburn /dest %Drive% /speed %Speed% %SetStart% %SetVerify% /log "%A_Now%.log" /mode %Mode% /src "%FilesToBurn%" /volumelabel "%VolumeLabel%"

		Return
Not tested.

Da Rossa
  • Members
  • 401 posts
  • Last active: Mar 26 2016 10:20 AM
  • Joined: 06 Dec 2007
Ok, here we go.

Very nice gui, but the idea is that it should not have drop-down menus as they're nasty... :p

So here is the gui I created:

GUI

and that text field did not work to add multiple-line texts, which is necessary to add a filelist, like:

D:\site\5 semestre\1 Direito do Trabalho 1\Direito do Trabalho 01-03-10.docx
D:\site\5 semestre\1 Direito do Trabalho 1\Direito do Trabalho 03-03-10.docx
D:\site\5 semestre\1 Direito do Trabalho 1\Direito do Trabalho 22-2-10.docx
D:\site\5 semestre\1 Direito do Trabalho 1\Direito do Trabalho 24-02-10.docx



...and I have to click the browse button, instead of inputing the filepaths directly through copy-paste...

also, there seems to be a problem with the filepath syntax, prolly in the variable "filestoburn". Note that the files are more likely to have spaces, but you already put inside quotation marks didn't you?

And yes, I changed from "msgbox" to "run" so it could work :D

But you seem to be in the right way!
AHK is perfect.

Da Rossa
  • Members
  • 401 posts
  • Last active: Mar 26 2016 10:20 AM
  • Joined: 06 Dec 2007
Err sorry, I forgot to upload the .ahk file with the GUI.

Here it is: <!-- m -->http://notasdeaula.org/imgburn-gui.ahk<!-- m -->

Or

Gui, Add, Edit, x296 y40 w370 h190 , Filelist
Gui, Add, Button, x596 y70 w-794 h-116 , +
Gui, Add, DropDownList, x166 y-48 w-70 h108 , DropDownList
Gui, Add, Radio, x746 y-266 w-480 h836 , 2x
Gui, Add, Radio, x56 y70 w60 h20 , 4x
Gui, Add, Radio, x56 y130 w60 h20 , 16x
Gui, Add, Radio, x56 y100 w60 h20 , 8x
Gui, Add, GroupBox, x36 y20 w90 h140 , Speeds
Gui, Add, Text, x146 y250 w70 h20 , Destiny: G:
Gui, Add, CheckBox, x146 y60 w60 h30 , Start
Gui, Add, CheckBox, x146 y90 w60 h30 , Verify
Gui, Add, GroupBox, x136 y20 w140 h140 , Options
Gui, Add, GroupBox, x286 y20 w390 h260 , Files
Gui, Add, Text, x146 y130 w100 h20 , %CurrentDateTime%
Gui, Add, GroupBox, x36 y170 w240 h110 , Modes
Gui, Add, Radio, x-74 y-80 w100 h100 , Radio
Gui, Add, Radio, x-304 y-134 w230 h84 , Radio
Gui, Add, Radio, x-310 y-134 w346 h154 , Radio
Gui, Add, Radio, x46 y190 w70 h20 , Write
Gui, Add, Radio, x46 y210 w70 h20 , Build
Gui, Add, Radio, x46 y230 w70 h20 , Read
Gui, Add, Radio, x146 y190 w70 h20 , Discovery
Gui, Add, Radio, x146 y210 w70 h20 , Verify
Gui, Add, Radio, x56 y40 w60 h20 , 2x
Gui, Add, Button, x566 y240 w100 h30 , FIRE!
Gui, Font, S10 CDefault, Verdana
Gui, Add, Edit, x296 y240 w250 h30 , Disc label
Gui, Font, S10 CDefault, Verdana
; Generated using SmartGUI Creator 4.0
Gui, Show, x230 y544 h304 w719, ImgBurn
Return

GuiClose:
ExitApp

AHK is perfect.

Da Rossa
  • Members
  • 401 posts
  • Last active: Mar 26 2016 10:20 AM
  • Joined: 06 Dec 2007
anyone?
AHK is perfect.

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
Whats the question :?:

GuestMan
  • Guests
  • Last active:
  • Joined: --
No question here...
The guy just wants someone to do everything for him.

Da Rossa
  • Members
  • 401 posts
  • Last active: Mar 26 2016 10:20 AM
  • Joined: 06 Dec 2007
Yeah, it's very nice when an anonymous guest come to an important topic to say stupid things without having the face to identify himself.

Can't you read, mr. GuestMan?

So, lets stick to the two main questions for now:
1- please tell me just one example of how to give that gui the proper functionality and the rest I'll learn by example?
2- How to have the filelist above to be added as the source files (files to burn, in /src)?



Did you read the expression "just one example"?
AHK is perfect.

wooly_sammoth
  • Members
  • 644 posts
  • Last active: Jul 03 2013 08:08 PM
  • Joined: 12 May 2009
Have you tried adding variables to your Gui as I suggested in my post?

Follow the example I gave you to give your Gui functionality

Da Rossa
  • Members
  • 401 posts
  • Last active: Mar 26 2016 10:20 AM
  • Joined: 06 Dec 2007
One hundred apologies, but I didn't actually notice your first post, wooly_sammoth. Perhaps I saw the almost-done code by Murx and got excited.

So I followed your tips, along with Murx's example to fill the gaps found by my lousy mind.

To make it neater, I ended up with this code:

#SingleInstance force 

Gui, Add, GroupBox, x286 y20 w390 h260 , Files
Gui, Add, Edit, x296 y40 w370 h190 vFilelist, Filelist

Gui, Add, GroupBox, x36 y20 w90 h140 , Speeds
Gui, Add, Radio, x56 y40 w60 h20 vSpeed2x, 2x
Gui, Add, Radio, x56 y70 w60 h20 vSpeed4x, 4x
Gui, Add, Radio, x56 y100 w60 h20 vSpeed8x, 8x
Gui, Add, Radio, x56 y130 w60 h20 vSpeed16x, 16x

Gui, Add, GroupBox, x136 y20 w140 h140 , Options
Gui, Add, CheckBox, x146 y60 w60 h30 vStart, Start
Gui, Add, CheckBox, x146 y90 w60 h30 vErify, Verify

Gui, Add, GroupBox, x36 y170 w240 h85 , Modes
Gui, Add, Radio, x46 y190 w70 h20 vWrite, Write
Gui, Add, Radio, x46 y210 w70 h20 vBuild, Build
Gui, Add, Radio, x46 y230 w70 h20 vRead, Read
Gui, Add, Radio, x146 y190 w70 h20 vDiscovery, Discovery
Gui, Add, Radio, x146 y210 w70 h20 vErificar, Verify

Gui, Add, Text, x146 y260 w70 h20 , Destiny: G:

Gui, Add, Button, x566 y240 w100 h30 , Fire
Gui, Font, S10 CDefault, Verdana
Gui, Add, Edit, x296 y240 w250 h30 vLabel, Disc label
Gui, Font, S10 CDefault, Verdana
; Generated using SmartGUI Creator 4.0
Gui, Show, x230 y544 h304 w719, ImgBurn
Return


Fire:
	Gui, Submit, NoHide
	If (vStart = 1)
		SetStart := "/start"
	If (vErify = 1)
		SetVerify := "/verify"	
	Msgbox, imgburn
	return
	
GuiClose:
ExitApp



...which has attributed the variables to the edit, checkbox and radio controls and tried to give functionality to two of the checkboxes (almost like Murx's example). The problem is that clicking the "Fire" button does nothing. I was expecting the simple msgbox with the word "imgburn".

Once I have the Fire button work, I may correct the other things, with some help.
AHK is perfect.

Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009
There is no 'linkage' between the button and the fire routine.
Right now the button on the gui is like a doorbell with wires attached.
Go back and read the description about button (all the way to the "checkbox" subtitle.

<!-- m -->http://www.autohotke... ... htm#Button<!-- m -->

While that section, take the time to understand what two ways the button can be linked to the code.
Hint: one method uses the word 'explicit' the other usues the word 'automatic'.

I could easily edit your code for you, or write the answer here.
But if you are willing to go read the section and understand it, you won't easily forget it.
You'll also see that the docs are written very well.

And I suspect you'll find, you would rather go to the docs first because you can find the answer faster.

GuestMan
  • Guests
  • Last active:
  • Joined: --

come to an important topic to say stupid things

Pathetic...
This task is ridiculously easy.Any noob can do it just by reading the help file and testing a few lines of code.
Pathetic...
Do something yourself for once.

Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009

come to an important topic to say stupid things

Pathetic...
This task is ridiculously easy.Any noob can do it just by reading the help file and testing a few lines of code.
Pathetic...
Do something yourself for once.

Hey GuestMan,
He's a newbie, so what?!
I just looked up maybe 8 threads you've replied to, this is the only one where you are non-helpful.

Why are you being a pain? Or more to the point, please stop being a pain.

GuestMan
  • Guests
  • Last active:
  • Joined: --
I simply don't like parasites.
I was a very active supporter until this forum became infested by parasites.

And he is really a newbie, a professional one, since 2007.