Js is not working for other language button?

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

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
wootshuska
Posts: 23
Joined: Mon Mar 07, 2016 12:04 am

Js is not working for other language button?

Post by wootshuska » Sun Mar 27, 2016 12:16 am

Hi!
I want to run that:

Code: Select all

var next;
next = "CODE";
next += "TAG POS=1 TYPE=SPAN ATTR=TXT:Następna" + "\n";
iimPlay(next);
But thats not working. Of course it works if i run .iim

Code: Select all

TAG POS=1 TYPE=SPAN ATTR=TXT:Następna
Thats because of "ę" in ATTR=TXT? Is there any solution how to run it in .js?

OS: Windows 7 N service pack 1
Firefox 44.0.2
iMacros for Firefox 8.9.6
VERSION BUILD=8961227 RECORDER=FX
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Js is not working for other language button?

Post by chivracq » Sun Mar 27, 2016 2:12 am

wootshuska wrote:Hi!
I want to run that:

Code: Select all

var next;
next = "CODE";
next += "TAG POS=1 TYPE=SPAN ATTR=TXT:Następna" + "\n";
iimPlay(next);
But thats not working. Of course it works if i run .iim

Code: Select all

TAG POS=1 TYPE=SPAN ATTR=TXT:Następna
Thats because of "ę" in ATTR=TXT? Is there any solution how to run it in .js?

Code: Select all

OS: Windows 7 N service pack 1
Firefox 44.0.2
iMacros for Firefox 8.9.6
VERSION BUILD=8961227 RECORDER=FX
Hum, strange indeed...
1- You can try to re-save your Script from Notepad and making sure to specify "UTF-8" for 'Encoding' to see if it makes a difference.
2- Try playing with the FF Setting in 'View' / 'Character Encoding' => I use "UTF-8" and it works with French Characters with Accents en Cedilla, but I only use '.iim' Scripts...
3- Try putting your Word/Attribute in some Variable ('.iim' / '.js') and use 'PROMPT' in the '.iim' part as well to see how iMacros displays that Character...
4- Use the HTML Equivalent for that Character.
5- If nothing else works, Workaround that will work...!: Replace that Character by a Wildcard...! (+ Relative Position if needed...)

Backward Analysis, you could let iMacros extract that 'TXT' Attribute and have it displayed in an 'alert()' to see how the '.js' part will display it (to reuse it then in your '.js' Script...).
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Trax
Posts: 43
Joined: Thu Sep 13, 2012 4:07 pm
Contact:

Re: Js is not working for other language button?

Post by Trax » Sun Mar 27, 2016 8:34 am

Code is wrong.

Code: Select all

next = "CODE:" // It's 'CODE:'
wootshuska
Posts: 23
Joined: Mon Mar 07, 2016 12:04 am

Re: Js is not working for other language button?

Post by wootshuska » Mon Mar 28, 2016 9:44 am

chivracq wrote:
wootshuska wrote:Hi!
I want to run that:

Code: Select all

var next;
next = "CODE";
next += "TAG POS=1 TYPE=SPAN ATTR=TXT:Następna" + "\n";
iimPlay(next);
But thats not working. Of course it works if i run .iim

Code: Select all

TAG POS=1 TYPE=SPAN ATTR=TXT:Następna
Thats because of "ę" in ATTR=TXT? Is there any solution how to run it in .js?

Code: Select all

OS: Windows 7 N service pack 1
Firefox 44.0.2
iMacros for Firefox 8.9.6
VERSION BUILD=8961227 RECORDER=FX
Hum, strange indeed...
1- You can try to re-save your Script from Notepad and making sure to specify "UTF-8" for 'Encoding' to see if it makes a difference.
2- Try playing with the FF Setting in 'View' / 'Character Encoding' => I use "UTF-8" and it works with French Characters with Accents en Cedilla, but I only use '.iim' Scripts...
3- Try putting your Word/Attribute in some Variable ('.iim' / '.js') and use 'PROMPT' in the '.iim' part as well to see how iMacros displays that Character...
4- Use the HTML Equivalent for that Character.
5- If nothing else works, Workaround that will work...!: Replace that Character by a Wildcard...! (+ Relative Position if needed...)

Backward Analysis, you could let iMacros extract that 'TXT' Attribute and have it displayed in an 'alert()' to see how the '.js' part will display it (to reuse it then in your '.js' Script...).
I dont know why, but now my code is working :o. I think i was a bit sleepy, and i messed up my code in another place. Thats magic that when you look on your code on next day, your error seems to be trival
Trax wrote:Code is wrong.

Code: Select all

next = "CODE:" // It's 'CODE:'
Hmm? What's the difference? I always use "CODE" and it works.
Trax
Posts: 43
Joined: Thu Sep 13, 2012 4:07 pm
Contact:

Re: Js is not working for other language button?

Post by Trax » Mon Mar 28, 2016 10:46 am

If you have var foo and it containts the string 'asd' when you do 'foo += ghj' the result is 'asdghj'

Code: Select all

next = "CODE";
next += "TAG POS=1 TYPE=SPAN ATTR=TXT:Następna" + "\n";
the content of next would be

Code: Select all

"CODETAG POS=1 TYPE=SPAN ATTR=TXT:Następna"
Which is kinda a big difference from

Code: Select all

"CODE:TAG POS=1 TYPE=SPAN ATTR=TXT:Następna"
wootshuska
Posts: 23
Joined: Mon Mar 07, 2016 12:04 am

Re: Js is not working for other language button?

Post by wootshuska » Mon Mar 28, 2016 6:46 pm

Ohh. so you're talking about difference beetween

Code: Select all

bla = "CODE";
and

Code: Select all

bla="CODE:";
I know that is wrong. I just thought you're talking about:

Code: Select all

bla = "CODE:";
and

Code: Select all

bla = 'CODE:';
You know. The fifference between " " and ' '. But i have another question related with language.

Code: Select all

var script;
script = "CODE:";
script += "SET !DATASOURCE C:\\Users\\Damian\\Desktop\\bash.txt" + "\n";
script += "SET !DATASOURCE_LINE {{k}}" + "\n";
script += "TAG POS=1 TYPE=TEXTAREA FORM=ACTION:{{!VAR1}} ATTR=NAME:editanswer CONTENT={{!COL1}}" + "\n";
And my bash.txt contains letters like: "ą,ę,ż,ź,ń" etc. And the thing is when i use script.js i have bugged textarea. There are a lot of letter crashes.

But if u use:
script += "TAG POS=1 TYPE=TEXTAREA FORM=ACTION:{{!VAR1}} ATTR=NAME:editanswer CONTENT=test<sp>żźćńó<sp>test2 + "\n";[/code]

its ok. Now its working. No letter crashes. Why does that happen? It's happening when i load from .txt and .csv too. No matter there and " " in preffix and suffix. It gaves me letter crashes all the time.
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Js is not working for other language button?

Post by chivracq » Mon Mar 28, 2016 7:49 pm

Yep, I can reproduce:

Code: Select all

VERSION BUILD=8820413 RECORDER=FX
TAB T=1

SET !DATASOURCE Forum_wootshuska2.txt

'URL GOTO=http://forum.imacros.net/viewtopic.php?f=11&t=26023
'TAG POS=30 TYPE=SPAN ATTR=TXT:
TAG POS=1 TYPE=TEXTAREA FORM=ID:postform ATTR=ID:message CONTENT={{!COL1}}

'DataSource as ANSI: "test zzcnَ test2"
'DataSource as UTF-8: "test żźćńó test2"
(Tested on iMacros for FF v8.8.2, Pale Moon v26.1.1 (=FF44), Win10-x64.)

That's what I mentioned already in my first Reply, about saving your Script, but it's even more important for DataSources, with 'UTF-8' Encoding from Notepad:
'DataSource as ANSI: "test zzcnَ test2"
'DataSource as UTF-8: "test żźćńó test2"
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Post Reply