GMind
GMind

Reputation: 31

(applescript) cant use command f

hi im working on a simple router cracker and this part won't compile (this is for searching the router ip so you can find its service provider) (if you get it)

tell application "Safari"
activate
open location "http://www.techspot.com/guides/287-default-router-ip-addresses/"
keystroke "f" using {command down, shift down}
set search to text returned of (display dialog "router ip" default answer "" buttons {"cancel", "find it"} default button 2)
search
keystroke "enter" using {command down, shift down}

Upvotes: 0

Views: 514

Answers (1)

Lri
Lri

Reputation: 27613

As DigiMonk said, the keystroke command is provided by System Events. You can also use UI scripting to fill the search field:

tell application "Safari"
    activate
    open location "http://www.techspot.com/guides/287-default-router-ip-addresses/"
    set search to text returned of (display dialog "router ip" default answer "")
end tell
tell application "System Events"
    keystroke "f" using command down
    tell process "Safari"
        tell group 1 of group 1 of window 1
            set value of text field 1 to search
            click button 1
        end tell
    end tell
end tell

Upvotes: 1

Related Questions