Hi,
Is it possible to insert a string into the Location Bar of the current tab? I would like to write
javascript:alert(document.title="title")
and then press enter. This changes the title of the current tab to “title”.
Thanks,
gecko
Hi,
Is it possible to insert a string into the Location Bar of the current tab? I would like to write
javascript:alert(document.title="title")
and then press enter. This changes the title of the current tab to “title”.
Thanks,
gecko
the AppleScript capabilities of firefox (even UI scripting) are hopeless
This works for me in Tiger.
-- Bring Firefox to the front to receive keystrokes.
tell application "Firefox" to activate
tell application "System Events"
-- Key in Command-l to select the Location field.
keystroke "l" using {command down}
-- Key in the JavaScript line and a return.
keystroke "javascript:alert(document.title=\"title\")" & return
-- Wait for the confirmation dialog sheet to appear. (Uses GUI Scripting.)
tell application process "firefox-bin"
repeat until (sheet 1 of window 1 exists)
delay 0.2
end repeat
end tell
-- Dismiss the dialog sheet.
keystroke return
end tell