Tiny MCE editor and fill the field

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
BrianC
Posts: 12
Joined: Tue Sep 01, 2009 8:11 pm

Tiny MCE editor and fill the field

Post by BrianC » Thu Oct 07, 2010 3:30 pm

Hi,

i have Tiny MCE box

Code: Select all

<textarea wrap="virtual" name="comment"></textarea>
and the imacros script:

Code: Select all

TAG POS=1 TYPE=TEXTAREA ATTR=NAME:comment CONTENT=ffff
iMacros can't fill the Tiny MCE box, how i can fix this problem?
BrianC
Posts: 12
Joined: Tue Sep 01, 2009 8:11 pm

Re: Tiny MCE editor and fill the field

Post by BrianC » Fri Oct 08, 2010 4:07 pm

iMacros support filling Tiny MCE box?

Mayby someone know tricks?
CodeLab
Posts: 100
Joined: Sun Dec 27, 2009 5:50 pm

Re: Tiny MCE editor and fill the field

Post by CodeLab » Fri Oct 08, 2010 5:09 pm

There Is One Workaround Solution,
Works In Firefox, Had Not Checked In Other Browsers...

Run This Macro Code As It is And See If It Works For You...
This Macro Example Takes You TinyMCE Demo Site And Fill Content In Editor

Code: Select all

VERSION BUILD=7000908 RECORDER=FX
TAB T=1
'Goto TinyMCE Demo Site
URL GOTO=http://tinymce.moxiecode.com/examples/example_17.php
'Click The HTML Button
TAG POS=1 TYPE=SPAN ATTR=CLASS:mceIcon<SP>mce_code
'It Should Open In New Tab, If It Opens In New Window Instead, 
'You Will Have To Tweak Your Firefox To Make Popups 
'Open In New Tab Instead Of New Window
TAB T=2
FRAME F=0
'Enter Your Content In HTML Code Area
TAG POS=1 TYPE=TEXTAREA FORM=NAME:source ATTR=ID:htmlSource CONTENT=sometext
'Click Insert/Update Button
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:source ATTR=ID:insert
Tom, Tech Support
Posts: 3513
Joined: Mon May 31, 2010 4:59 pm

Re: Tiny MCE editor and fill the field

Post by Tom, Tech Support » Sat Oct 09, 2010 8:52 am

Thanks for that tip CodeLab!
Regards,

Tom, iMacros Support
BrianC
Posts: 12
Joined: Tue Sep 01, 2009 8:11 pm

Re: Tiny MCE editor and fill the field

Post by BrianC » Sat Oct 09, 2010 1:05 pm

I done this too, it is no problems, but I must fill box without html button and im tired try fix this.
CodeLab
Posts: 100
Joined: Sun Dec 27, 2009 5:50 pm

Re: Tiny MCE editor and fill the field

Post by CodeLab » Sat Oct 09, 2010 2:48 pm

Ok I Dont Have Complete Solution Here..

I'll Just Post What I Have...
Maybe Someone More Expert Can Take It From Here...

Code: Select all

VERSION BUILD=6700624 RECORDER=FX
'Goto TinnyMCE Demo Site
URL GOTO=http://tinymce.moxiecode.com/examples/example_17.php
'Fill my_content In TinyMCE
URL GOTO=javascript:window.frames[0].document.body.innerHTML="my_content"
There Is Little Problem With Above Code...
After Second URL GOTO Is Executed, You Are Taken To A Blank Page With Only "my_content" On It
You Hit Browser Back Button And You See my_content Filled In TinyMCE

Here The iMacros BACK Command Wont Work
Because Technically 2nd URL Goto Does Not Goto A Website (Or I Think So).

So, Perhaps Another Solution Could Be..
1) Goto Any Page
2) Then Goto Webpage With TinyMCE
3) Run This javascript:window.frames[0].document.body.innerHTML="my_content"
4) Then Use BACK

And Completed Code Becomes Something Like This...

Code: Select all

VERSION BUILD=6700624 RECORDER=FX
URL GOTO=http://google.com
URL GOTO=http://tinymce.moxiecode.com/examples/example_17.php
URL GOTO=javascript:window.frames[0].document.body.innerHTML="my_content"
BACK
This Is Indeed A Dirty Solution (Or So I Think), Just Posting It, Maybe Someone Expert Can Make It Better...
BrianC
Posts: 12
Joined: Tue Sep 01, 2009 8:11 pm

Re: Tiny MCE editor and fill the field

Post by BrianC » Sat Oct 09, 2010 3:27 pm

WOW, this work for now. I testet on 2 sites with box Tiny MCE and work. I go tested more. Big Thanks for You.

I don't know how work this but work :) line with: URL GOTO=http://google.com not nessesery, work fine on one GOTO.

One more time Thanks.
CodeLab
Posts: 100
Joined: Sun Dec 27, 2009 5:50 pm

Re: Tiny MCE editor and fill the field

Post by CodeLab » Sat Oct 09, 2010 3:31 pm

Happy To Help :D
Cheers :D
iToo
Posts: 13
Joined: Mon Oct 18, 2010 2:28 am

Re: Tiny MCE editor and fill the field

Post by iToo » Mon Oct 18, 2010 6:26 am

can anyone help me getting a script like this to work through php/iimrunner.exe?

want to use basically the same script (which I already made myself) to parse some text from .csv into a .php page with some text fields.
Thanks!
samydel76
Posts: 1
Joined: Sun Jan 02, 2011 9:35 pm

Re: Tiny MCE editor and fill the field

Post by samydel76 » Sun Jan 02, 2011 9:45 pm

Hi, I have a problem with tinymce, I tried all the suggestions I have read on this forum, but I can not find the solution to put a value on my textarea. The script my imacro record is:

VERSION BUILD=7031111 RECORDER=FX
TAB T=1
URL GOTO=http://www.mundoanuncio.com/publicar/zo ... es_18.html
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form ATTR=ID:titol CONTENT=This<SP>is<SP>the<SP>title<SP>of<SP>my<SP>ad<SP>that<SP>I<SP>want<SP>to<SP>publish
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form ATTR=ID:ciudad CONTENT=My<SP>City
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form ATTR=ID:barrio CONTENT=My<SP>Neighborhood
FRAME F=1
TAG POS=1 TYPE=P ATTR=TXT:This<SP>is<SP>the<SP>full<SP>contents<SP>of<SP>the<SP>ad<SP>you<SP>want<SP>to<SP>post.
FRAME F=0
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form ATTR=ID:mail CONTENT=myemail@email.es

Can anyone help? I tried all the options that you have posted, but I have not been successful.

Thank you very much.
Eagle
Posts: 2
Joined: Tue Feb 01, 2011 9:45 am

Re: Tiny MCE editor and fill the field

Post by Eagle » Tue Feb 01, 2011 11:17 am

You can actually control TinyMCE simply using it's JavaScript interface and the URL command. This line should do the trick:

Code: Select all

URL GOTO=javascript:void(tinyMCE.editors['EDITOR_NAME'].setContent('EDITOR_CONTENTS'));
where EDITOR_NAME is name of the textarea the editor is associated with and EDITOR_CONTENTS is what you want to set the contents to (remember to keep the iMacros syntax - <SP> instead of space etc.).

Example macro:

Code: Select all

VERSION BUILD=7031111 RECORDER=FX
URL GOTO=http://tinymce.moxiecode.com/tryit/full.php
WAIT SECONDS=5
URL GOTO=javascript:void(tinyMCE.editors['content'].setContent('My<SP>content<SP>filled<SP>by<SP><b>iMacros</b>'));
(should open the TinyMCE example page and after 5 seconds change the editor content to My content filled by iMacros)

Tested with iMacros for Firefox 7.0.3.0
Tom, Tech Support
Posts: 3513
Joined: Mon May 31, 2010 4:59 pm

Re: Tiny MCE editor and fill the field

Post by Tom, Tech Support » Thu Feb 03, 2011 12:03 pm

Excellent tip Eagle, thanks for sharing!
Regards,

Tom, iMacros Support
GoSu
Posts: 8
Joined: Sun Feb 20, 2011 5:36 am

Re: Tiny MCE editor and fill the field

Post by GoSu » Tue Feb 22, 2011 6:46 am

Eagle thanks for the idea, it works perfectly.
Marzy
Posts: 1
Joined: Fri Apr 01, 2011 6:03 am

Re: Tiny MCE editor and fill the field

Post by Marzy » Tue Apr 19, 2011 6:02 pm

Am not able to make this work! When trying to access the TINYmce the Imacros Browser locks-up and shuts down! :shock:
green.pine
Posts: 62
Joined: Thu Nov 04, 2010 5:21 pm

Re: Tiny MCE editor and fill the field

Post by green.pine » Sun Apr 24, 2011 7:43 am

thanks;
this works nicely,

but i tried to make it little more automated and instead of typing some text put the value of extracted text file there, some works and some not,
it has problem with either data volume or format, I could not figure it out.
I removed all line break in the text file and tried again but it did not work, i removed some of the text it did work, then opened the text file and copy some of the text and pasted it at the end and it did work, can not figure it out the behavior.

is there some kind of memory limitation for JS?
or text should be in any special format?
here is how i used the js code:

Code: Select all

URL GOTO=javascript:void(tinyMCE.editors['wsMainEditor'].setContent('{{!EXTRACT}}'));
in my macro I set it to read a text file from my computer.

appreciate a solution to this.
Post Reply