; Auto-It3 Script ; Convert MediaShout(TM) cues to graphic files and import to Powerpoint photo album slideshow. ; ; Disclaimer - This software is "Freeware" and may not be sold under any circumstances. ; There are no warranties, guarantees, support or fitness for use implied. ; The user agrees to accept all responsibility for the use of this software, and indemnify and hold harmless the developer(s) ; for any claims, loss or damage resulting from it's use. ; This program and any derivative works may not be sold or distributed without written consent from the author. ; ; To God be the Glory! ; 4-18-2008 ; (c) R. Noar , www.rayonics.com Inc. #include AutoitWinSetTitle ("CUE2PPT") ; STARTUP Opt("WinTitleMatchMode", 2) ; Substring Window Title Match Mode AdLibEnable ("MyAdLib") ; Keep Message boxes on top ; $Cue2pptdir = (@MyDocumentsDir & "\CUE2PPT") If Not FileExists ($Cue2pptdir) Then DirCreate ($Cue2pptdir) ; Create CUE2PPT dir under 'My Documents' if needed ; If MsgBox(4, "CUE2PPT: v1.0", "This freeware program converts MediaShout(TM) cues into a Powerpoint(TM) slideshow." _ &@CRLF & "Please close any PowerPoint windows before proceeding." _ &@CRLF & "" _ &@CRLF & "This software is unsupported freeware, and is provided free of charge for use by individuals," _ &@CRLF & "schools, churches and non-profit organizations. Any other use is prohibited." _ &@CRLF & "There are no warranties, guarantees, support or fitness for use implied." _ &@CRLF & "This software is not to be used to violate or infringe upon any copyright." _ &@CRLF & "The user agrees to not make illegal copies or distribution of song lyrics or other copyrighted material." _ &@CRLF & "The user agrees to indemnify & hold harmless the author(s) of this program against any claim, loss or damages." _ &@CRLF & "This program and any derivative works may not be sold or distributed without written consent from the author." _ &@CRLF & "" _ &@CRLF & "By clicking 'YES', the user agrees to all of the terms and conditions noted above." _ &@CRLF & "" _ &@CRLF & "(C) Roger Noar, www.rayonics.com Inc. 2008" &@CRLF &"'To God Be The Glory' ") = 7 Then Exit ; If IsVisible("PowerPoint") Then MsgBox (0, "CUE2PPT:", "Please close any other Powerpoint windows that are open before proceeding!") EndIf ; Do $Msgval = MsgBox (0, "CUE2PPT:", "Open MediaShout & Single-Click on the first cue that you wish to convert." _ &@CRLF & "Click 'OK' when ready.", "2") ; Very short timeout, to keep this MsgBox visible Until $Msgval = 1 ; If Not IsVisible("MediaShout") Then MsgBox (0, "CUE2PPT:", "MediaShout is not running. Please start MediaShout, then Single-Click on the first cue that you wish to convert.") EndIf ; If FileExists ($Cue2pptdir & "\*.jpg") Then FileDelete ($Cue2pptdir & "\*.jpg") ; delete old cue .jpgs ; $Num_cues = InputBox("CUE2PPT:", "How many cues do you want to convert?", "1") If @error = 1 Then $Answer = MsgBox (4, "CUE2PPT:", "Do you really want to exit this program?") If $Answer = 6 Then Exit EndIf ; $Quad_view = MsgBox("4","CUE2PPT:", "Four Cues Per Page?") $Quad_view = $Quad_view - 5 ; AdLibDisable () ; ; ;If Not WinActive("MediaShout","") Then WinActivate("MediaShout","") ;WinWaitActive ("MediaShout","",20) ;Capture full screen ;_ScreenCapture_Capture($Cue2pptdir & "\CUE0_0.jpg") ; ; CUE CONVERSION LOOP For $i = 1 to $Num_cues Step 1 ; Repeat the loop for the number of cues chosen SplashTextOn("CUE2PPT", "Converting Cues", -1, 100, -1, 10, 0, "", 24) WinSetState ("MediaShout", "", @SW_MAXIMIZE) ; Sleep (1000) If Not WinActive("MediaShout","") Then WinActivate("MediaShout","") WinWaitActive ("MediaShout","",20) ; Send ("!E") ; Edit Send ("o") ; Convert Send ("p") ; Graphic ; If Not WinActive("Save Graphic","") Then WinActivate("Save Graphic","") WinWaitActive ("Save Graphic","",10) Sleep (1000) Send ($Cue2pptdir & "\Cue" & $i & "_") ; File Name Sleep (1000) Send ("!s") ; Save ; WinWaitClose ("Save Graphic", "", 60) ; Wait for graphic conversion If Not WinActive("MediaShout","") Then WinActivate("MediaShout","") WinWaitActive ("MediaShout","",20) Send ("{DOWN}") ; Move down to next cue ;Sleep (1000) Next ; ; MEDIASHOUT CUES DONE ; ;Capture full screen _ScreenCapture_Capture($Cue2pptdir & "\Screenshot.jpg") ; Required, since Powerpoint Photo Album bug always puts the last .jpg first.... ; ; START POWERPOINT SplashTextOn("CUE2PPT", "Starting PowerPoint", -1, 100, -1, 10, 0, "", 24) ; $Shell_rtn = ShellExecute ("Powerpnt.exe", "", "", "", @SW_MAXIMIZE) If $Shell_rtn = 0 Then MsgBox(0,"CUE2PPT: - ERROR", "Powerpoint not found on this computer") Exit EndIf ; WinWaitActive ("PowerPoint","",60) ;Sleep (1000) Send ("{Esc}"); If Not WinActive("PowerPoint","") Then WinActivate("PowerPoint","") ; SplashTextOn("CUE2PPT", "Creating PowerPoint Slideshow", -1, 100, -1, 10, 0, "", 24) ;Sleep (1000) Send ("!i"); Insert Send ("p"); Photo ;sleep (1000) Send ("p"); Photo Album ;sleep (1000) Send ("!f"); File ;Send ("!i"); File field ;Send ("{DOWN}"); Down Arrow ;sleep (1000) ;Send ("l"); Local Disk ;sleep (1000) ;Send ("{Enter}"); Enter sleep (1000) Send ("!n"); File name field Send ($Cue2pptdir); Send ("{ENTER}");i Sleep (1000) ; ;Need to do this , to work with Vista & XP Send ("!i") ; Look In Sleep (1000) Send ("{TAB}"); Send ("{TAB}"); Send ("{TAB}"); Finally at the top of the file list... Send ("+{End}"); Select all Sleep (1000) ; AdLibEnable ("MyAdLib") ; Keep Message boxes on top ; $PPTCheckMsg = "Please verify that the cues are listed in increasing order from top to bottom. If not, click on the 'Name' column to resort the cues." Do $Answer = MsgBox(1,"CUE2PPT:", $PPTCheckMsg, "2") ; Very short timeout - to keep this message box visible If $Answer = 2 Then $Answer = MsgBox (4, "CUE2PPT:", "Do you really want to exit this program?") If $Answer = 6 Then Exit EndIf Until $Answer > 0 ; AdLibDisable () ; Sleep (1000) WinActivate ("Insert New Pictures", "") Sleep (1000) Send ("!s");insert If $Quad_view = 1 Then Send ("!p"); Photos per page Send ("4"); 4 per page EndIf Sleep (1000) WinActivate ("Photo Album", "") Send ("!c"); Create photo album ; SplashOff () ; MsgBox (0,"CUE2PPT:", "ALL DONE!") ; Exit ; ; ; FUNCTIONS: Func IsVisible($title) ;This Function checks to see if a Window is Visible If BitAnd( WinGetState($title), 2 ) Then Return 1 Else Return 0 EndIf EndFunc ; Func MyAdLib() If WinExists ("CUE2PPT:", "") Then if Not WinActivate ("CUE2PPT:", "") Then MsgBox (0, "Adlib Winactivate", "") if Not WinSetOnTop ("CUE2PPT:","",1) Then MsgBox (0, "Adlib WinSetOnTop", "") WinSetState ("CUE2PPT:", "", @SW_SHOW) WinSetState ("CUE2PPT:", "", @SW_ENABLE) EndIf EndFunc