Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <MsgBoxConstants.au3>
- Func _WinWaitActivate($title,$text,$timeout=200)
- WinWait($title,$text,$timeout)
- If Not WinActive($title,$text) Then WinActivate($title,$text)
- WinWaitActive($title,$text,$timeout)
- EndFunc
- if($CmdLine[0] == 0) Then
- MsgBox(262144, "ERROR", "Needs one tag parameter to remove")
- Exit
- EndIf
- ;_WinWaitActivate("Todoist","")
- Send("{ALTDOWN}")
- MouseClick("left")
- Send("{ALTUP}")
- sleep(175) ;150
- MouseClick("left")
- sleep(150)
- Send('^a')
- sleep(100)
- Send('^c')
- sleep(200)
- Send('^c')
- sleep(200)
- Local $TAG = $CmdLine[1]
- Local $LEN_TAG = StringLen($TAG)
- Local $STR_to_look_for_tags = ClipGet()
- Local $LEN_str_to_look_for_tags = StringLen($STR_to_look_for_tags)
- Local $pos = StringInStr($STR_to_look_for_tags, $TAG)
- If($pos <> 0) Then
- ;$final = StringRegExpReplace($STR_to_look_for_tags, "\@" & $TAG, "") ;old method
- ;MsgBox(262144, "DEBUG", $final)
- ;Send($final)
- ;Send('^c')
- Local $padding = 0
- if($LEN_str_to_look_for_tags/2 < $pos) Then
- Send('^{END}')
- sleep(50)
- $pos = $LEN_str_to_look_for_tags - $pos
- $DIRECTION = '{LEFT}'
- Else
- Send('^{HOME}')
- sleep(50)
- $DIRECTION = '{RIGHT}'
- $padding = 2
- EndIf
- For $i = 1 To ($pos-$padding)
- Send($DIRECTION)
- sleep(10) ;old (25)
- Next
- For $i = 0 To $LEN_TAG
- ;Send('X') ;If the positioning is off, use this to send Xs to find out where the cursor is
- Send('{DELETE}')
- sleep(10) ;old(25)
- Next
- Else
- Send('{END}')
- Send(' @'& $TAG & ' ')
- EndIf
- sleep(100+66*$LEN_TAG)
- Send('{ENTER}{ENTER}')
- Exit
Add Comment
Please, Sign In to add comment