You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sequence
store | true | !StatusOK
Doesn't store true. It stores "true" witch is FALSE. Boolean(true), boolean(true), Boolean(1) or boolean(1) also don't work they are all stores between "" as text. So I couldnt find anyway to change the !StatusOK to true, in my code I just changed my if to ${!LastCommandOK}
I will send in other both the JSON and the HTML (+ autorun) since in the other post people were doing the same.
<script>
(function() {
var isExtensionLoaded = function () {
const $root = document.documentElement
return !!$root && !!$root.getAttribute('data-kantu')
}
var increaseCountInUrl = function (max) {
var url = new URL(window.location.href)
var count = 1 + (url.searchParams.get('reload') || 0)
url.searchParams.set('reload', count)
var nextUrl = url.toString()
var shouldStop = count > max
return [shouldStop, !shouldStop ? nextUrl : null]
}
var run = function () {
try {
var evt = new CustomEvent('kantuSaveAndRunMacro', { detail: { html: document.documentElement.outerHTML, storageMode: 'browser' } })
window.dispatchEvent(evt)
setInterval(() => window.dispatchEvent(evt), 1000);
if (window.location.protocol === 'file:') {
var onInvokeSuccess = function () {
clearTimeout(timer)
clearTimeout(reloadTimer)
window.removeEventListener('kantuInvokeSuccess', onInvokeSuccess)
}
var timer = setTimeout(function () {
alert('Error #203: It seems you need to turn on *Allow access to file URLs* for Kantu in your browser extension settings.')
}, 8000)
window.addEventListener('kantuInvokeSuccess', onInvokeSuccess)
}
} catch (e) {
alert('Kantu Bookmarklet error: ' + e.toString());
}
}
var reloadTimer = null
var main = function () {
if (isExtensionLoaded()) return run()
var MAX_TRY = 3
var INTERVAL = 1000
var tuple = increaseCountInUrl(MAX_TRY)
if (tuple[0]) {
return alert('Error #204: It seems Kantu is not installed yet - or you need to turn on *Allow access to file URLs* for Kantu in your browser extension settings.')
} else {
reloadTimer = setTimeout(function () {
window.location.href = tuple[1]
}, INTERVAL)
}
}
main()
})();
</script>
The text was updated successfully, but these errors were encountered:
Try putting store | true | !StatusOK right before your if. You must have an error between that and your if. I just tested and it stored as expected. I'm on v5.2.3
There is indeed a small issue with store | true | !statusOK - due to this bug the RPA logic adds "" around the true or false. We will fix this asap. Meanwhile the workaround is to use executeScript_Sandbox to set !statusOK:
The sequence
store | true | !StatusOK
Doesn't store true. It stores "true" witch is FALSE. Boolean(true), boolean(true), Boolean(1) or boolean(1) also don't work they are all stores between "" as text. So I couldnt find anyway to change the !StatusOK to true, in my code I just changed my if to ${!LastCommandOK}
I will send in other both the JSON and the HTML (+ autorun) since in the other post people were doing the same.
JSON
{
"Name": "test 1 if -3",
"CreationDate": "2019-10-16",
"Commands": [
{
"Command": "open",
"Target": "https://gogoanime.video/",
"Value": ""
},
{
"Command": "store",
"Target": "1",
"Value": "i"
},
{
"Command": "while_v2",
"Target": "(${i} <=18)",
"Value": "i"
},
{
"Command": "store",
"Target": "true",
"Value": "!errorIgnore"
},
{
"Command": "store",
"Target": "true",
"Value": "!STATUSOK"
},
{
"Command": "echo",
"Target": "Loop=${i}",
"Value": "blue"
},
{
"Command": "storeText",
"Target": "xpath=//[@id="load_recent_release"]/div[2]/ul/li[${i}]/p[2]",
"Value": "x"
},
{
"Command": "echo",
"Target": "${x}",
"Value": "red"
},
{
"Command": "assertText",
"Target": "xpath=//[@id="load_recent_release"]/div[2]/ul/li[${i}]/p[2]",
"Value": "3"
},
{
"Command": "if_v2",
"Target": "${!statusOK} == true",
"Value": ""
},
{
"Command": "echo",
"Target": "YES",
"Value": "blue"
},
{
"Command": "else",
"Target": "",
"Value": ""
},
{
"Command": "echo",
"Target": "NAO",
"Value": "red"
},
{
"Command": "end",
"Target": "",
"Value": ""
},
{
"Command": "executeScript",
"Target": "return Number(${i})+1",
"Value": "i"
},
{
"Command": "end",
"Target": "",
"Value": ""
},
{
"Command": "echo",
"Target": "done!",
"Value": "green"
}
]
}
HTML (+autorun)
<title>test 1 if -3</title>}
var run = function () {
try {
var evt = new CustomEvent('kantuSaveAndRunMacro', { detail: { html: document.documentElement.outerHTML, storageMode: 'browser' } })
}
var reloadTimer = null
var main = function () {
if (isExtensionLoaded()) return run()
}
main()
})();
</script>
The text was updated successfully, but these errors were encountered: