[SOLVED] Conditional Scrolling / Scripting

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
Lightja
Posts: 20
Joined: Tue Aug 30, 2016 3:40 am

[SOLVED] Conditional Scrolling / Scripting

Post by Lightja » Sat Sep 03, 2016 11:23 am

So I'm trying to make a script that follows the followers of someone else on Pinterest. So for example, take this page for instance.

I want to follow all of his followers, but can only do 200 follows/hour. It works out nice and easily because doing the same TAG command over and over follows a new person each time since clicking "FOLLOW" removes one of the "FOLLOW" buttons. The problem I'm having is that once I've followed like ~40-50 people, the next time I load the page, I wont see any "FOLLOW" buttons unless I scroll. After ~150-200 followers (which happens the 2nd time I run it and beyond), I have to scroll twice. The more people I follow, the more times I have to scroll. One scroll command isn't enough because only chunks of the total followers load each time you scroll to the bottom.

So ideally, what I'd do is to look for a "FOLLOW" button with the following command:

Code: Select all

TAG POS=1 TYPE=BUTTON ATTR=TXT:Follow&&CLASS:Button<SP>FollowButton<SP>Module<SP>UserFollowButton<SP>btn<SP>gridItem<SP>hasText<SP>notNavigatable<SP>rounded&&DATA-ELEMENT-TYPE:62
if this command returns error 1300 (meaning no "FOLLOW" button is found), then I'd scroll, and try again. As soon as I find a "FOLLOW" button, then I'd do all my following. Alternatively, if I hit the end of the page, I'd like to end the script, or try a different user's followers.

Are there any non-scripting methods for doing this? I did look into using EVAL() based on chivracq's recommendation on my other thread, where it was recommended for a conditional refresh, and it seems like it might be able to do this somehow, but I'm having a hard time understanding how EVAL() works exactly. It seems like it basically just injects javascript into iim somehow, but I'm not quite sure how it applies.

Now, regarding scripting / the scripting interface, the other thing I did was try to write a C# program using the Scripting Interface. Everything was working fine, and it seemed like a perfect solution until I tried to call "URL GOTO=javascript:window.scrollBy(0,20000)" from a C# script. Not sure if I can't call js from C# or what, but I was able to log into pinterest, go to that page, but just couldn't scroll down using the command I usually use inside a .iim macro. Are there alternative methods for scrolling? A way to get this line working in a C# script? Now I went to C# because that's the language I've spent the most time with, however I am completely open to just doing javascript or some other language if that's what people recommend. The scripting isn't complex enough in general to justify using my own language when I could get support with a different language from more people.

So to summarize, my questions are:
1. Is there a way to scroll the screen when a TAG command fails without using scripting interface? Using EVAL()? Maybe someone can help explain how if so
2. Is there a way to get the "URL GOTO=javascript:window.scrollBy(0,20000)" command working from within a C# interface (was the only .iim line that didn't work within my C# script), or use another command that does the same thing?
3. What's the most commonly used imacros scripting language? Or rather, the one I can find most examples of, and get the most community support with. Seems like javascript, but I just want to be sure.

Sorry if this should be in the "Scripting and Command Line Interface" subforum, but I thought it had enough questions about how to do this without scripting, and the scripting questions weren't specific or numerous enough to justify posting it there, and I don't want to spam by posting in both. Any advice is greatly appreciated.

System Information:
iMacros 11.1 + iMacros browser
Windows 10
latest Firefox/Chrome browser & extension are options too
Last edited by Lightja on Mon Sep 05, 2016 5:25 am, edited 1 time in total.
Latest System Information:
iMacros 11.1
Windows 10 Enterprise
Firefox v48.0.2 - iMacros for Firefox v8.9.7
Chrome v53.0.2785.89 - iMacros for Chrome v8.4.4
chivracq
Posts: 9309
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Conditional Scrolling / Scripting

Post by chivracq » Sat Sep 03, 2016 5:25 pm

Lightja wrote:So I'm trying to make a script that follows the followers of someone else on Pinterest. So for example, take this page for instance.

I want to follow all of his followers, but can only do 200 follows/hour. It works out nice and easily because doing the same TAG command over and over follows a new person each time since clicking "FOLLOW" removes one of the "FOLLOW" buttons. The problem I'm having is that once I've followed like ~40-50 people, the next time I load the page, I wont see any "FOLLOW" buttons unless I scroll. After ~150-200 followers (which happens the 2nd time I run it and beyond), I have to scroll twice. The more people I follow, the more times I have to scroll. One scroll command isn't enough because only chunks of the total followers load each time you scroll to the bottom.

So ideally, what I'd do is to look for a "FOLLOW" button with the following command:

Code: Select all

TAG POS=1 TYPE=BUTTON ATTR=TXT:Follow&&CLASS:Button<SP>FollowButton<SP>Module<SP>UserFollowButton<SP>btn<SP>gridItem<SP>hasText<SP>notNavigatable<SP>rounded&&DATA-ELEMENT-TYPE:62
if this command returns error 1300 (meaning no "FOLLOW" button is found), then I'd scroll, and try again. As soon as I find a "FOLLOW" button, then I'd do all my following. Alternatively, if I hit the end of the page, I'd like to end the script, or try a different user's followers.

Are there any non-scripting methods for doing this? I did look into using EVAL() based on chivracq's recommendation on my other thread, where it was recommended for a conditional refresh, and it seems like it might be able to do this somehow, but I'm having a hard time understanding how EVAL() works exactly. It seems like it basically just injects javascript into iim somehow, but I'm not quite sure how it applies.

Now, regarding scripting / the scripting interface, the other thing I did was try to write a C# program using the Scripting Interface. Everything was working fine, and it seemed like a perfect solution until I tried to call "URL GOTO=javascript:window.scrollBy(0,20000)" from a C# script. Not sure if I can't call js from C# or what, but I was able to log into pinterest, go to that page, but just couldn't scroll down using the command I usually use inside a .iim macro. Are there alternative methods for scrolling? A way to get this line working in a C# script? Now I went to C# because that's the language I've spent the most time with, however I am completely open to just doing javascript or some other language if that's what people recommend. The scripting isn't complex enough in general to justify using my own language when I could get support with a different language from more people.

So to summarize, my questions are:
1. Is there a way to scroll the screen when a TAG command fails without using scripting interface? Using EVAL()? Maybe someone can help explain how if so
2. Is there a way to get the "URL GOTO=javascript:window.scrollBy(0,20000)" command working from within a C# interface (was the only .iim line that didn't work within my C# script), or use another command that does the same thing?
3. What's the most commonly used imacros scripting language? Or rather, the one I can find most examples of, and get the most community support with. Seems like javascript, but I just want to be sure.

Sorry if this should be in the "Scripting and Command Line Interface" subforum, but I thought it had enough questions about how to do this without scripting, and the scripting questions weren't specific or numerous enough to justify posting it there, and I don't want to spam by posting in both. Any advice is greatly appreciated.

System Information:

Code: Select all

iMacros 11.1 + iMacros browser
Windows 10
latest Firefox/Chrome browser & extension are options too
Interesting Qt's/Scenario, ah-ah...! (And the 'General' Sub-Forum is OK, no Pb...)

I'll re-quote your 3 Qt's to answer them one by one...
1. Is there a way to scroll the screen when a TAG command fails without using scripting interface? Using EVAL()? Maybe someone can help explain how if so
Yep easy to do in pure '.iim' using 'EVAL()' indeed, the "Idea" is to spit out a "1"/"20000" to reuse for the 'scrollBy()':

Code: Select all

' Check if there is a 'Follow' Button:
SET !EXTRACT NULL
TAG POS=1 TYPE=BUTTON ATTR=TXT:Follow&&CLASS:Button<SP>FollowButton<SP>Module<SP>UserFollowButton<SP>btn<SP>gridItem<SP>hasText<SP>notNavigatable<SP>rounded&&DATA-ELEMENT-TYPE:62 EXTRACT=TXT
' Compute Conditional Scrolling:
SET Cond_Scroll EVAL("var s='{{!EXTRACT}}'; var z; if(s=='#EANF#'){z=20000;} else{z=1;}; z;")
'URL GOTO=javascript:window.scrollBy(0,20000)
URL GOTO=javascript:window.scrollBy(0,{{Cond_Scroll}})
' (Try to) click on 'Follow' Button:
SET !ERRORIGNORE YES
TAG POS=1 TYPE=BUTTON ATTR=TXT:Follow&&CLASS:Button<SP>FollowButton<SP>Module<SP>UserFollowButton<SP>btn<SP>gridItem<SP>hasText<SP>notNavigatable<SP>rounded&&DATA-ELEMENT-TYPE:62
(Tested on iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10-x64.)
2. Is there a way to get the "URL GOTO=javascript:window.scrollBy(0,20000)" command working from within a C# interface (was the only .iim line that didn't work within my C# script), or use another command that does the same thing?
Dunno about the C# part why the 'scrollBy()' doesn't work, any Error Msg...?, maybe you tried to run it on FF with v9.0.3 which has been reported to break the 'URL GOTO=javascript:' Syntax...

Another way to achieve some Scrolling on a Page is to use Keyboard Keys like the 'PgDn' Key for example that you can record/use with iMacros in your Script using the EVENT Mode.
3. What's the most commonly used imacros scripting language? Or rather, the one I can find most examples of, and get the most community support with. Seems like javascript, but I just want to be sure.
Yep, using JavaScript rather than C# will definitely grant you "Access" to a much larger Community of (Advanced) Users, ah-ah...! There is not a lot of Expertise with JavaScript on the iMacros Forum (those Advanced Users don't come very often to the Forum) but the Stackoverflow Forum is then a good Resource.

But, it is possible as well to not use any Scripting Language at all (except a bit of JavaScript in fairly simple 'EVAL()' Statements like the one I posted above) and to code very complex Macros in pure '.iim' like I do. I don't use any single '.js' Script in the about 20,000 Lines of Codes I use for my '.iim' Macros which contain some complex Conditional Behaviour, some form of AI, my Scripts decide by themselves when to run and if and how many times they need to loop, are able to auto-morph if the Site changes and include some Reporting and Logging and Alerting if my Attention might be required...
Have a look at the following Thread where I've explained some of the Techniques I use:
- Workarounds for Conditional Logic in Macro Code
You just need to be a bit "Creative" and you can do great things with iMacros (in pure '.iim'), ah-ah...! :twisted:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Lightja
Posts: 20
Joined: Tue Aug 30, 2016 3:40 am

Re: Conditional Scrolling / Scripting

Post by Lightja » Sat Sep 03, 2016 8:14 pm

interesting. Didn't know you could do quite so much just with Eval(), but I'm starting to understand how it works a little bit better, thanks for elaborating.

As for calling scrollby, I was using Firefox v48.0.2, with the latest iMacros version, so that might have indeed been the problem. Needed multiple profiles and was having issues with IE. Speaking of which, do you use all one browser or occasionally use different macros for different things?

looks like I probably will end up using javascript then. Do you, or rather have you, ever used javascript on its own, or to control the majority of a script, rather than using EVAL? Trying to decide which would work better/faster/etc. It seems like pure .iim would be better so that you don't have to call iimSet() 20 times per macro, but the issues I had with my last "Queue 50 Tumblr posts" macro has made me wary of longer macros. Even in sets of 4 it has issues occasionally, even the shorter ones, so maybe it's just something I'm doing wrong there, I still need to go back and look at it, I just want to get this pinterest macro figured out before I go back.

Thanks for the replies, helps a lot.

EDIT: Looking at the code you provided, it looks like it just scrolls once if it needs to, but the problem is that I might need to scroll 5, 10, 20, 50 times depending on how many people I've already followed. Do I just loop it or something? Not sure how that would work since loops, as far as I know, only work for the entire macro?
Latest System Information:
iMacros 11.1
Windows 10 Enterprise
Firefox v48.0.2 - iMacros for Firefox v8.9.7
Chrome v53.0.2785.89 - iMacros for Chrome v8.4.4
chivracq
Posts: 9309
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Conditional Scrolling / Scripting

Post by chivracq » Sat Sep 03, 2016 9:05 pm

Lightja wrote:interesting. Didn't know you could do quite so much just with Eval(), but I'm starting to understand how it works a little bit better, thanks for elaborating.

As for calling scrollby, I was using Firefox v48.0.2, with the latest iMacros version, so that might have indeed been the problem. Needed multiple profiles and was having issues with IE. Speaking of which, do you use all one browser or occasionally use different macros for different things?

looks like I probably will end up using javascript then. Do you, or rather have you, ever used javascript on its own, or to control the majority of a script, rather than using EVAL? Trying to decide which would work better/faster/etc. It seems like pure .iim would be better so that you don't have to call iimSet() 20 times per macro, but the issues I had with my last "Queue 50 Tumblr posts" macro has made me wary of longer macros. Even in sets of 4 it has issues occasionally, even the shorter ones, so maybe it's just something I'm doing wrong there, I still need to go back and look at it, I just want to get this pinterest macro figured out before I go back.

Thanks for the replies, helps a lot.

EDIT: Looking at the code you provided, it looks like it just scrolls once if it needs to, but the problem is that I might need to scroll 5, 10, 20, 50 times depending on how many people I've already followed. Do I just loop it or something? Not sure how that would work since loops, as far as I know, only work for the entire macro?
Yep, using a (main) '.js' Script is normally the "Standard"/"Royal" way to achieve any Conditional Behaviour with iMacros, I'm probably the only one (except a few "Adepts" I may have helped/"seduced" as well, oops...!) using pure '.iim', and to answer some other Qt of yours, Nope, never used JavaScript on its own, that's why I came up with all my "Techniques" in '.iim' with 'EVAL()' to euh..., avoid JavaScript actually, oops again...!

For Macros to communicate with each others (to pass Variables), or with themselves between 2 Loops as all Vars get reset between 2 Loops, yep you can use 'iimSet()', or like me some mini-Temp Text File as a "fake" (second) DataSource for one Macro while the other one will retrieve its Content if needed and re-write the new Values and replace the old File. You can even use a Macro itself directly as a DataSource for another Macro if the Values are not too Dynamic, '.iim' Macros are Text Files already...

Hum, couldn't really have a look at your 'tumblr' and 'pinterest' Sites as they require an Account, but I thought for 'pinterest' that the Scrolling would be a bit incremental after each or so many 'Follow' Actions, not that you would need to start all over again and would need 50 Scroll Actions, but if that's the case, then easy to achieve some Looping in '.js', can be done in pure '.iim' as well with a mini '.iim' Macro (doing only the 'scrollBy()'), called conditionally from the previous Macro, that can call itself several times until it needs to escape from the Loop to call the next Macro (or it's possible to have a Macro loop automatically a set number of times using Negative Nb's for 'SET !LOOP' (works only on FF I think...)), or you could keep your main Page where you do the incremental Scrolling on TAB_1 and use a second TAB_2 for the 'Follow' Action to avoid having to reload the main Page and scroll 48 times, then 49 times than 50 times, etc...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Lightja
Posts: 20
Joined: Tue Aug 30, 2016 3:40 am

Re: Conditional Scrolling / Scripting

Post by Lightja » Mon Sep 05, 2016 5:24 am

chivracq wrote: Yep, using a (main) '.js' Script is normally the "Standard"/"Royal" way to achieve any Conditional Behaviour with iMacros, I'm probably the only one (except a few "Adepts" I may have helped/"seduced" as well, oops...!) using pure '.iim', and to answer some other Qt of yours, Nope, never used JavaScript on its own, that's why I came up with all my "Techniques" in '.iim' with 'EVAL()' to euh..., avoid JavaScript actually, oops again...!

For Macros to communicate with each others (to pass Variables), or with themselves between 2 Loops as all Vars get reset between 2 Loops, yep you can use 'iimSet()', or like me some mini-Temp Text File as a "fake" (second) DataSource for one Macro while the other one will retrieve its Content if needed and re-write the new Values and replace the old File. You can even use a Macro itself directly as a DataSource for another Macro if the Values are not too Dynamic, '.iim' Macros are Text Files already...

Hum, couldn't really have a look at your 'tumblr' and 'pinterest' Sites as they require an Account, but I thought for 'pinterest' that the Scrolling would be a bit incremental after each or so many 'Follow' Actions, not that you would need to start all over again and would need 50 Scroll Actions, but if that's the case, then easy to achieve some Looping in '.js', can be done in pure '.iim' as well with a mini '.iim' Macro (doing only the 'scrollBy()'), called conditionally from the previous Macro, that can call itself several times until it needs to escape from the Loop to call the next Macro (or it's possible to have a Macro loop automatically a set number of times using Negative Nb's for 'SET !LOOP' (works only on FF I think...)), or you could keep your main Page where you do the incremental Scrolling on TAB_1 and use a second TAB_2 for the 'Follow' Action to avoid having to reload the main Page and scroll 48 times, then 49 times than 50 times, etc...
It's not that you have to scroll again, it's that the full page doesn't load when you scroll to the bottom. Once you scroll to the bottom, ~100 or so additional followers load, and to load more, you need to scroll again. So to see all 5000 followers, you need to scroll 50 times total. So if I've followed 2000/5000, I need to scroll 20 times. If i've followed 200/5000, I need to scroll 2 times. I just want the code to be able to determine how many times I need to scroll. You can actually look at the page I provided here and see the behavior without an account. A window will popup asking you to login, but you can still scroll with the window there to see the behavior I'm talking about.

As for deciding what to do, I've decided to go with javascript rather than trying to work within EVAL() commands because it's more familiar for me to work with code anyways. I opened a thread here asking how to create a .js that is callable from command line so that I can use it in batch files for the Windows task scheduler. As for how to do what I'm trying to do, that won't be too problematic, mostly because I found this stackexchange post that basically does what I ask with the doesElementExist() command:

Code: Select all

function doesElementExist() {
    iimDisplay('Checking if a REMOVED has loaded, or not.');
    var code = iimPlay('CODE: SET !TIMEOUT_TAG 1\n'
        + 'TAG POS=1 TYPE=DIV ATTR=TXT:REMOVED<SP>REMOVED<SP>-<SP>REMOVED');
    if (code !==1) {
        return false;
    }
    var extract = iimGetLastExtract(1);
    if (extract === '#EANF#') {
        return false;
    }
    return true;
}
Which, if returns true for the call to tag the follow button, means I don't have to scroll. If it returns false, then I need to scroll, or check if I'm already at the bottom of the page and have followed everyone already.

Thanks for the advice, this problem has been solved, I just need help with my new question on getting started with javascript by figuring out how to call .js for iMacros scripts from the command line for batch files.
Latest System Information:
iMacros 11.1
Windows 10 Enterprise
Firefox v48.0.2 - iMacros for Firefox v8.9.7
Chrome v53.0.2785.89 - iMacros for Chrome v8.4.4
DH123
Posts: 26
Joined: Sat Dec 14, 2019 5:40 am

Re: Conditional Scrolling / Scripting

Post by DH123 » Sat Dec 14, 2019 6:28 am

Code: Select all

' Check if there is a 'Follow' Button:
SET !EXTRACT NULL
TAG POS=1 TYPE=BUTTON ATTR=TXT:Follow&&CLASS:Button<SP>FollowButton<SP>Module<SP>UserFollowButton<SP>btn<SP>gridItem<SP>hasText<SP>notNavigatable<SP>rounded&&DATA-ELEMENT-TYPE:62 EXTRACT=TXT
' Compute Conditional Scrolling:
SET Cond_Scroll EVAL("var s='{{!EXTRACT}}'; var z; if(s=='#EANF#'){z=20000;} else{z=1;}; z;")
'URL GOTO=javascript:window.scrollBy(0,20000)
URL GOTO=javascript:window.scrollBy(0,{{Cond_Scroll}})
' (Try to) click on 'Follow' Button:
SET !ERRORIGNORE YES
TAG POS=1 TYPE=BUTTON ATTR=TXT:Follow&&CLASS:Button<SP>FollowButton<SP>Module<SP>UserFollowButton<SP>btn<SP>gridItem<SP>hasText<SP>notNavigatable<SP>rounded&&DATA-ELEMENT-TYPE:62
(Tested on iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10-x64.)

Hi,

I wanted to achieve the same auto-scroll but with js

this code working good with iim

Code: Select all

SET !EXTRACT NULL
TAG POS=15 TYPE=A ATTR=ID:__w2_*_link&&class:question_link EXTRACT=href
PROMPT {{!EXTRACT}}
wait Seconds=4	
SET Cond_Scroll EVAL("var s='{{!EXTRACT}}'; var z; if(s=='#EANF#'){z=20000;} else{z=1;}; z;")
URL GOTO=javascript:window.scrollBy(0,{{Cond_Scroll}})

but don't know how to convert this below code to js

Code: Select all

SET Cond_Scroll EVAL("var s='{{!EXTRACT}}'; var z; if(s=='#EANF#'){z=20000;} else{z=1;}; z;")
i tried this one below but getting error with " and ' quotation mark, i dont know how to allow multiple quotaion in single line of code

Code: Select all

var inner;
inner = "CODE:";
inner += 'SET Cond_Scroll EVAL("var s='{{!EXTRACT}}'; var z; if(s=='#EANF#'){z=20000;} else{z=1;}; z;")' + '\n';
can anyone help me?
chivracq
Posts: 9309
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Conditional Scrolling / Scripting

Post by chivracq » Sat Dec 14, 2019 11:28 am

DH123 wrote:
Sat Dec 14, 2019 6:28 am

Code: Select all

' Check if there is a 'Follow' Button:
SET !EXTRACT NULL
TAG POS=1 TYPE=BUTTON ATTR=TXT:Follow&&CLASS:Button<SP>FollowButton<SP>Module<SP>UserFollowButton<SP>btn<SP>gridItem<SP>hasText<SP>notNavigatable<SP>rounded&&DATA-ELEMENT-TYPE:62 EXTRACT=TXT
' Compute Conditional Scrolling:
SET Cond_Scroll EVAL("var s='{{!EXTRACT}}'; var z; if(s=='#EANF#'){z=20000;} else{z=1;}; z;")
'URL GOTO=javascript:window.scrollBy(0,20000)
URL GOTO=javascript:window.scrollBy(0,{{Cond_Scroll}})
' (Try to) click on 'Follow' Button:
SET !ERRORIGNORE YES
TAG POS=1 TYPE=BUTTON ATTR=TXT:Follow&&CLASS:Button<SP>FollowButton<SP>Module<SP>UserFollowButton<SP>btn<SP>gridItem<SP>hasText<SP>notNavigatable<SP>rounded&&DATA-ELEMENT-TYPE:62
(Tested on iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10-x64.)

Hi,

I wanted to achieve the same auto-scroll but with js

this code working good with iim

Code: Select all

SET !EXTRACT NULL
TAG POS=15 TYPE=A ATTR=ID:__w2_*_link&&class:question_link EXTRACT=href
PROMPT {{!EXTRACT}}
wait Seconds=4	
SET Cond_Scroll EVAL("var s='{{!EXTRACT}}'; var z; if(s=='#EANF#'){z=20000;} else{z=1;}; z;")
URL GOTO=javascript:window.scrollBy(0,{{Cond_Scroll}})

but don't know how to convert this below code to js

Code: Select all

SET Cond_Scroll EVAL("var s='{{!EXTRACT}}'; var z; if(s=='#EANF#'){z=20000;} else{z=1;}; z;")
i tried this one below but getting error with " and ' quotation mark, i dont know how to allow multiple quotaion in single line of code

Code: Select all

var inner;
inner = "CODE:";
inner += 'SET Cond_Scroll EVAL("var s='{{!EXTRACT}}'; var z; if(s=='#EANF#'){z=20000;} else{z=1;}; z;")' + '\n';
can anyone help me?

(F)CIM...! :mrgreen: (Read my Sig...)

Hum, from a quick look, this one looks fine to me...:

Code: Select all

inner += 'SET Cond_Scroll EVAL("var s='{{!EXTRACT}}'; var z; if(s=='#EANF#'){z=20000;} else{z=1;}; z;")' + '\n';
Hum..., and what "Error" do you get with this Line...?

... But mention your FCI for me to do any "Thinking"... (Always a good "Idea" to read the Forum Rules when you join a Tech Forum... :idea: )
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
DH123
Posts: 26
Joined: Sat Dec 14, 2019 5:40 am

Re: Conditional Scrolling / Scripting

Post by DH123 » Sat Dec 14, 2019 11:44 am

(F)CIM...! :mrgreen: (Read my Sig...)

Hum, from a quick look, this one looks fine to me...:

Code: Select all

inner += 'SET Cond_Scroll EVAL("var s='{{!EXTRACT}}'; var z; if(s=='#EANF#'){z=20000;} else{z=1;}; z;")' + '\n';
Hum..., and what "Error" do you get with this Line...?

... But mention your FCI for me to do any "Thinking"... (Always a good "Idea" to read the Forum Rules when you join a Tech Forum... :idea: )
[/quote]


Okay Thanks, here is FCIM details

VERSION BUILD=1005 RECORDER=CR
Chrome version 78.0.3904.108
windows 10

i'm getting syntex error

Code: Select all

inner += "SET Cond_Scroll EVAL('var s=\"{{!EXTRACT}}\"; var z; if(s==\"#EANF#\"){z=20000;} else{z=1;}; z;')" + "\n";
can you find mistake?
chivracq
Posts: 9309
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Conditional Scrolling / Scripting

Post by chivracq » Sat Dec 14, 2019 11:58 am

DH123 wrote:
Sat Dec 14, 2019 11:44 am
(F)CIM...! :mrgreen: (Read my Sig...)

Hum, from a quick look, this one looks fine to me...:

Code: Select all

inner += 'SET Cond_Scroll EVAL("var s='{{!EXTRACT}}'; var z; if(s=='#EANF#'){z=20000;} else{z=1;}; z;")' + '\n';
Hum..., and what "Error" do you get with this Line...?

... But mention your FCI for me to do any "Thinking"... (Always a good "Idea" to read the Forum Rules when you join a Tech Forum... :idea: )

Okay Thanks, here is FCIM details

Code: Select all

VERSION BUILD=1005 RECORDER=CR
Chrome version 78.0.3904.108
windows 10
i'm getting syntex error

Code: Select all

inner += "SET Cond_Scroll EVAL('var s=\"{{!EXTRACT}}\"; var z; if(s==\"#EANF#\"){z=20000;} else{z=1;}; z;')" + "\n";
can you find mistake?

'Free'/'PE' is still missing from your FCI...

"synt[e|a]x error" is still not the exact Error you are getting... :roll:

But OK, anyway, '.js' Scripts are not supported in v10.0.5 for CR, only iMacros for FF up to v9.0.3 (and earlier) supports '.js' Scripts.

=> Even if you were "switching" to FF with "currently" FF70/71, it requires iMacros for FF v10.0.2 which doesn't support (anymore) '.js' Scripts either, you would need to use FF up to FF56 (recommended FF v55.0.3 or one of the Browsers based on FF that didn't adopt WebExtensions) + iMacros for FF v8.9.7 (rather than v9.0.3) for '.js' Scripts to be supported.
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
DH123
Posts: 26
Joined: Sat Dec 14, 2019 5:40 am

Re: Conditional Scrolling / Scripting

Post by DH123 » Sat Dec 14, 2019 12:31 pm

chivracq wrote:
Sat Dec 14, 2019 11:58 am

'Free'/'PE' is still missing from your FCI...

"synt[e|a]x error" is still not the exact Error you are getting... :roll:

But OK, anyway, '.js' Scripts are not supported in v10.0.5 for CR, only iMacros for FF up to v9.0.3 (and earlier) supports '.js' Scripts.

=> Even if you were "switching" to FF with "currently" FF70/71, it requires iMacros for FF v10.0.2 which doesn't support (anymore) '.js' Scripts either, you would need to use FF up to FF56 (recommended FF v55.0.3 or one of the Browsers based on FF that didn't adopt WebExtensions) + iMacros for FF v8.9.7 (rather than v9.0.3) for '.js' Scripts to be supported.
okay great, switched to FF and corrected some part of code
i have used this

Code: Select all

FF54.0.1 + v8.9.7 FREE + windows 10

Code: Select all

inner += "SET Cond_Scroll EVAL(\"var s='{{!EXTRACT}}'; var z; if(s=='#EANF#'){z=20000;} else{z=1;}; z; \"var randomNumber=Math.floor(Math.random()*2+ 3); randomNumber;\" \")" + "\n";
it's working now, thanks for the help
Last edited by DH123 on Sun Dec 15, 2019 9:47 am, edited 1 time in total.
chivracq
Posts: 9309
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Conditional Scrolling / Scripting

Post by chivracq » Sat Dec 14, 2019 12:39 pm

DH123 wrote:
Sat Dec 14, 2019 12:31 pm
okay great, switched to FF and corrected some part of code

Code: Select all

inner += "SET Cond_Scroll EVAL(\"var s='{{!EXTRACT}}'; var z; if(s=='#EANF#'){z=20000;} else{z=1;}; z; \"var randomNumber=Math.floor(Math.random()*2+ 3); randomNumber;\" \")" + "\n";
it's working now, thanks for the help

Ah OK, that was quick...! And good to hear that it's now working, (even if you could mention in which FCI exactly you've got it to work...), and Thanks for sharing the "working" Script... :D

That was an Interesting Thread actually, hum, from 3 years ago already...! 8) , nice to see/hear that this Solution still works... :D

(And you've also managed to get the ']QUOTE[' Forum Tags to work, also good...! :wink: )
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
DH123
Posts: 26
Joined: Sat Dec 14, 2019 5:40 am

Re: Conditional Scrolling / Scripting

Post by DH123 » Sun Dec 15, 2019 9:40 am

DH123 wrote:
Sat Dec 14, 2019 12:31 pm

okay great, switched to FF and corrected some part of code
i have used FF54.0.1 + v8.9.7 FREE + windows 10
Post Reply