[error] Unclosed 'if' (at command #4)

Trying to make a macro that will only run a script if the value of the CSV is “x”.
I found a helpful topic with a similar end goal, using the if command and
target = !(storedVars[‘var1’]==storedVars[‘var2’])
However when I try this and any combination of this I get the error "Unclosed ‘if’ (at command #4).

Can you please post the complete macro? It sounds like you missed “endif”.

csvRead | rent and charges - type.csv |
type | id=phSearchInput | ${!COL1}
store | Standard | var1
storeText | id=phSearchInput | var2
if | (storedVars[‘var1’]==storedVars[‘var2’])
click | id=pg:frm:pb:pbSecInfo:secItem:ddlRentType
select | id=pg:frm:pb:pbSecInfo:secItem:ddlRentType | label=Gross
endif | (storedVars[‘var1’]==!storedVars[‘var2’])

I can’t store the column data from the CSV directly into a var, so I have it set to type the data in a form on the page, then store it from there (var2). Trying to match this to what the drop down menu options are (“Standard” is one such option). If the data from the csv = Standard, for example, then choose this option from the drop down menu.

I added the endif, but now I get the error message : “Error in runEval condition of if: Invalid or unexpected token”

Thanks, I’m new, thanks for your help.