If I understand you correctly, you basically need a variable that is stored “forever” and does not get deleted after macro run (global variables can do this) but also not after Kantu is closed.
If you want your data to survive a closing of Kantu, then store (“persist”) it in a CSV file with csvSave and csvRead.
Here is a macro that works. It stores the value in the csv file “csvBucket” and reads the latest value at each run. You can simply copy and paste this code into the “JSON” tab of Kantu:
{
"CreationDate": "2018-5-23",
"Commands": [
{
"Command": "open",
"Target": "https://www.typeform.com/help/sandbox/",
"Value": ""
},
{
"Command": "store",
"Target": "true",
"Value": "!errorignore"
},
{
"Command": "comment",
"Target": "read once to get # of lines",
"Value": "!errorignore"
},
{
"Command": "csvRead",
"Target": "csvBucket",
"Value": ""
},
{
"Command": "if",
"Target": "!${!statusOk}",
"Value": ""
},
{
"Command": "comment",
"Target": "csv does not yet exist",
"Value": "varForever"
},
{
"Command": "store",
"Target": "0",
"Value": "!csvLine"
},
{
"Command": "store",
"Target": "0",
"Value": "varForever"
},
{
"Command": "csvSave",
"Target": "csvBucket",
"Value": ""
},
{
"Command": "else",
"Target": "",
"Value": ""
},
{
"Command": "comment",
"Target": "read the LAST line of the csv",
"Value": ""
},
{
"Command": "store",
"Target": "${!csvReadMaxRow}",
"Value": "!csvReadLineNumber"
},
{
"Command": "csvRead",
"Target": "csvBucket",
"Value": ""
},
{
"Command": "comment",
"Target": "Assign CSV value to variable",
"Value": ""
},
{
"Command": "store",
"Target": "${!COL1}",
"Value": "varForever"
},
{
"Command": "endif",
"Target": "",
"Value": ""
},
{
"Command": "store",
"Target": "false",
"Value": "!errorignore"
},
{
"Command": "comment",
"Target": "Increment counter and save new value",
"Value": ""
},
{
"Command": "storeEval",
"Target": "${varForever} + 1",
"Value": "varForever"
},
{
"Command": "store",
"Target": "${varForever}",
"Value": "!csvLine"
},
{
"Command": "csvSave",
"Target": "csvBucket",
"Value": ""
},
{
"Command": "comment",
"Target": "done! - now use the new value",
"Value": ""
},
{
"Command": "echo",
"Target": "New value is ${varForever}",
"Value": "green"
},
{
"Command": "type",
"Target": "id=search",
"Value": "${varForever}"
}
]
}