Docfxit Posted April 30, 2019 Posted April 30, 2019 I have the code to install Firefox. I'd like to change the options. This script starts to change the options but I can't figure out how to select menu on the left. Comments in the code... expandcollapse popup#RequireAdmin ;AutoIt_Debugger_Command:Disable_Debug Global $title, $Text _Au3RecordSetup() If Not (ProcessExists("firefox.exe")) Then Run("C:\Program Files\" & "FireFox\FireFox.exe") WinWait("Mozilla Firefox", "") If Not WinActive("Mozilla Firefox", "") Then WinActivate("Mozilla Firefox", "") WinWaitActive("Mozilla Firefox", "") Local $hWnd = WinGetHandle('[Active]') $title = WinGetTitle("[Active]") WinActivate($title, "") $Text = WinGetText("[ACTIVE]") $Text = StringStripCR($Text) $TextLine = StringSplit($Text, @LF) ; $TextLine[0] - will be count of lines in $Text ; $TextLine[1] - will be content of first line in $Text ; MsgBox(0, @ScriptName, 'Line ' & @ScriptLineNumber & @CRLF & "Menu should be open " & '---' & ' (' & $title & ') ' & '---') If ($title = "New Tab - Mozilla Firefox" Or "Mozilla Firefox") Then WinWait($title, "") If Not WinActive($title, "") Then WinActivate($title, "") WinWaitActive($title, "") Send("{F10}") Sleep(100) Send("{ALTDOWN}t{ALTUP}") ;~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* ; Turning on the menu line with Alt-t works temporarily ; I'd like to find out how to make it perminant. ;~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* Sleep(100) Send("o") ;Options WinWait("Options", "") If Not WinActive("Options", "") Then WinActivate("Options", "") WinWaitActive("Options", "") ;Sleep(100) Send("{Tab 15}") Send("{UP}{Space}{Tab}") Send("c{SHIFTDOWN};{SHIFTUP}\Dnload") Sleep(500) Send("{SHIFTDOWN}Tab{SHIFTUP}{Down}") ; The above works ;~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* ; I need AutoIt to select the Home icon on the left menu ; Then Homepage and new windows ; Then Firefox Home (Default) and change it to Custom URL's ; Then Down one box and enter "https:google.com" (without the quotes) ;~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* EndIf Exit Func _Au3RecordSetup() ;AutoIt_Debugger_Command:Disable_Debug Opt('WinWaitDelay', 100) Opt("WinTitleMatchMode", 4) Opt('WinDetectHiddenText', 1) Opt('MouseCoordMode', 0) Opt("TrayIconDebug", 1) ;0-off ; Set so that tray displays current line number HotKeySet("{ESC}", "_Exit") ;If you press ESC the script will stop ;AutoIt_Debugger_Command:Enable_Debug EndFunc ;==>_Au3RecordSetup Func _Exit() Sleep(100) Exit EndFunc ;==>_Exit Thanks, Docfxit
Rex Posted May 2, 2019 Posted May 2, 2019 You could just create a user.js file in the FF user profile dir, and add user_pref("browser.startup.homepage", "www.google.com"); Or search for the "user_pref("browser.startup.homepage", "DEFAULT FF HOMEPAGE");" in prefs.js and replace the default ff homepage. More info here Cheers /Rex
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