xuzo Posted July 9, 2012 Posted July 9, 2012 (edited) I want to make a script to change IE options and firefox ect... Instead of having the client's browser open up, can I make the script run things "hidden"? For Example let's say the script changes the Homepage, there will be a series of Sends, not sure if clear or not. Can provide and example later on. Something like this but without opening IE #include Local $oIE_basic = _IE_Example("basic") Sleep("500") Send("{ALTDOWN}t{ALTUP}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{ENTER}") Edited July 9, 2012 by xuzo
JohnOne Posted July 9, 2012 Posted July 9, 2012 Third param in _IECreate(url, tryattach, visible) I doubt a hidden gui will accept Sends though, maybe ControlSend, but I'm unsure. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
BrewManNH Posted July 9, 2012 Posted July 9, 2012 If you're changing the home page for the current user, you shouldn't be doing it with a lot of Send commands, you should go to the registry setting for that parameter and change it there. It's a lot more reliable, and it's also less chancy that things will change in the number of Tabs and Enters etc. you'll need to keep track of.The home page setting is located in:HKCU\Software\Microsoft\Internet Explorer\Mainand the key to change is "Start Page", as long as IE isn't open at the time it will be changed the next time it's opened. 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
xuzo Posted July 9, 2012 Author Posted July 9, 2012 Hi Brewman, That sounds good but I need this task to work for IE, Firefox, Chrome and Safari, and some of them might be portable....
JohnOne Posted July 9, 2012 Posted July 9, 2012 @SW_HIDE will hide a gui (well most of them from Run() function. But the same problem might exist. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
xuzo Posted July 10, 2012 Author Posted July 10, 2012 Hi Brewman,How can I do this, what function or command to use? Is there a way to open the registry in on step or do I need to use Send commands to run?HKCUSoftwareMicrosoftInternet ExplorerMainand the key to change is "Start Page", as long as IE isn't open at the time it will be changed the next time it's opened.Thanks
OrthodoxyUSA Posted July 10, 2012 Posted July 10, 2012 RegWrite is what you want. (Figure out where all the values that you wan't to changes and use RegWrite to make those changes.) ; Write a single REG_SZ valueRegWrite("HKEY_CURRENT_USERSoftwareTest", "TestKey", "REG_SZ", "Hello this is a test"); Write the REG_MULTI_SZ value of "line1" and "line2"RegWrite("HKEY_CURRENT_USERSoftwareTest", "TestKey1", "REG_MULTI_SZ", "line1" & @LF & "line2"); Write the REG_MULTI_SZ value of "line1"RegWrite("HKEY_CURRENT_USERSoftwareTest", "TestKey2", "REG_MULTI_SZ", "line1"); always add and extra null stringRegWrite("HKEY_CURRENT_USERSoftwareTest", "TestKey3", "REG_MULTI_SZ", "line1" & @LF & "line2" & @LF)RegWrite("HKEY_CURRENT_USERSoftwareTest", "TestKey4", "REG_MULTI_SZ", "line1" & @LF & @LF & "line2" & @LF); empty REG_MULTI_SZRegWrite("HKEY_CURRENT_USERSoftwareTest", "TestKey5", "REG_MULTI_SZ", ""); create just the keyRegWrite("HKEY_CURRENT_USERSoftwareTest1")Be aware that there can be Group Policies in place that will override your settings.Paul
xuzo Posted July 11, 2012 Author Posted July 11, 2012 (edited) Hi Paul, Thanks, now I understand! So send command might be unreliable... And registry might not work depending on permissions... So what would be my solution to create a task that will work on multiple browsers? Edited July 11, 2012 by xuzo
BrewManNH Posted July 11, 2012 Posted July 11, 2012 (edited) Chrome stores it's home page in the file"C:Documents and Settings<username>Local SettingsApplication DataGoogleChromeUser DataDefaultPreferences "No idea where Firefox stores its settings I don't use it myself. Edited July 11, 2012 by BrewManNH 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
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