Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/28/2011 in all areas

  1. This is an UDF to create Mac style toolbars, like MobyDock, ObjectDock... screenshots: IconDock_1.jpg IconDock_2.jpg IconDock_3.jpg examples included. Download: IconDock.zip for german users: http://www.autoit.de/index.php?page=Thread&postID=215581#post215581 enjoy
    1 point
  2. AutoSam, I use this site whenever I get out of my depth in the SRE ocean - which is pretty often! GEOSoft has given us a very good SRE tester. You can get it here - look for the "PCRE Tester for AutoIt" link at bottom left. M23
    1 point
  3. If you solved the problems you had with activating/focusing chrome browser please let me know how you solved it. I figured I could solve it using a segment from my hotkey / automation program This is part of a 4000 line Autoit program, I let the user browse the titles of running windows and store the selection title in $macro[$macroid][$macrocommand[$macroid][0]][1] and it works for me, but I have not figured out why I can't reproduce a simple version for you. code segment that will focus IE or Google Chrome browsers with the user selected window title This is just an example that works for me, but I've been working on the 4000 lines for over a year and am not sure what you would need to add yet. but this is the event that does it for me. Switch $macro[$macroid][$macrocommand[$macroid][0]][0]; switch macro_command_type case $macrocommand_activate_window if $macro[$macroid][$macrocommand[$macroid][0]][2]= 1 Then;choose windowmode if winactivate($macro[$macroid][$macrocommand[$macroid][0]][1])<> 0 then WinSetState($macro[$macroid][$macrocommand[$macroid][0]][1], "", @SW_MINIMIZE) endif elseif $macro[$macroid][$macrocommand[$macroid][0]][2]= 2 Then if winactivate($macro[$macroid][$macrocommand[$macroid][0]][1])<> 0 then WinSetState($macro[$macroid][$macrocommand[$macroid][0]][1], "", @SW_MAXIMIZE) endif Else if winactivate($macro[$macroid][$macrocommand[$macroid][0]][1])<> 0 then WinSetState($macro[$macroid][$macrocommand[$macroid][0]][1], "", @sw_SHOWNORMAL) endif endif;end switch(windowmode) macrocommandinc($macroid) endswitch; end switch macro_command_type I developed this code as a solution to your post. The code below works on chrome and IE, but will only work on chrome if the chrome window is not minimized even still I had trouble focusing the chrome window even when I had activated it, so I get the position of the window and click the bastard to focus it. but the window cords I get for the chrome window are off!, $po[0] seems to be the x cord just fine, but $po[1] is y+h so I tried subtracting $po[3] but $po[3] was only 20 which was not the height of the chrome window and I give up. This will click the bottom of the chrome window (to focus it), only if the window is not minimized when you invoke the script. It will also work with IE, but IE can be minimized doesn't matter. $browserlistdatamax= 2 $browserlistmax= 3 $link= "no browser found"; this Link is missing Zelda dim $browserlist[$browserlistmax][$browserlistdatamax] $browserlist[0][0]= "[CLASS:MozillaWindowClass]"; use 'autoit window info' tool to aquire these values from each browser $browserlist[1][0]= "[CLASS:IEFrame]" $browserlist[2][0]= "[CLASS:Chrome_WidgetWin_0]" $browserlist[2][1]= 1; click window to focus for $i= 0 to $browserlistmax-1; loop through browser list. catch the first browser we find, let all the other ones go if WinExists($browserlist[$i][0])= 1 then; check if each browser is running winactivate($browserlist[$i][0]) ;WinSetState($browserlist[$i][0], "", @SW_SHOWNORMAL) WinWaitActive($browserlist[$i][0]) if $browserlist[$i][1]= 1 Then; click to focus $winpo= WinGetPos($browserlist[$i][0]) mouseclick("left", $winpo[0]+10, $winpo[1]+10, 1, 0) endif; end if click to target window sleep(50) Send("{F6}") sleep(200) send ("^c") $link= ClipGet() exitloop endif; end id winexists($browserlist[$i][0]) next; end for $browserlistmax-1 MsgBox(0, "browser address:", $link) exit func out($output= "");debug tool ConsoleWrite(@CRLF&$output);to console: new line, value of $output EndFunc; end out()
    1 point
  4. AutoSam, This looks as if it will do the trick: $sURL = "http://designenvy.aiga.org/solar-bikini-andrew-schneider/" $sNewURL = StringTrimRight(StringRegExpReplace($sURL, "(?U)\/\/.*\/", "\/\/XYZ.com\/"), 1) & ".html" ConsoleWrite($sNewURL & @CRLF)SRE explanation: (?U) - Look for the smallest match (in case you have multiple /) \/\/.*\/ - Replace //any-number-of-chars/ - the \ are necessary to escape the / \/\/XYZ.com\/ - with //XYZ.com/ (again the / is escaped by \)The StringTrimRight removes the final / and then we concatenate the ".html" All clear? M23
    1 point
  5. !d sends ALT+d. That selects the address bar. The ^c copies the address to the clipboard. To find out more about these, look up the "send" command in the help file.
    1 point
  6. I know there has to be a better way, but this can do it. It checks for Firefox first and if it doesn't exist, then checks for IE. If WinExists("[CLASS:MozillaWindowClass]") Then WinActivate("[CLASS:MozillaWindowClass]") ElseIf WinExists("[CLASS:IEFrame]") Then WinActivate("[CLASS:IEFrame]") EndIf Sleep(100) send ("!d") send ("^c") $link = ClipGet() MsgBox(0, "", $link)
    1 point
  7. #cs "audio_formats": { "m4a": { "64": [ "http://stream2.mxcdn.com/cloudcasts/m4a/64/1/c/8/a/b1b7-8318-4034-aa64-b747cdf6b183.m4a", "http://stream3.mxcdn.com/cloudcasts/m4a/64/1/c/8/a/b1b7-8318-4034-aa64-b747cdf6b183.m4a", "http://stream4.mxcdn.com/cloudcasts/m4a/64/1/c/8/a/b1b7-8318-4034-aa64-b747cdf6b183.m4a", "http://stream1.mxcdn.com/cloudcasts/m4a/64/1/c/8/a/b1b7-8318-4034-aa64-b747cdf6b183.m4a" ] }, "mp3": [ "http://stream2.mxcdn.com/cloudcasts/originals/1/c/8/a/b1b7-8318-4034-aa64-b747cdf6b183.mp3", "http://stream3.mxcdn.com/cloudcasts/originals/1/c/8/a/b1b7-8318-4034-aa64-b747cdf6b183.mp3", "http://stream4.mxcdn.com/cloudcasts/originals/1/c/8/a/b1b7-8318-4034-aa64-b747cdf6b183.mp3", "http://stream1.mxcdn.com/cloudcasts/originals/1/c/8/a/b1b7-8318-4034-aa64-b747cdf6b183.mp3" ], "aac": { "24": [ "http://stream2.mxcdn.com/cloudcasts/aac/24/1/c/8/a/b1b7-8318-4034-aa64-b747cdf6b183.aac", "http://stream3.mxcdn.com/cloudcasts/aac/24/1/c/8/a/b1b7-8318-4034-aa64-b747cdf6b183.aac", "http://stream4.mxcdn.com/cloudcasts/aac/24/1/c/8/a/b1b7-8318-4034-aa64-b747cdf6b183.aac", "http://stream1.mxcdn.com/cloudcasts/aac/24/1/c/8/a/b1b7-8318-4034-aa64-b747cdf6b183.aac" ], "64": [ "http://stream2.mxcdn.com/cloudcasts/m4a/64/1/c/8/a/b1b7-8318-4034-aa64-b747cdf6b183.m4a", "http://stream3.mxcdn.com/cloudcasts/m4a/64/1/c/8/a/b1b7-8318-4034-aa64-b747cdf6b183.m4a", "http://stream4.mxcdn.com/cloudcasts/m4a/64/1/c/8/a/b1b7-8318-4034-aa64-b747cdf6b183.m4a", "http://stream1.mxcdn.com/cloudcasts/m4a/64/1/c/8/a/b1b7-8318-4034-aa64-b747cdf6b183.m4a" ] } #ce Global $gs_Html = ClipGet() ; however you get your html, here I'm just copying what you had Global $ga_MP3 = __GetAudioFormatURLs($gs_Html, "mp3") Global $ga_AAC = __GetAudioFormatURLs($gs_Html, "aac", "24") _ArrayDisplay($ga_MP3, "MP3") _ArrayDisplay($ga_AAC, "AAC - 24") Func __GetAudioFormatURLs($s_str, $s_format, $s_type = "") Local $s_pattern = "(?is)\x22\Q" & $s_format & "\E\x22: " If $s_type Then $s_pattern &= "\{.*?\x22\Q" & $s_type & "\E\x22: " $s_pattern &= "\[\s*(.*?)\s*\]" ; get audio batch Local $a_audiobatch = StringRegExp($s_str, $s_pattern, 1) If @error Then Return SetError(1, 0, 0) $s_pattern = "(?:\x22(.*?)\x22)" Local $a_http = StringRegExp($a_audiobatch[0], $s_pattern, 3) If @error Then Return SetError(2, 0, 0) Return $a_http EndFunc
    1 point
  8. Hi Sam, Welcome to the forums!! Try replacing that line, just as you have, in both files I haven't yet taken a close look at that source but it should do the trick. If it doesn't, post back and I'll see what I can do Take a look at the Wiki and help-file when you're ready to dive into coding. Good luck -smartee
    1 point
  9. "10" is not a valid MsgBox(), but it is the return value for "Try Again" (see the help file). You can run it and get the response like this: $iResponse = MsgBox(6, "test", "dsadsadsadsdsdsa") If $iResponse = 10 Then MsgBox(64, "Try Again", "OK, we'll try again...") Else MsgBox(16, "Quit", "I give up.") EndIf
    1 point
  10. and in messageboxes: @CRLF
    1 point
  11. I'm not sure if you want to know how you can do it in AutoIt or in any programming language (that I can't help but I can tell you how to do it in AutoIt) Take a look at the Send command, to send ENTER, the command is: Send ("{ENTER}") and it will send it to active window.
    1 point
×
×
  • Create New...