janwayne Posted October 17, 2011 Share Posted October 17, 2011 (edited) I was trying to use the default example Notepad script, but it failed when I tried to do the following: Send({CTRL}+{T}) Sleep(500) I could not compile it to an .exe file. What would be the correct code here? Edited October 17, 2011 by janwayne Link to comment Share on other sites More sharing options...
Ramzes Posted October 17, 2011 Share Posted October 17, 2011 Look here Sorry for my bad English but nobody is perfect. [font=arial, helvetica, sans-serif]Ramzes[/font] Link to comment Share on other sites More sharing options...
BrewManNH Posted October 17, 2011 Share Posted October 17, 2011 Send("^t") would send CTRL-T, see the help file for the Send command. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
janwayne Posted October 17, 2011 Author Share Posted October 17, 2011 (edited) Send("^t") would send CTRL-T, see the help file for the Send command. Thanks. Now, if i want iexplore.exe started by the script, and want it to send ctrl+t - then what? For now, I've done this: Run("iexplore.exe") WinWaitActive("[CLASS:Internet Explorer]") Send("^t") The script doesn't start iexplore.exe at all. Edited October 17, 2011 by janwayne Link to comment Share on other sites More sharing options...
BrewManNH Posted October 17, 2011 Share Posted October 17, 2011 If you include the full path to iexplore.exe (C:\Program Files\Internet Explorer\iexplore.exe) it starts fine. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Ramzes Posted October 17, 2011 Share Posted October 17, 2011 (edited) Try: Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe") or: ShellExecute("iexplore") Edited October 17, 2011 by Ramzes Sorry for my bad English but nobody is perfect. [font=arial, helvetica, sans-serif]Ramzes[/font] Link to comment Share on other sites More sharing options...
janwayne Posted October 17, 2011 Author Share Posted October 17, 2011 We're getting closer, but IE doesn't open the new tab: ; Start IE ShellExecute("iexplore") ; Venter på at IE er aktiv WinWaitActive("[CLASS:Internet Explorer]") ; Send ctrl + t Send("^t") Sleep(500) Send("^t") Link to comment Share on other sites More sharing options...
Ramzes Posted October 17, 2011 Share Posted October 17, 2011 Think more than 3 minutes above your problem. We won't write it for you.Search for a _IEAttach function. Sorry for my bad English but nobody is perfect. [font=arial, helvetica, sans-serif]Ramzes[/font] Link to comment Share on other sites More sharing options...
janwayne Posted October 18, 2011 Author Share Posted October 18, 2011 I've searched for 2 hours now, without any luck. I'm not hardcore for this, so therefor, please, I need help to get this work. Thanks in advance. Link to comment Share on other sites More sharing options...
jWalker Posted October 18, 2011 Share Posted October 18, 2011 Why "WinWaitActive("[CLASS:Internet Explorer]")" I made a test script like this WinWaitActive("[CLASS:Internet Explorer]") MsgBox(0, "", "") and no msgBox shows.. so it wont open the new tab - because no window with this title comes up... In your AutoIt install directory is the AU3Info.exe Open it Wait for your browser to be in that state where you like to open the new tab drag the finder cross onto your browser window lookup the title in AU3Info and put it inside the winwaitactive function now it should work Link to comment Share on other sites More sharing options...
janwayne Posted October 18, 2011 Author Share Posted October 18, 2011 So far, so good Now, is it possible, to bind a control key, så that if I press "num0" or something similar, to make the script reload? Then I don't need to re-open the converted script .exe file. Link to comment Share on other sites More sharing options...
jWalker Posted October 18, 2011 Share Posted October 18, 2011 (edited) HotKeySet Function... Write all you have an an Function.. e.g.: Func newtab() xxxxxxx your code xxxxxxx EndFunc And assign a hotkey to this function HotkeySet("^d", "newtab") EDIT: Forgot the while-loop your script should look like this: HotKeySet("^l", "newtab") While 1 Sleep( 500 ) WEnd Func newtab() WinWaitActive("Internet Explorer") Send("^t") EndFunc Your script sets the hotkey to call this function Then it goes to the while loop Waits 500 miliseconds goes to the beginning of the while loop waits again If you press your assigned hotkey, the script stops where it is, goes to the assigned function and does what is inside the function. after that it returns to the while loop... Edited October 18, 2011 by jWalker Link to comment Share on other sites More sharing options...
janwayne Posted October 18, 2011 Author Share Posted October 18, 2011 Thanks for the post jWalker, but, it doesn't work. Link to comment Share on other sites More sharing options...
jWalker Posted October 18, 2011 Share Posted October 18, 2011 Could you post your full script please? ill tell you then what doesn't work.. Link to comment Share on other sites More sharing options...
janwayne Posted October 18, 2011 Author Share Posted October 18, 2011 HotKeySet("^l", "newtab") While 1 Sleep( 500 ) WEnd Func newtab() WinWaitActive("Internet Explorer") Send("^t") EndFunc Nothing happens. Link to comment Share on other sites More sharing options...
jWalker Posted October 18, 2011 Share Posted October 18, 2011 Well - my script was only a guideline... What are the keys you want to use? New Tab? Ctrl + t Reload function? i dont know.. What is the exact window title? Not internet explorer or? Link to comment Share on other sites More sharing options...
janwayne Posted October 18, 2011 Author Share Posted October 18, 2011 I'm looking for this script: It detects, that iexplore.exe is open, if not, it opens it. Then, it opens a new tab - ctrl + t. It has to repeat this ctrl + t send command each second hour. At last, it should be possible to reload this script to start instantly, if I press like "num1". Link to comment Share on other sites More sharing options...
jWalker Posted October 18, 2011 Share Posted October 18, 2011 (edited) HotKeySet( "{NUMPAD1}", "newtab" ) HotKeySet( "{NUMPAD2}", "showsecs" ) $Timer = TimerInit( ) $Timer2 = TimerInit( ) While 1 If ProcessExists( "iexplore.exe" ) Then $Diff = TimerDiff( $Timer ) If $Diff > 7200000 Then $Timer = TimerInit( ) newtab( ) EndIf Sleep( 10 ) Else ShellExecute("iexplore") WinWaitActive( "MSN" ) EndIf If TimerDiff( $Timer2 ) > 2000 Then ToolTip( "" ) EndIf WEnd Func newtab( ) Send( "^t" ) EndFunc Func showsecs() ToolTip( Round(($Diff - 7200000) / 1000 * -1) ) $Timer2 = TimerInit( ) EndFunc It opens new tab every 2 hours you can open a new tab with NUM1 ( If you did - the timer will not be resetted ) You can display the remaining seconds with NUM2 Again - WinWaitActive( "MSN" ) - has to be your window title... EDIT: Fixed Bugs try know! Edited October 18, 2011 by jWalker Link to comment Share on other sites More sharing options...
janwayne Posted October 18, 2011 Author Share Posted October 18, 2011 I could compile the .exe, but when i run it, i get the following error: Line 23 (File ""): Error: "Func" statement has no matching "EndFunc" I simple changed your "MSN" text, with the text Au3Info found on the IExplore window, which used to work in my other script. Link to comment Share on other sites More sharing options...
jWalker Posted October 18, 2011 Share Posted October 18, 2011 Try to use the complete script... scroll down a bit Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now