AutoHotkey Community

It is currently May 26th, 2012, 6:27 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 40 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: June 7th, 2009, 5:07 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
Can this file be made into an .exe? And can you please critique it and advise. I would really like to make an executable that works like this, but I'm not sure it's possible based on this, because it's a script that writes another script, and subsequently requires the AHK.exe, i guess. Pls. advise.

Check out the pics below to understand what I'm doing here. The objective is to make a set of moveable buttons based on a list of speakers, which would then send timestamped strings to a logfile. You place the buttons in the semblance of a seating chart, and then during proceedings you click the buttons for each speaker to log them. This can be very handy for large meetings etc. You can even superimpose these buttons over an existant seating chart if one exists.

If a speaker list doesn't exist, the first part of this script is to create one. Then you customize it, restart, and select the list you've created. This script will then generate and execute another script that will create a set of GUIs based on the list, each one with one button and nothing else. You arrange the GUIs in a semblance of a seating chart based on the location of the actual speakers and the room layout. When a button for a speaker is pressed, that speaker is logged, and the log can then be the basis for a transcript later. Regard the pics:

Image

When the buttons are first created, at present they are all the same size and location, as above, and you then move/resize them. (I've made a scrap of code to get and save all their positions, but it's not in this example.) Any item in the speaker list containing a "@" symbol generates no button, but just a gui. They can then be moved to provide the semblance of a seating chart, including tables or a lectern, whatever. Regard below:

Image

This is after they have been moved to suit my purposes. And the text to the left of them is the speaker log displayed in Notepad++, which is the default viewer in this script. You can just change that to Notepad in the code if you like I guess.

The script follows:

Code:
Gizmo = %A_MM%-%A_DD%-txt


FileSelectFile,Gomi,,,Select a config file for this event`, or press ESCAPE to create one,*.txt

If Gomi = ;User has selected a blank template

{
   Gomi = %A_Desktop%\00Speakerlist%A_MM%-%A_DD%-%A_Hour%-%A_Min%.txt
   Msgbox,%Gomi% is your speaker list.  Start by changing the examples to actual speakers.  You may add as many as you wish.  Make them one name per line only. Numbers and Letters only.  Periods are allowed. You may always revise the list and restart the program again too.

   FileAppend,Speaker 1`r`nSpeaker 2 `r`nSpeaker 3 `r`nSpeaker 4 `r`n@Table,%Gomi% ;Creates an unnamed speaker list

   Run Notepad.exe %Gomi%


   Msgbox,0,Press Ctrl-C to copy filepath to your clipboard and then restart,%Gomi%
   Exitapp
}

else

SplitPath,Gomi,,Omig,,Gimo
SetWorkingDir,%Omig%\


IfExist,%Gimo%.ahk
FileDelete,%Gimo%.ahk
FileAppend,
(
`;This is where any other preliminary text for the script we're going to create
)%Gimo%-1.txt

Loop
   {
   FileReadLine,Boy,%Gomi%,%A_Index%
   If Errorlevel
   Break
   ;MsgBox,%A_Index% -- %Boy%
   Goy = %Boy%
   Boy = %Goy%
   Stringreplace,Boy,Boy,%A_Space%,_
      {
      If A_Index = 1
         {
         FileAppend,
         (
         Gui,+Resize -MaximizeBox +ToolWindow +AlwaysonTop
         Gui,Margin,0,0

         ),%Gimo%-1.txt
         }
      Else
         {
         FileAppend,
         (
         Gui,%A_Index%:+Resize -MaximizeBox +ToolWindow +AlwaysonTop
         Gui,%A_Index%:Margin,0,0

         ),%Gimo%-1.txt
         }
      IfInString,Boy,@
         {
         StringReplace,Boy,Boy,@,

         FileAppend,
         (
         Gui,%A_Index%:Add,Text,,%Boy%
         Gui,%A_Index%:Show,,%Boy%


         ),%Gimo%-1.txt
         Topper++
         FileAppend,M%Topper% = %Boy%`r`n,%Gimo%-3.txt
         Continue
         }
      If A_Index = 1
         {
         FileAppend,
            (
         Gui,Add,Button,,%Boy%
         Gui,Show,,%Boy%


            ),%Gimo%-1.txt
         }
      Else
         {
         FileAppend,
            (
         Gui,%A_Index%:Add,Button,,%Boy%
         Gui,%A_Index%:Show,,%Boy%


            ),%Gimo%-1.txt
         }
      If A_Index = 1
         FileAppend,Button%Boy%`:`r`n,%Gimo%-2.txt
      Else
         FileAppend,%A_Index%Button%Boy%`:`r`n,%Gimo%-2.txt
      FileAppend,Fileappend`,``r``n,%Gimo%-2.txt
      FileAppend,`%A_Hour`%``:`%A_Min`%``:`%A_Sec`%`%A_Tab`%%Boy%```:`%A_Space`%`%A_Space`%`,`%A_Desktop`%\%Gizmo%.txt,%Gimo%-2.txt
      FileAppend,`r`nReturn`r`n`r`n,%Gimo%-2.txt
      }
   Topper++
   FileAppend,M%Topper% = %Boy%`r`n,%Gimo%-3.txt
   }
FileAppend,Return`r`n`;----------------------------------------------------- `r`n`r`n,%Gimo%-1.txt
FileAppend,Gizmo = %A_MM%-%A_DD%-txt`r`n,%Gimo%-3.txt
FileAppend,Topper = %Topper%`r`n,%Gimo%-3.txt

FileRead,Nutzy,%Gimo%-2.txt
FileRead,Soupy,%Gimo%-3.txt
FileRead,Groucho,%Gimo%-1.txt
Fileappend,%Soupy%,%Gimo%.ahk
FileAppend,Run D:\Program Files\Notepad++\notepad++.exe `%A_Desktop`%\%Gizmo%.txt`r`n,%Gimo%.ahk
FileAppend,`;-----------------------------------------------------`r`n,%Gimo%.ahk
FileAppend,%Groucho%,%Gimo%.ahk
FileAppend,%Nutzy%,%Gimo%.ahk

FileAppend,`^`+`#Backspace::`r`n,%Gimo%.ahk
FileAppend,Exitapp`r`n,%Gimo%.ahk
FileAppend,Return`r`n,%Gimo%.ahk


Sleep,50
Run D:\Program Files\Notepad++\notepad++.exe %Gimo%.ahk
;Run D:\Program Files\Notepad++\notepad++.exe %Gizmo%.txt
FileDelete,%Gimo%-1.txt
FileDelete,%Gimo%-2.txt
FileDelete,%Gimo%-3.txt


Run %Gimo%.ahk
Return


And here is the speaker list.

Code:
Speaker 1
Speaker 2
Speaker 3
Speaker 4
Speaker 5
Speaker 6
Speaker 7
Speaker 8
Speaker 9
Speaker 10
Chairman
@Table


As you can see, the line that says "@table" creates no button, but is only to make a piece of furniture for the seating chart. :-) And if I haven't been clear enough, you would replace "Speaker #" with a real speaker's name.

Is there a way to make this into an executable, or is there an alternate approach that would allow it? Thanks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 7th, 2009, 6:39 am 
Offline

Joined: November 4th, 2008, 9:23 am
Posts: 1045
I might be missing something, but there seems like there is no need to create an extra AHK file - doing so is overkill. Also, by doing so, this script requires 1) AHK, and 2) AHK to be the program associated with .ahk files.

For example, this script would not run on my comptuer as I don't have ahk files associated with autohotkey - I have them associated with notepad. I have my laptop setup to mimic my flash drive; this way, whether working on my own computer, or another computer, all my programs that I need are on my flash drive, and they behave like they would on my own computer. I need to move my library folder to my flash drive, because right now they get loaded from my My Documents library folder, but that's a story for another day. I have a copy of AHK on my flash drive, and I use a universal bat file to run AHK with the script (it's actual quite nice).

This system allows me to use my scripts on any computer, by running them off my flash drive. I have a partion of my hard drive which I sync with my flash drive. This way, whether on my computer or another computer, everything runs the same way. However, it seems I got sidetracked; sorry about that - back to topic.



So, because your script would have a limited audience if you require AHK to be on the computer and to have .ahk files associated with AHK, instead of creating a .ahk file and running it, why not just save settings to an ini file and load them? Then, create the guis and position them using the settings in the config file. You will still be able to run multiple instances; each will have a tray icon, etc. Also, this way, there is no dependecy on AHK.


I haven't checked the specifics of what you append to the created ahk file, but this is my guess.

1) You create guis; these guis have certain settings
2) You position / resize these guis
3) You give each of the guis a title, and add a button.
4) This button does some action (probably the same action for each button). Since you mentioned a log, this would imply that the button's is to create a "buzzer" / walkie talkie kind of system. You press the button to talk, and it gets loged... Like I said, I only briefly checked the code, so I might be off.

In review, it sounds like a giant loop is what you need. Add some functions to do the different tasks (e.g. create button, setup gui, etc.). Then, there would be a load function, which would perform the tasks that you currently do when creating the other ahk file. This load function would create the guis and handle creation of this system of yours; it would read the settings from a configuration file, and apply them.

_________________
As always, if you have any further questions, don't hesitate to ask.

Add OOP to your scripts via the Class Library. Check out my scripts.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 7th, 2009, 7:05 am 
Offline

Joined: August 13th, 2006, 6:45 am
Posts: 354
Location: Germany
I think, there is a very simple solution:
Code:
Gizmo = %A_MM%-%A_DD%-txt

FileSelectFile,Gomi,,,Select a config file for this event`, or press ESCAPE to create one,*.txt

If Gomi = ;User has selected a blank template

{
   Gomi = %A_Desktop%\00Speakerlist%A_MM%-%A_DD%-%A_Hour%-%A_Min%.txt
   Msgbox,%Gomi% is your speaker list.  Start by changing the examples to actual speakers.  You may add as many as you wish.  Make them one name per line only. Numbers and Letters only.  Periods are allowed. You may always revise the list and restart the program again too.

   FileAppend,Speaker 1`r`nSpeaker 2 `r`nSpeaker 3 `r`nSpeaker 4 `r`n@Table,%Gomi% ;Creates an unnamed speaker list

   Run Notepad.exe %Gomi%


   Msgbox,0,Press Ctrl-C to copy filepath to your clipboard and then restart,%Gomi%
   Exitapp
}

else

SplitPath,Gomi,,Omig,,Gimo
SetWorkingDir,%Omig%\

Loop
   {
   FileReadLine,Boy,%Gomi%,%A_Index%
   If Errorlevel
   Break
   ;MsgBox,%A_Index% -- %Boy%
   Goy = %Boy%
   Boy = %Goy%
   Gui,%A_Index%:+Resize -MaximizeBox +ToolWindow +AlwaysonTop
   Gui,%A_Index%:Margin,0,0
   IfInString,Boy,@
      {
      StringReplace,Boy,Boy,@,
      Gui,%A_Index%:Add,Text,,%Boy%
      Gui,%A_Index%:Show,,%Boy%
      Continue
      }
   Gui,%A_Index%:Add,Button, gButtonSpeaker ,%Boy%
   Gui,%A_Index%:Show,,%Boy%
   Topper++
   M%Topper% = %Boy%
   }
Run D:\Program Files\Notepad++\notepad++.exe %Gimo%.ahk
;Run D:\Program Files\Notepad++\notepad++.exe %Gizmo%.txt
Return

ButtonSpeaker:
FileAppend,% A_Hour ":" A_Min ":" A_Sec A_Tab M%A_Gui% ":  `n", %A_Desktop%\%Gizmo%.txt
return

^+#Backspace::ExitApp


Please try if it does what you expect (I tested it with Notepad as I do not use Notepad++).

Hubert


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 7th, 2009, 7:16 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
animeaime wrote:
this script requires ... AHK to be the program associated with .ahk files.
If it used Run AutoHotkey.exe "File.ahk" instead of Run File.ahk, it would only require the AutoHotkey executable.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 7th, 2009, 8:31 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
hd0202 wrote:
I think, there is a very simple solution:
. . .
Please try if it does what you expect (I tested it with Notepad as I do not use Notepad++).

Hubert


Looks good so far! I am running the .exe presently, and all is well on first try. I'll probably make a few additions to it, but this is fabulous! I see you have stripped out a lot of unnecessary stuff. Sorry it was in there. Now it's Saturday night and I've had me a few pints, but it appears that you have cracked this egg, Hubert.

Another objective is I would like to get and save all GUI positions, once arranged, to a config file -- and the bottom of the speaker list is probably fine for that with a handful of modifications. I may try to do that in the next 72 hrs. or so. :-)


THANK YOU!!!!!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 7th, 2009, 8:43 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
animeaime wrote:
I might be missing something, but there seems like there is no need to create an extra AHK file - doing so is overkill. Also, by doing so, this script requires 1) AHK, and 2) AHK to be the program associated with .ahk files.


Well as it appears Hubert has demonstrated, you are correct. All I did was write a script that would do what I wanted the most direct way I knew of. These parts were what I needed and didn't know:

Code:
ButtonSpeaker:
FileAppend,% A_Hour ":" A_Min ":" A_Sec A_Tab M%A_Gui% ":  `n", %A_Desktop%\%Gizmo%.txt
return


and

Code:
Gui,%A_Index%:Add,Button, gButtonSpeaker ,%Boy%


And I can see I actually asked the right people. :-)
I really appreciate all the useful feedback I've gotten tonight. This script will be tuned up and modded a little bit, but you all have helped immensely.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 8th, 2009, 9:43 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
I have been playing with it some more, and Hubert's improved version has got the right stuff. :-) But I had to put back a couple of things you stripped out.

I've also added the functionality of storing the positions of a set of speakers to the speakerlist, with lines prepended with a $ and of restoring the GUIs to those positions later, using the ^+#m and ^+#l keys, respectively.

I once again ask you would check out my work and tell me how it could be improved. I spent a long time trying to use expressions to perform the ^+#l function but couldn't get it, and wound up using a stringsplit. I really appreciate your contributions, all!

Code:
;This script is meant to generate a set of GUIs to create a seriatim, or a log of speakers, for the purposes of transcription.  One speaker per line,and only use letters, numbers, spaces, and periods. Lines beginning with $ are where the positions of each speaker are stored.  Lines beginning with a pipe symbol (|) are comment lines and are ignored by the script. Pls. try it and report bugs at
;  http://www.autohotkey.com/forum/viewtopic.php?t=45037&start=0&postdays=0&postorder=asc&highlight=

Gizmo = %A_MM%-%A_DD%-txt

FileSelectFile,Gomi,,,Select a config file for this event`, or press ESCAPE to create one,*.txt

If Gomi = ;User has selected a blank template

{
   Gomi = %A_Desktop%\00Speakerlist%A_MM%-%A_DD%-%A_Hour%-%A_Min%.txt
   Msgbox,%Gomi% is your speaker list.  Start by changing the examples to actual speakers.  You may add as many as you wish.  Make them one name per line only. Numbers and Letters only.  Periods are allowed. You may always revise the list and restart the program again too.

   FileAppend,Speaker 1`r`nSpeaker 2 `r`nSpeaker 3 `r`nSpeaker 4 `r`n@Table,%Gomi% ;Creates an unnamed speaker list

   Run Notepad.exe %Gomi%


   Msgbox,0,Press Ctrl-C to copy filepath to your clipboard and then restart,%Gomi%
   Exitapp
}

else

SplitPath,Gomi,,Omig,,Gimo
SetWorkingDir,%Omig%\

Loop
{
   FileReadLine,Boy,%Gomi%,%A_Index%
   If Errorlevel
   Break
   IfInString,Boy,|
   Continue
   IfInString,Boy,$
   Break
   If Boy =
   Continue
   ;MsgBox,%A_Index% -- %Boy%
   Goy = %Boy%
   Boy = %Goy%
   Gui,%A_Index%:+Resize -MaximizeBox +ToolWindow +AlwaysonTop
   Gui,%A_Index%:Margin,0,0
   IfInString,Boy,@
     {
        StringReplace,Boy,Boy,@,
        Gui,%A_Index%:Add,Text,,%Boy%
        Gui,%A_Index%:Show,,%Boy%
        M%A_Index% = %Boy%
        Topper++
        Continue
     }
   Gui,%A_Index%:Add,Button, gButtonSpeaker ,%Boy%
   Gui,%A_Index%:Show,,%Boy%
   Topper++
   M%A_Index% = %Boy%
}
FileAppend,Script started %A_MM%-%A_DD%-%A_Hour%:%A_Min%:%A_Sec%`r`n,%A_Desktop%\%Gizmo%.txt
Run D:\Program Files\Notepad++\notepad++.exe %Gizmo%.txt
Return

ButtonSpeaker:
FileAppend,% A_Hour ":" A_Min ":" A_Sec A_Tab M%A_Gui% ":  `n", %A_Desktop%\%Gizmo%.txt
return

^+#Backspace::Reload
^+#Escape::ExitApp

;-----------------------------------------------------

^+#m::  ;;This Stores the positions of each GUI to the speakerlist in lines prepended with a "$"

Loop,Read,%Gomi%,deleme.txt
{
   If A_LoopReadLine =
   Continue
   IfInString,A_LoopReadLine,|
   Continue
   StringReplace,FancyPants,A_LoopReadLine,`n,,All
   StringReplace,FancyPants,FancyPants,`r,,All
   StringReplace,FancyPants,FancyPants,`,,``,,All
   IfInString,FancyPants,$
   Continue
   FileAppend,%FancyPants%`r`n
}
FileMove,deleme.txt,%Gomi%,1
FileAppend,`r`n,%Gomi%

Loop,%Topper%
{
   Gasser := M%A_Index%
   WinGetpos,xx,yy,ww,hh,%Gasser%
   FileAppend,$%Gasser%`,%xx%`,%yy%`,%ww%`,%hh%`r`n,%Gomi%
}
FileAppend,`r`n,%Gomi%

Run Notepad.exe %Gomi%
Return

^+#l::  ;;This reads all lines prepended with a "$" and moves the GUIs to those positions. 
Loop
{
   FileReadLine,Troy,%Gomi%,%A_Index%
   IfInString,Troy,|
   Continue
   IfInString,Troy,$
      {
      StringSplit,aa,Troy,`,,$
      WinMove,%aa1%,,%aa2%,%aa3%,%aa4%,%aa5%
      }
}
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2009, 2:45 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
Hubert, can I attrib you when I distribute the exe as freeware from my site? Check your PMs pls.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 10th, 2009, 1:02 am 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
I'd go with the following GUI; unfortunately got little spare time to pursue this project but nevertheless it does inspire me - too bad there are some limitations in regard to pictures and transparency, on my system:

Image --> Image
(picture links fixed - July 23, 2011)


Last edited by Drugwash on July 23rd, 2011, 1:44 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 10th, 2009, 8:48 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
Well why can't you post a script then? Or is that just a graphic you made?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 10th, 2009, 11:18 pm 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
I do have a relatively working script but it needs some small fixes. Haven't been able to work on my computer today so it'll take a little while before I post something usable.

Just to clear any misunderstanding: all the script should do is send timestamp and speaker name to the log file, nothing else? That is almost acomplished, but I still need to create the alias layer between variables and actual speaker names as well as the actual names input.

Also, positioning is not very comfortable; I'm still considering the best way of switching "people" around. I'd try drag'n'drop but my prior research on this matter (for another project) is not finished yet.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2009, 12:32 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
Well no, it does more. The first iteration was just a skeleton. Here is my more complete script. It takes times from actual clock time, as well as time in a recording, saving those times as vars that it can use as bookmarks in the recording. And now thanks to D-Man and Tseik's advice, you can Ctrl-click on each speaker to have an alternate text string sent as well. This version will work without Total Recorder installed, but doesn't really provide the functionality I was after without at least some recording application. It could be done with MCI commands, though.

I'd appreciate if you would test it. take a look at the comments for more info about it.

And BTW, the script is designed so you can move the furniture around, resize or reshape it, or add more tables, lecterns, etc. , as well as any of the speakers, so you can accomodate ANY arrangement. Your purposes may be different, but the single long boardroom table is just one of the seating arrangements my script will accommodate. The pretty graphics are nice but I'm more interested in functionality than how it looks. One nice feature about how I've done it also is that you can open a scanned seating chart, or draw one in a graphic app, and superimpose the speakers' GUIs over their location in the graphic.


Code:
Rosie =
nn =

;This script is meant to generate a set of GUIs to create a seriatim, or a log of speakers, for the purposes of transcription.  One speaker per line,and only use letters, numbers, spaces, and periods. Lines beginning with $ are where the positions of each speaker are stored and are automatically generated by moving/resizing the GUIs to resemble a diagram of the room the speakers are located, and then pressing the Save_Config button.  You may then re-use the same speaker list and the "Apply_Config" button to immediately restore the same floor plan. 

;Lines beginning with a pipe symbol (|) are comment lines and are ignored by the script. It is not recommended that you save many comments in the speaker list however. 

;This version is my latest little time-wasting project, a combination of this project with another I have been using as a learning tool here at AHK forums etc.  It is TRC, or Total Recorder Controller.  The basic idea here is to create a seriatim, and essentially link it to the actual recording application.  You must have total recorder installed to use it.  For testing purposes if you like you can just download an evaluation copy.  Each line on the speaker list creates a gui.  When the one button on each gui is pressed, a variable is created which holds the current time in the recording.  When the goto or gotoplay buttons are pressed, you advance backward through these bookmarks and alternately play them back in TR.  The Resume button restarts the recording after doing so. 

;When the Ctrl- button is held down while pressng a GUI button, an alternate string is sent.

;Pls. try it and report bugs at

;  http://www.autohotkey.com/forum/viewtopic.php?t=45037&start=0&postdays=0&postorder=asc&highlight=


FileSelectFile,Gizmo,,,Select a seriatim file for this event`, or press ESCAPE to create one,*.txt

If Gizmo =
Gizmo = %A_MM%-%A_DD%.txt
Else

;MsgBox,You will need to turn on `"append mode under `"Record`/Play`" on the toolbar menu`, and you will also need to select `"show sound image`" either `"in panel`" or `"in separate window.`"  It is presumed that you have a working knowledge of Total Recorder prior to using this.  If so`, now would be a good time to start the recording.  If not`, you should exit this program and go learn your way around TR before trying this.

IfWinExist,ahk_class TotalRecorderWndClass
WinActivate,ahk_class TotalRecorderWndClass

FileSelectFile,Gomi,,,Select a Speaker list for this event`, or press ESCAPE to create one,*.txt

If Gomi = ;User has selected a blank template

{
   Gomi = %A_Desktop%\00Speakerlist%A_MM%%A_DD%%A_Hour%%A_Min%.txt


;   Msgbox,%Gomi% is your speaker list.  Start by changing the examples to your actual speakers.  You may add as many as you wish.  Make them one name per line only. Numbers and Letters only`, no commas`,colons`, semicolons or any other funny business.  Periods are allowed. You may always revise the list and restart the program again too. Pls. note that one called `"table`" has no button and can be shaped and resized to resemble oh, say, a table.  You may create buttonless GUIs for this purpose by prefixing their name with the `"`@`" symbol.

   FileAppend,Speaker 1`r`nSpeaker 2 `r`nSpeaker 3 `r`nSpeaker 4 `r`n@Table,%Gomi% ;Creates a generic speaker list


   Msgbox,0,Press Ctrl-C to copy filepath to your clipboard and then press OK to restart,%Gomi%
   Exitapp
}

else

;* SetWorkingDir,%Omig%\

;   MsgBox,After your buttons have been created they will want to be positioned in semblance of a seating chart.  You may also resize them.  Once you have them arranged to your satisfaction`, press the `"Save Config`" button.  Then the next time you run this program in this setting`, you can press the "Apply Config" button to restore the buttons to the exact same places.

;   Run Notepad.exe %Gomi%
;   Run Notepad.exe %Gizmo%

SplitPath,Gomi,Omig

Topper = 1

Gui, Add, Button, x0 y10 w80 h30 , Record
Gui,Margin,0,0
Gui, Add, Button, x0 y189 w40 h30 , <<
Gui, Add, Button, x40 y189 w40 h30 , <
Gui, Add, Button, x80 y189 w40 h30 , >
Gui, Add, Button, x120 y189 w40 h30 , >>
Gui, Add, Button, x0 y160 w80 h30 , Bookmark
Gui, Add, Button, x0 y100 w80 h30 , Goto
Gui, Add, Button, x80 y100 w80 h30 , Goto_play
Gui, Add, Button, x80 y10 w80 h30 , Resume
Gui, Add, Button, x0 y130 w80 h30 , View_log
Gui, Add, Button, x80 y160 w80 h30 , Query
Gui, Add, Button, x0 y40 w80 h30 , Q
Gui, Add, Button, x80 y40 w80 h30 , A
Gui, Add, Button, x0 y70 w80 h30 , Save_Config
Gui, Add, Button, x80 y130 w80 h30 , Speakerlist
Gui, Add, Button, x80 y70 w80 h30 , Apply_Config
Gui, Add, Button, x0 y220 w80 h30 , Reload
Gui,+AlwaysOnTop
; Generated using SmartGUI Creator 4.0
Gui,Show,x0 y0, TRC

M%Topper% = TRC

Loop
{
   FileReadLine,Boy,%Gomi%,%A_Index%
   If Errorlevel
   Break
   IfInString,Boy,|
   Continue
   IfInString,Boy,$
   Break
   If Boy =
   Continue
   Topper++
   ;MsgBox,%A_Index% -- %Boy%
   Goy = %Boy%
   Boy = %Goy%
   Gui,%Topper%:+Resize -MaximizeBox +ToolWindow +AlwaysonTop
   Gui,%Topper%:Margin,0,0
   IfInString,Boy,@
     {
        StringReplace,Boy,Boy,@,
        Gui,%Topper%:Font,S12
        Gui,%Topper%:Add,Text,,%Boy%
        Gui,%Topper%:Show,,%Boy%
        M%Topper% = %Boy%
        ;Msgbox,%Goy%
        Continue
     }
   Gui,%Topper%:Font,S12
   Gui,%Topper%:Add,Button, gButtonSpeaker ,%Boy%
   Gui,%Topper%:Show,,%Boy%
   M%Topper% = %Boy%
     ;Msgbox,%Goy%
}

FileAppend,`r`n`[Script started %A_MM%-%A_DD%-%A_Hour%:%A_Min%:%A_Sec%`]`r`n,%Gizmo%
Run D:\Program Files\Notepad++\notepad++.exe %Gomi%
Run D:\Program Files\Notepad++\notepad++.exe %Gizmo%

Return



ButtonSpeaker:

If A_Gui = 1
{
Gosub Button%Speaker%
Return
}
Else

GetKeyState,ByA,Ctrl
If ByA = D
{
 ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
 FormatTime, timey,, HH:mm:ss
 FileAppend, `r`n`[%Timex%-%timey%`]%A_Tab%%A_Tab%BY%A_Space%,%Gizmo%
 FileAppend,% M%A_Gui% ":",%Gizmo%
}

Else
{
 ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
 FormatTime, timey,, HH:mm:ss
 FileAppend, `r`n`[%Timex%-%timey%`],%Gizmo%
 FileAppend,% M%A_Gui%,%Gizmo%
 FileAppend,:*.%A_Space%, %Gizmo%
}
 Rosie++
 R%Rosie% := Timex
 Pinky = %Rosie%
 ControlSend,,^+2,ahk_class Notepad++
 ControlSend,,^+!0,ahk_class Notepad++
 return
 
^+#Escape::ExitApp

;-----------------------------------------------------

ButtonSave_Config:
^+#m::  ;;This Stores the positions of each GUI to the speakerlist in lines prepended with a "$"

Loop,Read,%Gomi%,deleme.txt
{
   If A_LoopReadLine =
   Continue
   IfInString,A_LoopReadLine,|
   Continue
   StringReplace,FancyPants,A_LoopReadLine,`n,,All
   StringReplace,FancyPants,FancyPants,`r,,All
   StringReplace,FancyPants,FancyPants,`,,``,,All
   IfInString,FancyPants,$
   Continue
   FileAppend,%FancyPants%`r`n
}
Loop,Read,%Gomi%,deleme.txt
{
   If A_LoopReadLine =
   Continue
   IfInString,A_LoopReadLine,|
   Continue
   IfInString,A_LoopReadLine,$
   Continue
   StringReplace,FancyPants,A_LoopReadLine,@,,All
   WinGetPos,xx,yy,ww,hh,%FancyPants%
   FileAppend,$%FancyPants%`,%xx%`,%yy%`,%ww%`,%hh%`r`n
}
WinGetPos,xx,yy,ww,hh,TRC
FileAppend,$TRC`,%xx%`,%yy%`,%ww%`,%hh%`r`n,deleme.txt
FileMove,deleme.txt,%Gomi%,1
FileAppend,`r`n,%Gomi%

;Run %A_WinDir%\Notepad.exe %Gomi%

Return

ButtonApply_Config:
^+#l::  ;;This reads all lines containing "$" and moves the GUIs to those positions. 
Loop
{
   FileReadLine,Troy,%Gomi%,%A_Index%
   IfInString,Troy,|
   Continue
   IfInString,Troy,$
      {
      StringSplit,aa,Troy,`,,$
      WinMove,%aa1%,,%aa2%,%aa3%,%aa4%,%aa5%
      }
}
Return
;-----------------------------------------------------

;TRC stuff follows

;-----------------------------------------------------
Pause::Suspend
;-----------------------------------------------------

ButtonQuery:
Rosie++
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
FormatTime, timey,, HH:mm:ss
FileAppend, `n[%Timex%-%timey%-00QUERY`],%Gizmo%
R%Rosie% := Timex
Pinky = %Rosie%
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++
Return


ButtonQ:
Rosie++
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
FormatTime, timey,, HH:mm:ss
FileAppend, `n[%Timex%-%timey%`]Q*.%A_Space%,%Gizmo%
R%Rosie% := Timex
Pinky = %Rosie%
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++
Return

ButtonA:
Rosie++
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
FormatTime, timey,, HH:mm:ss
FileAppend, `n[%Timex%-%timey%`]A*.%A_Space%,%Gizmo%
R%Rosie% := Timex
Pinky = %Rosie%
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++
Return

ButtonBookmark:
Rosie++
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
FormatTime, timey,, HH:mm:ss
FileAppend, *.%A_Space%[%Timex%-%timey%--00Marker`],%Gizmo%
R%Rosie% := Timex
Pinky = %Rosie%
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++
Return

ButtonRecord:
;nn = 1
;Rosie++
Disney = 1
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
ControlClick,Button14,ahk_class TotalRecorderWndClass
R%Rosie% = %Timex%
;FormatTime, timey,, HH:mm:ss
FileAppend, `r`n`[Recording Begin %Timex%-%timey%`],%Gizmo%
ControlClick,Button20,ahk_class TotalRecorderWndClass
;Pinky = %Rosie%
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++
Return

ButtonGoto_Play:
If Disney <>
{
Rosie++
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
R%Rosie% := Timex
FileAppend, `r`n[Recording Paused %Timex%-%timey%`],%Gizmo%
}
Gosub, Backup
Sleep,30
ControlClick,Button16,ahk_class TotalRecorderWndClass
Disney =
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++
Return

ButtonGoto:
If Disney <>
{
Rosie++
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
R%Rosie% := Timex
FileAppend, `r`n[Recording Paused %Timex%-%timey%`],%Gizmo%
Pinky = %Rosie%
}
Gosub, Backup
Disney =
;MsgBox,%Pinky%
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++
Return

Backup:
Pinky--
Rnn := R%Pinky%
ControlClick,Button19,ahk_class TotalRecorderWndClass
Sleep,100
ControlClick,ToolBarWindow324,ahk_class TotalRecorderWndClass
WinWaitActive,Jump to time
;MsgBox,%Rnn%
ControlSetText,Edit1,%Rnn%,Jump to time
Sleep,200
ControlClick,Button3,Jump to time
Sleep,30
If Pinky = 1
{
Msgbox,,2,Out of bookmarks!,.5
Pinky = %Rosie%
}
Return

JumpBox:
^+j::
ControlClick,ToolBarWindow324,ahk_class TotalRecorderWndClass
Return

ButtonView_log:
SetTitleMatchMode,1
IfWinNotExist,%gizmo% - Notepad
{
Run Notepad  %Gizmo%
WinWaitActive,%Gizmo% - Notepad
ControlSend,,^{End},%Gizmo% - Notepad
Return
}
Else
WinKill,%Gizmo% - Notepad
;ControlSend,ahk_parent,!F4,%Gizmo% - Notepad
Return

ButtonSpeakerlist:
IfWinNotExist,%Omig% - Notepad
{
Run Notepad %Omig%
WinWaitActive,%Omig% - Notepad
ControlSend,,^{End},%Omig% - Notepad
Return
}
Else
WinKill,%Omig% - Notepad
Return


ButtonResume:
nn = 1
Disney = 1
ControlClick,Button14,ahk_class TotalRecorderWndClass
Sleep,10
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
R%Rosie% := Timex
FileAppend, `r`n[Recording Resume %Timex%-%timey%`],%Gizmo%
ControlClick,Button20,ahk_class TotalRecorderWndClass
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++
Return

^#c:: ;;This sends highlighted text to the TR jumpbox and presses OK
Send,^c
Bubba := Clipboard
Sleep,300
ControlClick,ToolBarWindow324,ahk_class TotalRecorderWndClass
WinWaitActive,Jump to time
ControlSetText,Edit1,%Bubba%,Jump to time
ControlClick,Button3,Jump to time
Return

Button<<:
ControlClick,Button11,ahk_class TotalRecorderWndClass
Return

Button<:
ControlClick,Button12,ahk_class TotalRecorderWndClass
Return

Button>:
ControlClick,Button13,ahk_class TotalRecorderWndClass
Return

Button>>:
ControlClick,Button14,ahk_class TotalRecorderWndClass
Return


ButtonReload:
^+#Backspace:
Reload
Return



Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2009, 4:51 am 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
I see... Well, I was afraid you'd say it's more than meets the eye.

For now I'll just say I did/do intend to make the arrangement as flexible as possible but there has to be a limit somewhere. Until I devise (or find) a good function that allows quick drag/resize of controls in place, my version of the script will be less flexible.

Anyway, currently the table auto-adjusts itself according to the number of speakers; initially I chose a separate GUI for settings but I feel you'd want quick access to seating, number of speakers, etc. so I might have to put everything in one GUI, although IMHO it would overload it.

There's also layout save/load in plan, something I thought could speed things up - just haven't got around coding it (as well as other features).

Right now I'm dead tired (almost 7AM and haven't had any sleep yet) so I'll just post the script as is (so you see it's not just empty talk) and hit the sack. Will get back to you as soon as possible, after I look through your code.

Here's the link to the script and bitmap resources: download

P.S. Settings are not bound yet so to adjust table size you need to adjust number of speakers directly in the code (the speakers variable at the beginning of the script).
(link fixed - July 23, 2011)


Last edited by Drugwash on July 23rd, 2011, 1:45 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2009, 5:33 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
Well I look forward to you examining my code. I am not that proficient at it yet, maybe never will be. I try not to be too embarrassed when I learn I could have done things a much simpler way, such as in this thread. :oops: :)

But with a little help from my compadres here at AHK I've managed to get it so it's all one script that can be compiled, and cleaned it up a little bit. And for that tiny population who may have use for it, this script should be very good for recording and transcribing large meetings and hearings etc. But it could perhaps still stand improvement. Oh, BTW, I had it using Notepad++ as default viewer mostly, and the main drive may need to be changed to C:\.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2009, 6:19 pm 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
Don't worry, I'm no guru either, just a nosy non-standard user. :)

That Total Recorder doesn't fit in the open-source picture; I'd definitely use MCI or BASS for audio recording purposes. In that regard, the ultimate log manipulation would be to have control signals embedded in the recorded track that - on playback - would automate the log presentation.

I still have present in mind the old Z80 days when we had to load the applications from the tape and the sounds they made while loading; similarly, a compressed stream of data containing accurate timing (generated by the clicks in the GUI) and speaker info, would be embedded in the recording. On playback, the decoded data would automatically trigger the generation of the log data: date, time, speaker name, pause period, whatever.

BTW, in my script, when you click the table it records "Pause" in the log. Nice, huh? ;)

I must apologize for not being able to check your script yet; got sidetracked by other urgent matters and tomorrow I'll be out for the day so the feedback will be delayed. Oh and I'm sworn to never again use Notepad++ after a series of crashes some time ago; will have to modify the script accordingly before testing.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 40 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], rbrtryn, SKAN, Yahoo [Bot] and 56 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group