Problem with JS

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
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
mtrr37
Posts: 4
Joined: Thu Aug 22, 2019 10:20 am

Problem with JS

Post by mtrr37 » Thu Sep 12, 2019 8:49 am

Good morning!

I have a problem with the code js "iimGetLastExtract()",

I created this code:

Code: Select all

macro1 +="TAG POS=1 TYPE=P ATTR=CLASS:titolo<SP>upper<SP>row EXTRACT=TXT"+"\n";
macro1 +="SET !EXTRACT {{!VAR1}}" + "\n";
var day = iimGetLastExtract(1);
I wrote number 1 inside the () because if I had put 0 or nothing, the JS can't extract the VAR "day".
On the other hand, if I insert 1 it works on and off. When it doesn't work an error appears: "TypeError: val is null, line -444 (Error code: -991)" Once I run it again, it works.
I can't understand the problem with it and why whenever I insert nothing at all, there is no extraction.

Can somebody help me?




Waterfox 51.0.1 (64 bit)
And Imacros 8.97
mtrr37
Posts: 4
Joined: Thu Aug 22, 2019 10:20 am

Re: Problem with JS

Post by mtrr37 » Thu Sep 12, 2019 10:12 am

I solved the problem,

Thanks anyway
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Problem with JS

Post by chivracq » Thu Sep 12, 2019 11:00 pm

mtrr37 wrote:
Thu Sep 12, 2019 8:49 am
Good morning!

I have a problem with the code js "iimGetLastExtract()",

I created this code:

Code: Select all

macro1 +="TAG POS=1 TYPE=P ATTR=CLASS:titolo<SP>upper<SP>row EXTRACT=TXT"+"\n";
macro1 +="SET !EXTRACT {{!VAR1}}" + "\n";
var day = iimGetLastExtract(1);
I wrote number 1 inside the () because if I had put 0 or nothing, the JS can't extract the VAR "day".
On the other hand, if I insert 1 it works on and off. When it doesn't work an error appears: "TypeError: val is null, line -444 (Error code: -991)" Once I run it again, it works.
I can't understand the problem with it and why whenever I insert nothing at all, there is no extraction.

Can somebody help me?

Code: Select all

Waterfox 51.0.1 (64 bit)
And Imacros 8.97
mtrr37 wrote:
Thu Sep 12, 2019 10:12 am
I solved the problem,

Thanks anyway

Hum..., would be "handy" @OP if you could "start" using the Forum "a bit correctly" ...! :roll: (or the ForumZZ actually, as I see you do the same on SOF as well)... :shock:

1- Open your Threads in the "correct" Sub-Forum...! (And I've already asked you...) :!:
Your previous Thread belonged to the 'General' Sub-Forum (hum, I haven't gotten it moved yet), but this current one in return belongs to the 'FF' one...!
And yep, the 'General' Sub-Forum is "always correct" if you don't know or hesitate, but '.js' Scripts are only supported by iMacros for FF and it's clearly mentioned on the Forum 'Main' Page, so there is nothing to "hesitate" about this one..., so take once 30 sec to read the Descriptions about each Sub-Forum, they are all nicely and very logically organized... :idea:
No big-big deal, but it's a bit of a waste of energy and time from me and the Forum Admin to get Threads moved to their correct Sub-Forum, so that YOU, the Users later find them in the correct Place when you are searching or browsing the Forum with a Qt and trying to find a Solution... :wink:

2- Give a Descriptive Title to your Threads. :!:
Your "Problem with JS" for this one is completely useless, and probably applies to 20% or 30% of all Threads on the whole Forum...! :roll:
=> If you can give a Descriptive Title to this Thread...? :idea:
Should contain the Keywords you would use yourself to try searching the Forum (well, good luck with "problem+js", ah-ah...!) and that other Users will be using when searching the Forum with a similar Qt/Scenario and they can decide from your Thread Title if this Thread is "interesting" for them without having to open and read the Thread to check its Content...

3- FCIM...! :mrgreen: (Read my Sig...)
Your OS is still missing from your FCI...

4- Share your Solution... :!:
Your "I solved the problem," is "nice" for the Follow-up (for once...!), but is not very "helpful" for the Forum and other Users... Give some Explanation and share the Solution and your Final Script...

5- Follow up on (all) your Threads... :!:
Your previous Thread has now been waiting for 3 weeks for some Follow-up from you, for an Update or sharing your Solution if you managed to solve your Case. :shock:

6- Items '3' + ' 4' + '5' also apply to your Use of SOF and the parallel Thread you had opened on that Forum for your previous Thread... :roll:
(And deleting that Qt/Thread doesn't qualify either for "correct Use of a Tech Forum"... :wink: )

7- Your Password is "safe", don't worry, just make sure to "remember" it... :wink: , but the IP's you keep using for connecting to our Forum are not...!, like I had already mentioned in your previous Thread, the 'M247' VPN/Proxy Provider you keep using belongs to the Top-2 (together with 'DigitalOcean') for the 2 Top-2 "Owners" of (very) dirty IP's (related to Spam/Fraud/Hacking and worst IP Reputation) on Internet "at the moment"... (Well, they both hold that Position since more than one year already, and I don't see any other Provider coming close as they keep expanding their IP-Farm... But those IP's are "slowly" getting banned from "many" Forums because reused by different Users using their "Service" and repeatedly reported and associated with "Abuse"...)
(No Action required from you, this Item '7' is just "FYI", and I had already mentioned it in your first Thread..., Reason why I was very suspicious first when you joined the Forum if you were a "real" User..., you do what you want with it..., but don't be "surprised" if you start not being able to access (anymore) certain Sites/Forums on Internet... :wink: )

[Don't worry, last time I will ask you to use the Forum "a bit correctly" if you don't comply with Items [1-6]... Good luck with other (Advanced) Users otherwise... 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...
Tom, Tech Support
Posts: 3527
Joined: Mon May 31, 2010 4:59 pm

Re: Problem with JS

Post by Tom, Tech Support » Fri Sep 27, 2019 3:51 pm

chivracq wrote:
Thu Sep 12, 2019 11:00 pm
Hum..., would be "handy" @OP if you could "start" using the Forum "a bit correctly" ...! :roll: (or the ForumZZ actually, as I see you do the same on SOF as well)... :shock:
+1
Regards,

Tom, iMacros Support
chivracq
Posts: 8716
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Problem with JS

Post by chivracq » Fri Sep 27, 2019 4:05 pm

Tom, Tech Support wrote:
Fri Sep 27, 2019 3:51 pm
chivracq wrote:
Thu Sep 12, 2019 11:00 pm
Hum..., would be "handy" @OP if you could "start" using the Forum "a bit correctly" ...! :roll: (or the ForumZZ actually, as I see you do the same on SOF as well)... :shock:
+1

Ah-ah...!, Thanks for the "+1"... :wink:

Oh...!, and Thanks for moving the 2 Threads to their "correct" Sub-Forums... :D
- (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