Help needed with script

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ahkuser_gaby
Posts: 1
Joined: 28 Mar 2023, 17:46

Help needed with script

Post by ahkuser_gaby » 28 Mar 2023, 17:53

Hi,

I'm new to AHK and to the forum, I'm working on a project where I have an excel document with a list of email address. I've managed to get AHK to search for those email address in an intranet website and that pulls the user profile. Now, I also need to check that those profiles do not have a "J-" status, so I've also managed to get AHK to use ^f and search for "J-"
Now where I'm stuck is after that ^f result.
What I need to do is:
If the profile has a J- status, I need to log it and continue with the next email search
If the profile does not have a J- status, I need to click on "Mark for Deletion"

I know my script is good and able to mark for deletion because I've tested that part , but I just need help with the if/else part (or if you can suggest anything better, I'd appreciated it)

here's what I have so far:

Code: Select all

        Send, ^f
	Sleep, 200
	SendInput, J-
	Sleep, 200

	If ..........--> I'm also not sure what to use here, I tried errorlevel, ifwinexist, with no success
	{
	FormatTime, tmstamp
	FileAppend, %emailid%: employee has a J Visa - %emailid% on %tmstamp%`n, C:\Users\...path for the notepad log...\Log.txt
	Sleep 200
	} 
	
	else
	{
	Sleep, 200
	Send, ^f
	Sleep, 200
	SendInput, Mark for Deletion
	Sleep, 200

[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]

Return to “Ask for Help (v1)”