Hi,
I'm trying to write my very first script.
I want the script to edit a text file that is located at the installation path of an application i'm using.
Anyway, as you can see below, after i've opened the text file in notepad, i'm trying to find the string i want to edit, using ^f.
If the text file i'm editing contains the string i'm looking for, then the script works well, but how can i handle a situation in which the FIND function in notepad, is unable to locate the string?
How can i identify this situation in the script?
I need to know what happen after i press the FIND button, was the string found or did an error message appear.
Here's what i have so far:
$MyappInstallationPath = RegRead("HKCU\Software\myapp\app","MyAppPath") ;Fetching the path from registry
Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Send("^o") ;opening the OPEN FILE dialog
send($MyappInstallationPath ) ;Entering the path for the file
send("\settings.txt") ;Entering the file name
send("!o") ;Pressing the OPEN button to open the file
send("^f") ;Opening the FIND dialog
send("viewmode") ;Entering the string to find
send("!f") ;Pressing the FIND button
Send("!{F4}") ;Closing the FIND dialog
Send("{RIGHT}")
send("+{END}")
Send("{BS}")
Send("1")
send("^s")
send("!f")
send("x")