I am currently stuck on trying to figure out how the expression IF statement works in Pulover's Macro Creator v5.0.5. The script below is a simple test I made before I expand my idea into a bigger macro. What should happen with this script is the following: 1) Click on a certain cell in Excel, copy the cell (the content of the cell is the number 00065845). 2) That cells data is now on the clipboard; turn the current clipboard into a variable called CopiedData. 3) IF statement that evaluates if CopiedData = the number 00065845. If it does, pop up a message box that says "IT WORKS".
The problem here is that I cannot get this to work in PMC. When I export the macro to .ahk and remove the ( ) and { } from the IF statement, the macro works as intended and the pop up box shows up. There is definitely some kind of formatting issue I am missing but I have no idea what it is. I've tried CopiedData = 00065845, CopiedData = "00065845", %CopiedData% = 00065845, and %CopiedData% = "00065845" all to no avail. Here is a picture of the expression if statement window. I also tried the clipboard IF statement in the dropdown menu (see this picture) but couldn't get that to work either.
PMC version of macro with ( ) and { } in the IF statement; does not function as intended. Here is an image of the left command box
Code: Select all
WinActivate, Microsoft Excel - UOC_STUDENT_EXEMPT_1021051812.xlsx ahk_class XLMAIN
Sleep, 203
Click, 918, 221 Left, 1
Sleep, 93
Send, {Control Down}{c}{Control Up}
Sleep, 300
CopiedData := clipboard
Sleep, 300
If (CopiedData = 00065845)
{
Sleep, 300
MsgBox, 0, Box1, IT WORKS
Sleep, 300
}
Code: Select all
WinActivate, Microsoft Excel - UOC_STUDENT_EXEMPT_1021051812.xlsx ahk_class XLMAIN
Sleep, 203
Click, 918, 221 Left, 1
Sleep, 93
Send, {Control Down}{c}{Control Up}
Sleep, 300
CopiedData := clipboard
Sleep, 300
If CopiedData = 00065845
Sleep, 300
MsgBox, 0, Box1, IT WORKS
Sleep, 300