Hello I have a script that opens a file in Notepad. I use the find to look for a word. I then copy the two characters after the word I was searching for. I then open the find dialog again and paste the two characters I then append a few characters to the search string and search for it. However before appending I wish to check the last character that I pasted in the Find dialog and see if it is equal to a " and if it is I want to delete that " before appending my text.
Could someone please give me some scripting to make this happen.
Thanks
verifying a character
Moderators: JRL, Dorian (MJT support)
Hi,
Label>start
..
.. here is your code where you copy the
.. two chars from notepad
..
//Get the clipboard contents into a variable
GetClipBoard>twochars
//check the length is in fact 2 chars:
Length>twochars,ltc
//if not 2 try again? (Just an example)
If>ltc2,start
//See if the last char is a "
MidStr>twochars,2,1,qchar
If>qchar=",removequote,continue
Label>removequote
//we want only the first char
MidStr>twochars,1,1,twochars
Label>continue
..
.. here you carry on and paste 'twochars' into the find dialog
.. and do what you normally do
..
Label>start
..
.. here is your code where you copy the
.. two chars from notepad
..
//Get the clipboard contents into a variable
GetClipBoard>twochars
//check the length is in fact 2 chars:
Length>twochars,ltc
//if not 2 try again? (Just an example)
If>ltc2,start
//See if the last char is a "
MidStr>twochars,2,1,qchar
If>qchar=",removequote,continue
Label>removequote
//we want only the first char
MidStr>twochars,1,1,twochars
Label>continue
..
.. here you carry on and paste 'twochars' into the find dialog
.. and do what you normally do
..
MJT Net Support
[email protected]
[email protected]