Imacros (javascript) getting variable value from custom input dialog

Discussions and Tech Support specific to the iMacros Firefox add-on.
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
gardin
Posts: 21
Joined: Thu Jan 14, 2021 1:57 am

Imacros (javascript) getting variable value from custom input dialog

Post by gardin » Thu Jan 14, 2021 2:19 am

I am trying to find a way to create custom user input dialog with imacros (javascript).

However while the dialog itself could be done, say,

with javascript
Image

or jQuery
Image

No luck in getting the variable to be used "outside". It keeps saying variable is not defined, or illegal syntax (see i am trying to alert "a" variable outside)

Is there any way to get around this issue, attaining the goal? Or i am doing it wrong?

The main issue is on how to create custom modal pop up, and use the stored value inputted by user elsewhere.

Code: Select all

var html = "<div class='dbm' class='dbm' style='padding:10px;background-color:gray;color:white;top:80px;position:absolute;right:500px;border:1px solid black;z-index:1000;'><table width='100%' class='table'><tr><td>Type : </td><td><input name='tipe' checked value='1' type='radio'>&nbsp;Image <input name='tipe' value='2' type='radio'>&nbsp;File</td></tr><tr><td>Text1 : </td><td><input style='color:black !important;' value='2' type='text' class='c' /></tr><tr><td>Text2 : </td><td><input value='0' style='color:black !important;' type='text' class='d' /></tr><tr><td>Text3 : </td><td><input value='0' style='color:black !important;' type='text' class='e' /></tr><tr><td>Textarea : </td><td><textarea style='color:black !important;' class='r'></textarea></td></tr><tr><td colspan='2' align='center'><input class='btn btn-primary b1' style='color:white;background-color:orange !important' type='submit' value='Mulai' onclick=\"javascript:(function(){ var a=document.getElementsByClassName('c');a=a[0]; alert(a.value); }) ()\" /><input class='b2 btn btn-primary' onclick=\"javascript:(function(){var dbm=window.content.document.getElementsByClassName('dbm');dbm[0].innerHTML='' ; }) ()\" style='background-color:blue;color:white; !important' type='submit' value='Close' /></td></tr></table></div>";

var document=window.document;
//window.content.document.getElementsByClassName('dbm')[0].innerHTML = "";
document.body.innerHTML += (html);
alert(a);
P.S: I am using imacros 8.9.7 run in Firefox 56, Windows 7 (classic mode)
chivracq
Posts: 9766
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Imacros (javascript) getting variable value from custom input dialog

Post by chivracq » Thu Jan 14, 2021 2:32 am

gardin wrote:
Thu Jan 14, 2021 2:19 am
I am trying to find a way to create custom user input dialog with imacros (javascript).

However while the dialog itself could be done, say,

with javascript

Code: Select all

[url=https://i.stack.imgur.com/WBNLZ.png]https://i.stack.imgur.com/BGb8g.jpg[/url]
or jQuery

Code: Select all

[url=https://i.stack.imgur.com/WBNLZ.png][img]https://i.stack.imgur.com/WBNLZ.png[/img][/url]
No luck in getting the variable to be used "outside". It keeps saying variable is not defined, or illegal syntax (see i am trying to alert "a" variable outside)

Is there any way to get around this issue, attaining the goal? Or i am doing it wrong?

The main issue is on how to create custom modal pop up, and use the stored value inputted by user elsewhere.

Code: Select all

var html = "<div class='dbm' class='dbm' style='padding:10px;background-color:gray;color:white;top:80px;position:absolute;right:500px;border:1px solid black;z-index:1000;'><table width='100%' class='table'><tr><td>Type : </td><td><input name='tipe' checked value='1' type='radio'>&nbsp;Image <input name='tipe' value='2' type='radio'>&nbsp;File</td></tr><tr><td>Text1 : </td><td><input style='color:black !important;' value='2' type='text' class='c' /></tr><tr><td>Text2 : </td><td><input value='0' style='color:black !important;' type='text' class='d' /></tr><tr><td>Text3 : </td><td><input value='0' style='color:black !important;' type='text' class='e' /></tr><tr><td>Textarea : </td><td><textarea style='color:black !important;' class='r'></textarea></td></tr><tr><td colspan='2' align='center'><input class='btn btn-primary b1' style='color:white;background-color:orange !important' type='submit' value='Mulai' onclick=\"javascript:(function(){ var a=document.getElementsByClassName('c');a=a[0]; alert(a.value); }) ()\" /><input class='b2 btn btn-primary' onclick=\"javascript:(function(){var dbm=window.content.document.getElementsByClassName('dbm');dbm[0].innerHTML='' ; }) ()\" style='background-color:blue;color:white; !important' type='submit' value='Close' /></td></tr></table></div>";

var document=window.document;
//window.content.document.getElementsByClassName('dbm')[0].innerHTML = "";
document.body.innerHTML += (html);
alert(a);
P.S: I am using

Code: Select all

imacros 8.9.7 run in Firefox 56, Windows 7 (classic mode)

Thread "quickly approved", because you are not a Spammer, and I was "expecting" your Thread from SOF..., but you missed a few "Recommendations" from some Posts of mine on SOF, and didn't read the Forum Rules... Going to bed now, correct your "Mistakes", you'll have lost about 8 hours already...

+ Parallel (Original) Thread on SOF:

=> Quick Quote of Content of Thread on SOF:
Imacros (javascript) getting variable value from custom input dialog


Imacros (javascript) getting variable value from custom input dialog


I am trying to find a way to create custom user input dialog with imacros (javascript).

However while the dialog itself could be done, say,

with javascript

or jQuery

No luck in getting the variable to be used "outside". It keeps saying variable is not defined, or illegal syntax (see i am trying to alert "a" variable outside)

Is there any way to get around this issue, attaining the goal? Or i am doing it wrong?

P.S: I am using imacros 8.9.7 run in Firefox 56, Windows 7 (classic mode)
Purpose of the 'PROMPT' Command... – chivracq 14 hours ago
+ Fuck it, ah-ah..! Shitty Site (SOF), can't C&P some simple Post...;

Code: Select all

               <span class="comment-copy">Purpose of the &#39;PROMPT&#39; Command...</span>
                
&ndash;&nbsp;<a href="/users/3799241/chivracq"
                       title="518 reputation"
                       class="comment-user">chivracq</a>
                <span class="comment-date" dir="ltr"><span title="2021-01-13 13:08:12Z, License: CC BY-SA 4.0" class="relativetime-clean">12 hours ago</span></span>
                    &nbsp;
                    <button class="js-comment-delete s-btn s-btn__link fc-red-600" title="delete this comment" aria-label="Delete"><span class="hover-only-label">Delete</span></button>
            </div>
        </div>
    </li>
    <li id="comment-116167213" class="comment js-comment " data-comment-id="116167213">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
            </div>
                <div class="comment-voting mtn2 js-comment-edit-hide">
                        <a tabindex="0" role="button" href="#" class="comment-up comment-up-off" aria-label="Upvote Comment" title="This comment adds something useful to the post">
                            <svg aria-hidden="true" class="svg-icon iconArrowUp" width="18" height="18" viewBox="0 0 18 18"><path d="M1 13h16L9 5l-8 8z"/></svg>
                        </a>
                </div>
                <div class="comment-flagging js-comment-edit-hide">
                    <button class="js-comment-flag s-btn s-btn__unset bg-transparent c-pointer fc-black-100 h:fc-red-500"
                            aria-label="Flag Comment"
                            aria-pressed="false"
                            title="Flag this comment for serious problems or moderator attention">
                        <svg aria-hidden="true" class="svg-icon iconFlag" width="18" height="18" viewBox="0 0 18 18"><path d="M3 2v14h2v-6h3.6l.4 1h6V3H9.5L9 2H3z"/></svg>
                    </button>
                </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">PROMPT command only show basic-styled single line input, not something i would like to achieve. So its not possible?</span>
                
&ndash;&nbsp;<a href="/users/14123796/gardin"
                       title="9 reputation"
                       class="comment-user owner">gardin</a>
                <span class="comment-date" dir="ltr"><span title="2021-01-13 13:31:09Z, License: CC BY-SA 4.0" class="relativetime-clean">12 hours ago</span></span>
            </div>
        </div>
    </li>
    <li id="comment-116168264" class="comment js-comment " data-comment-id="116168264">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
            </div>
                <div class="comment-voting mtn2 js-comment-edit-hide">
                        <a tabindex="0" role="button" href="#" class="comment-up comment-up-off" aria-label="Upvote Comment" title="This comment adds something useful to the post">
                            <svg aria-hidden="true" class="svg-icon iconArrowUp" width="18" height="18" viewBox="0 0 18 18"><path d="M1 13h16L9 5l-8 8z"/></svg>
                        </a>
                </div>
                <div class="comment-flagging js-comment-edit-hide">
                    <button class="js-comment-flag s-btn s-btn__unset bg-transparent c-pointer fc-black-100 h:fc-red-500"
                            aria-label="Flag Comment"
                            aria-pressed="false"
                            title="Flag this comment for serious problems or moderator attention">
                        <svg aria-hidden="true" class="svg-icon iconFlag" width="18" height="18" viewBox="0 0 18 18"><path d="M3 2v14h2v-6h3.6l.4 1h6V3H9.5L9 2H3z"/></svg>
                    </button>
                </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">@chivracq The goal is to create custom modal popup (multi line input) that is heavily styled, then use that input for the rest. I am sure it could be done somehow</span>
                
&ndash;&nbsp;<a href="/users/14123796/gardin"
                       title="9 reputation"
                       class="comment-user owner">gardin</a>
                <span class="comment-date" dir="ltr"><span title="2021-01-13 14:04:44Z, License: CC BY-SA 4.0" class="relativetime-clean">12 hours ago</span></span>
            </div>
        </div>
    </li>
    <li id="comment-116172314" class="comment js-comment " data-comment-id="116172314">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
            </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">&quot;single line&quot;, =&gt; Not True, you can use &#39;&lt;BR&gt;&#39; for Multi-Lines... (and &#39;&lt;SP&gt;&#39; for Spaces). (But no Bold/Italic/etc, and you can&#39;t change the Lettertype...) And you can only use 1 Input Field per &#39;PROMPT&#39;. But if ask the Users to input the Data like &quot;Input 1 # Input 2 # Input 3&quot;, you can re-separate the 3 Fields using &#39;EVAL()&#39;, ... or you use 3x &#39;PROMPT&#39;...</span>
                
&ndash;&nbsp;<a href="/users/3799241/chivracq"
                       title="518 reputation"
                       class="comment-user">chivracq</a>
                <span class="comment-date" dir="ltr"><span title="2021-01-13 16:12:36Z, License: CC BY-SA 4.0" class="relativetime-clean">9 hours ago</span></span>
                    &nbsp;
                    <button class="js-comment-delete s-btn s-btn__link fc-red-600" title="delete this comment" aria-label="Delete"><span class="hover-only-label">Delete</span></button>
            </div>
        </div>
    </li>
    <li id="comment-116174710" class="comment js-comment " data-comment-id="116174710">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
            </div>
                <div class="comment-voting mtn2 js-comment-edit-hide">
                        <a tabindex="0" role="button" href="#" class="comment-up comment-up-off" aria-label="Upvote Comment" title="This comment adds something useful to the post">
                            <svg aria-hidden="true" class="svg-icon iconArrowUp" width="18" height="18" viewBox="0 0 18 18"><path d="M1 13h16L9 5l-8 8z"/></svg>
                        </a>
                </div>
                <div class="comment-flagging js-comment-edit-hide">
                    <button class="js-comment-flag s-btn s-btn__unset bg-transparent c-pointer fc-black-100 h:fc-red-500"
                            aria-label="Flag Comment"
                            aria-pressed="false"
                            title="Flag this comment for serious problems or moderator attention">
                        <svg aria-hidden="true" class="svg-icon iconFlag" width="18" height="18" viewBox="0 0 18 18"><path d="M3 2v14h2v-6h3.6l.4 1h6V3H9.5L9 2H3z"/></svg>
                    </button>
                </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">&quot;1 input field per PROMPT&quot; - exactly my point. Mine have always like 8 variable or so. Some optional, some requires specific format (not just &lt;input&gt; but also &lt;textarea&gt;, etc). Since you&#39;re one of the most experienced imacros on earth, from above comment, simply said, are you suggesting that its not possible achieving such goal?</span>
                
&ndash;&nbsp;<a href="/users/14123796/gardin"
                       title="9 reputation"
                       class="comment-user owner">gardin</a>
                <span class="comment-date" dir="ltr"><span title="2021-01-13 17:30:41Z, License: CC BY-SA 4.0" class="relativetime-clean">8 hours ago</span></span>
            </div>
        </div>
    </li>

Oh, fuck it...!, shitty Site (SOF), 10 or 20 more Posts that apparently need to to be selected one by one...!

And your "PS" about your FCI is the most important Info to decide if me or any other Advanced User will react/answer (to) your Post, ah-ah...! :wink:
Last edited by chivracq on Thu Jan 14, 2021 3:39 am, edited 3 times in total.
- (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...
gardin
Posts: 21
Joined: Thu Jan 14, 2021 1:57 am

Re: Imacros (javascript) getting variable value from custom input dialog

Post by gardin » Thu Jan 14, 2021 3:10 am

After reading again i think just these missing. Hopefully its sufficient

VERSION BUILD=8970419 RECORDER=FX
Attachments
WBNLZ.png
BGb8g.jpg
chivracq
Posts: 9766
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Imacros (javascript) getting variable value from custom input dialog

Post by chivracq » Thu Jan 14, 2021 3:29 am

gardin wrote:
Thu Jan 14, 2021 3:10 am
After reading again i think just these missing. Hopefully its sufficient

VERSION BUILD=8970419 RECORDER=FX
Oh..., good...!, and Thanks for uploading your Screenshots "directly" to the Forum..., but hum, if I/we ("we" = "Advanced Users", I'm "possibly" a part of those, ah-ah...! :twisted: ) need to see/understand your Code, I will still ask you (AGAIN :roll: ) to post it/them in Plain Text.. Images are not searchable by Search Engines, I don't answer if my Answers are not searchable... (and useful for the whole Community)... :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...
gardin
Posts: 21
Joined: Thu Jan 14, 2021 1:57 am

Re: Imacros (javascript) getting variable value from custom input dialog

Post by gardin » Thu Jan 14, 2021 3:55 am

gardin wrote:
Thu Jan 14, 2021 2:19 am

Code: Select all

var html = "<div class='dbm' class='dbm' style='padding:10px;background-color:gray;color:white;top:80px;position:absolute;right:500px;border:1px solid black;z-index:1000;'><table width='100%' class='table'><tr><td>Type : </td><td><input name='tipe' checked value='1' type='radio'>&nbsp;Image <input name='tipe' value='2' type='radio'>&nbsp;File</td></tr><tr><td>Text1 : </td><td><input style='color:black !important;' value='2' type='text' class='c' /></tr><tr><td>Text2 : </td><td><input value='0' style='color:black !important;' type='text' class='d' /></tr><tr><td>Text3 : </td><td><input value='0' style='color:black !important;' type='text' class='e' /></tr><tr><td>Textarea : </td><td><textarea style='color:black !important;' class='r'></textarea></td></tr><tr><td colspan='2' align='center'><input class='btn btn-primary b1' style='color:white;background-color:orange !important' type='submit' value='Mulai' onclick=\"javascript:(function(){ var a=document.getElementsByClassName('c');a=a[0]; alert(a.value); }) ()\" /><input class='b2 btn btn-primary' onclick=\"javascript:(function(){var dbm=window.content.document.getElementsByClassName('dbm');dbm[0].innerHTML='' ; }) ()\" style='background-color:blue;color:white; !important' type='submit' value='Close' /></td></tr></table></div>";

var document=window.document;
//window.content.document.getElementsByClassName('dbm')[0].innerHTML = "";
document.body.innerHTML += (html);
alert(a);
I posted these code already? Or should i put without <code> tag?

var html = "<div class='dbm' class='dbm' style='padding:10px;background-color:gray;color:white;top:80px;position:absolute;right:500px;border:1px solid black;z-index:1000;'><table width='100%' class='table'><tr><td>Type : </td><td><input name='tipe' checked value='1' type='radio'>&nbsp;Image <input name='tipe' value='2' type='radio'>&nbsp;File</td></tr><tr><td>Text1 : </td><td><input style='color:black !important;' value='2' type='text' class='c' /></tr><tr><td>Text2 : </td><td><input value='0' style='color:black !important;' type='text' class='d' /></tr><tr><td>Text3 : </td><td><input value='0' style='color:black !important;' type='text' class='e' /></tr><tr><td>Textarea : </td><td><textarea style='color:black !important;' class='r'></textarea></td></tr><tr><td colspan='2' align='center'><input class='btn btn-primary b1' style='color:white;background-color:orange !important' type='submit' value='Mulai' onclick=\"javascript:(function(){ var a=document.getElementsByClassName('c');a=a[0]; alert(a.value); }) ()\" /><input class='b2 btn btn-primary' onclick=\"javascript:(function(){var dbm=window.content.document.getElementsByClassName('dbm');dbm[0].innerHTML='' ; }) ()\" style='background-color:blue;color:white; !important' type='submit' value='Close' /></td></tr></table></div>";

var document=window.document;
//window.content.document.getElementsByClassName('dbm')[0].innerHTML = "";
document.body.innerHTML += (html);
alert(a);
gardin
Posts: 21
Joined: Thu Jan 14, 2021 1:57 am

Re: Imacros (javascript) getting variable value from custom input dialog

Post by gardin » Thu Jan 14, 2021 3:46 pm

May i know how long should i expect an update ? :) (usually, in most cases)
chivracq
Posts: 9766
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Imacros (javascript) getting variable value from custom input dialog

Post by chivracq » Thu Jan 14, 2021 9:43 pm

gardin wrote:
Thu Jan 14, 2021 3:55 am
gardin wrote:
Thu Jan 14, 2021 2:19 am

Code: Select all

var html = "<div class='dbm' class='dbm' style='padding:10px;background-color:gray;color:white;top:80px;position:absolute;right:500px;border:1px solid black;z-index:1000;'><table width='100%' class='table'><tr><td>Type : </td><td><input name='tipe' checked value='1' type='radio'>&nbsp;Image <input name='tipe' value='2' type='radio'>&nbsp;File</td></tr><tr><td>Text1 : </td><td><input style='color:black !important;' value='2' type='text' class='c' /></tr><tr><td>Text2 : </td><td><input value='0' style='color:black !important;' type='text' class='d' /></tr><tr><td>Text3 : </td><td><input value='0' style='color:black !important;' type='text' class='e' /></tr><tr><td>Textarea : </td><td><textarea style='color:black !important;' class='r'></textarea></td></tr><tr><td colspan='2' align='center'><input class='btn btn-primary b1' style='color:white;background-color:orange !important' type='submit' value='Mulai' onclick=\"javascript:(function(){ var a=document.getElementsByClassName('c');a=a[0]; alert(a.value); }) ()\" /><input class='b2 btn btn-primary' onclick=\"javascript:(function(){var dbm=window.content.document.getElementsByClassName('dbm');dbm[0].innerHTML='' ; }) ()\" style='background-color:blue;color:white; !important' type='submit' value='Close' /></td></tr></table></div>";

var document=window.document;
//window.content.document.getElementsByClassName('dbm')[0].innerHTML = "";
document.body.innerHTML += (html);
alert(a);
I posted these code already? Or should i put without <code> tag?

[...]

Oh...!, yep indeed, that's the one I meant, I had missed it indeed, "focusing" a bit on the 2 Screenshots that had not been uploaded to the Forum like I had asked, and you had 2 Screenshots, so I expected 2 Scripts... :?

OK, I only keep your formatted Script in my Quote, but keep indeed the non-formatted "Version" in your own Post, the "var html" Declaration is "so long", that it is indeed not very easy to read from the one-Line in the formatted Script, and it's easier to read from your Post...

So OK, "now" I understand where your "a" is coming from in the (final) "alert(a)" in your Script. :D

So this is the Script you were saying:
No luck in getting the variable to be used "outside". It keeps saying variable is not defined, or illegal syntax (see i am trying to alert "a" variable outside)
... And the Runtime Error (that I have to retype) from your Screenshot is:

Code: Select all

ReferenceError: a is not defined, line 7 (Error code: -991)
Then yep..., I'm not "too surprised", the "a" is only declared and known within the "Scope" of the "html" Var, and the JS Runtime Engine doesn't know anything (anymore) at the next Line in your Script...

So what you are missing is a Mechanism to pass the Content of that "a" Var to outside of the "html" Line for the rest of the Script to be able to access it and reuse it.
=> Still in the "html" Statement, see if you can pass it to the OS Clipboard in pure JS, or you would need to append some "fake" (invisible) 'DIV' to your Popup to re-extract at some next Line either using the 'EXTRACT' Mechanism in 'iim' or in pure JS, while the Popup is still "visible".
But I reckon the Popup will be Modal, so this won't work as the Popup will have already been dismissed when your Script will try to execute the next Line after the "html" Line, ah-ah...!
Then instead of appending that 'DIV' to the Popup, you will need to inject it directly in the "main" HTML of the "Parent" Page, (still from your "html" Line), where iMacros will then be able to re-extract it.

But this is "a bit" cumbersome, ah-ah...! But your Popup Declaration is already "a bit" cumbersome, ah-ah...! Now I understand what you were meaning with "rich Content", ah-ah...! :shock:
I still find like I had told you in your Original Thread on SOF that using the iMacros 'PROMPT' Command would be much easier, I would think..., as you probably don't really need all the "fancy" Formatting in your Popup... :P
I have an Enhancement Request btw in the following Thread, => Item "5" about 'PROMPT' + 'ONPROMPT' to extend indeed a bit the whole Functionality of the 'PROMPT' Command. Feel "free" to support that EnhReq if you want, ah-ah...! 8)

But we use the same Technique to pass a Var in pure '.iim' from an "URL GOTO=javascript" Line/Statement to the rest of the Script. Let me find a Thread where this has been demonstrated... Yep, in this Thread for example, from the Post I link to and beyond, other Advanced User @thecoder2012 is much more knowledgeable than me in pure JS, then in this Thread also I think, and there should be another Thread on the Forum, from other Advanced User @iimfun, but I can seem to be able to locate it easily...
- (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...
gardin
Posts: 21
Joined: Thu Jan 14, 2021 1:57 am

Re: Imacros (javascript) getting variable value from custom input dialog

Post by gardin » Thu Jan 14, 2021 11:54 pm

Woah.. i think i should mark this as solved. That was simple-but-works solution, how could i miss that!
Thank you again very much, @chivracq !
gardin
Posts: 21
Joined: Thu Jan 14, 2021 1:57 am

Re: Imacros (javascript) getting variable value from custom input dialog

Post by gardin » Thu Jan 14, 2021 11:56 pm

Also, expect another thread from me here in future when i need any further help, again thanks! ;)
chivracq
Posts: 9766
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Imacros (javascript) getting variable value from custom input dialog

Post by chivracq » Fri Jan 15, 2021 12:01 am

gardin wrote:
Thu Jan 14, 2021 11:54 pm
Woah.. i think i should mark this as solved. That was simple-but-works solution, how could i miss that!
Thank you again very much, @chivracq !
gardin wrote:
Thu Jan 14, 2021 11:56 pm
Also, expect another thread from me here in future when i need any further help, again thanks! ;)

OK, good-good..., but hum..., could you share your "Final" Script...?, I don't exactly understand what you mean by "That was simple-but-works solution", and that would make the Thread also pretty useful for other Users... 8)
- (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...
gardin
Posts: 21
Joined: Thu Jan 14, 2021 1:57 am

Re: Imacros (javascript) getting variable value from custom input dialog

Post by gardin » Fri Jan 15, 2021 2:20 am

Well, i don't have any "final" script since i am just curious how to get it done, so what i provide was simply dummy code
I am sure your previous answer already covers them all - create "fake" modal popup, and then extract using imacros EXTRACT command
Again elegant solution!
gardin
Posts: 21
Joined: Thu Jan 14, 2021 1:57 am

Re: Imacros (javascript) getting variable value from custom input dialog

Post by gardin » Wed Jan 20, 2021 2:14 am

Hi again @chivracq

I am now trying to scrape all members in group (say this https://t.me/bisniss). However it only shown 200 member (in attached screenshot its shown 400, but every user have two selector).
Is there any way to get around this limitation and scrape all?

I posted this question earlier in SO, but in less than an hour got downvoted a lot for no reason and eventually closed for "needed clarity".

I am expecting solution like in this python thread,
https://stackoverflow.com/questions/658 ... javascript
Telegram has a server-side limit of only collecting the first 200 participants of a group. From what I see, you can use the iter_participants function with aggressive = True to subvert this problem
Attachments
677.JPG
244.JPG
chivracq
Posts: 9766
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Imacros (javascript) getting variable value from custom input dialog

Post by chivracq » Wed Jan 20, 2021 2:28 am

gardin wrote:
Wed Jan 20, 2021 2:14 am
Hi again @chivracq

I am now trying to scrape all members in group (say this https://t.me/bisniss). However it only shown 200 member (in attached screenshot its shown 400, but every user have two selector).
Is there any way to get around this limitation and scrape all?

I posted this question earlier in SO, but in less than an hour got downvoted a lot for no reason and eventually closed for "needed clarity".

I am expecting solution like in this python thread,
https://stackoverflow.com/questions/658 ... javascript
Telegram has a server-side limit of only collecting the first 200 participants of a group. From what I see, you can use the iter_participants function with aggressive = True to subvert this problem

Yeah OK, but open a new (Standalone) Thread, (=> in the 'Data Extraction' Sub-Forum I would think, from "... trying to scrape all members in group..."), this Follow-Up Qt has nothing to do with the "Subject" of this current Thread I would think... :idea:
(... For me to have a look... :idea: )

"...in less than an hour got downvoted a lot for no reason and eventually closed for "needed clarity"..."
=> Yeah hum, means "Low Quality" to me, possibly Legit, possibly "wrong", but I can't "judge" because you've apparently already deleted the Thread/Qt yourself, ah-ah...! :( :o , meaning you agreed "a bit" with those (-1) Quality Rep-Pts... :|

I didn't even get a Notif about your New Qt on SOF, meaning also you probably tagged it incorrectly, which is indeed a "Show-Killer" if you don't select the correct Tags..., as you either don't reach the "correct" Specialists, or irritate the "wrong" ones... :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...
gardin
Posts: 21
Joined: Thu Jan 14, 2021 1:57 am

Re: Imacros (javascript) getting variable value from custom input dialog

Post by gardin » Wed Jan 20, 2021 2:41 am

chivracq wrote:
Wed Jan 20, 2021 2:28 am
Yeah OK, but open a new (Standalone) Thread, (=> in the 'Data Extraction' Sub-Forum I would think, from "... trying to scrape all members in group..."), this Follow-Up Qt has nothing to do with the "Subject" of this current Thread I would think... :idea:
(... For me to have a look... :idea: )

"...in less than an hour got downvoted a lot for no reason and eventually closed for "needed clarity"..."
=> Yeah hum, means "Low Quality" to me, possibly Legit, possibly "wrong", but I can't "judge" because you've apparently already deleted the Thread/Qt yourself, ah-ah...! :( :o , meaning you agreed "a bit" with those (-1) Quality Rep-Pts... :|

I didn't even get a Notif about your New Qt on SOF, meaning also you probably tagged it incorrectly, which is indeed a "Show-Killer" if you don't select the correct Tags..., as you either don't reach the "correct" Specialists, or irritate the "wrong" ones... :idea:

Well. I have no idea at all why got downvoted, but yes i did deleted it since it seems just getting worse (-3 will obviously trigger others, even without single one to address the problem)
Attachments
433.JPG
chivracq
Posts: 9766
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Imacros (javascript) getting variable value from custom input dialog

Post by chivracq » Wed Jan 20, 2021 2:57 am

gardin wrote:
Wed Jan 20, 2021 2:41 am
Well. I have no idea at all why got downvoted, but yes i did deleted it since it seems just getting worse (-3 will obviously trigger others, even without single one to address the problem)

Yep, not surprised, 5 Tags is "too much" for SOF, only "looking for Pb's", ah-ah...!
=> 'jquery' Tag is being watched by 411,000+ Users, ah-ah...!, you pissed them all off, ah-ah...!, be happy if you get less than 40,000 x (-1), ah-ah...!! :roll:
- (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...
Post Reply