Problems with copy/paste form fill...

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
monkey
Posts: 5
Joined: Mon Oct 23, 2006 5:41 pm

Problems with copy/paste form fill...

Post by monkey » Mon Oct 23, 2006 5:50 pm

I'm sure there is a painfully simple solution to this...just can't seem to find it anywhere in the manual.

I am simply trying to paste text from a .txt file datasource into a simple web box like the one I am typing in right now.

The text file has paragraphs such as:

paragraph 1 etc.....

paragraph 2 etc.....

paragraph 3 etc.....

paragraph 4 etc.....

I simply want to extract the entire copy in the file and then paste it into a blog text area....

What is currently happening is only the first paragraph ends up in the form area...when I try and set the column number and loop it, it overwrites each time and I am only left with the last paragraph....

Any help would be greatly appreciated!
Hannes, Tech Support

Post by Hannes, Tech Support » Tue Oct 24, 2006 12:42 pm

Hi,

the problem is that iMacros expects CSV files, i.e. files with data records separated by commas, one set each line.
So your paragraphs are interpreted as several sets of data.

I would recommend using a script to read the file, store the full text in a variable and pass this variable's content to the macro which then fills in the text.



Hannes
monkey
Posts: 5
Joined: Mon Oct 23, 2006 5:41 pm

can you give a bit more of a hint???

Post by monkey » Tue Oct 24, 2006 12:52 pm

Hannes,
thanks so much for the reply...do you know if anyone else has has done this so that I might just see a snippet of code...and will I be able to keep the macro as is or will this mean that I have to write the entire thing in a script language???

In other words...how can you pass the a variable to imacros inside the imacros browser or does the entire process now have to be accomplished in a scripting environment??? (Sorry, not a programmer....)
Hannes, Tech Support

Post by Hannes, Tech Support » Tue Oct 24, 2006 1:18 pm

Passing a variable's value to the macro is described in http://www.iopus.com/imacros/help/scripting_iimset.htm.

For reading a file with e.g. VBS, cf. http://www.aspfree.com/c/a/Windows-Scri ... using-WSH/. You should find similar examples for other programming languages on the net.

There is an example in the iMacros example folder (file-2-web-method2.vbs), which contains code for accessing a file, but again this file is assumed to be a CSV file, so the rest of the code is not like what you need.


Hannes
monkey
Posts: 5
Joined: Mon Oct 23, 2006 5:41 pm

Post by monkey » Tue Oct 24, 2006 2:10 pm

Hannes,
Thanks so much for the continued support on this...I am understanding what you are saying...

I think maybe I should clarify just a bit to get to the answer quicker.

I have a file. We'll call subject.txt or subject.csv
(I can make it plain text or save it as a CSV...you tell me what to do on this....there are no quotation marks in the file but it does contain commas in the text.)

I want to pass the ENTIRE contents of the file to a variable. We'll call the variable VAR1 (In other words, it is a 500 word report with multiple paragraphs)

I then want to pass the value of the variable (all 500 words in paragraph form) to a text box like this one I am typing in now...using an imacros macro.

Now, here is the question... Can I set the value of the variable with a simple SET !VAR1 (how???) (I tried using CMDLINE !DATASOURCE subject.txt SET !VAR1 subject.txt...and of course...it only makes subject.txt the actual value of the variable....not the contents of this file!)

If the answer is no, then I assume I have to do this in a scripting environment. So, looking at the sample code in the help file, I see this:

iret = imacro.iimSet("-var_loop", CStr(i))

(Of course, that is a sample and needs the surrounding code to make a lot of sense...)

I am still failing to see how I can pass the full contents of a text file or csv file to a variable and then call those contents via the variable when I run the macro...

Thanks a ton for your help. I truly appreciate it. Just wish I knew a lot more about programming so I could do this much faster...
Hannes, Tech Support

Post by Hannes, Tech Support » Tue Oct 24, 2006 2:19 pm

monkey wrote: [...] I assume I have to do this in a scripting environment. So, looking at the sample code in the help file, I see this:

iret = imacro.iimSet("-var_loop", CStr(i))

(Of course, that is a sample and needs the surrounding code to make a lot of sense...)
Say you have a VBS script, and all the text is stored in the variable "fullText". Then you may use iimSet in the following way:

Code: Select all

iret = imacro.iimSet("-var_myText", fullText)

This passes fullText's value to a macro variable "myText". If you then run a macro that contains a reference to myText (i.e. {{myText}}), it uses the content that previously was stored in the scripts "fullText", i.e. the whole text.


Hannes
monkey
Posts: 5
Joined: Mon Oct 23, 2006 5:41 pm

Post by monkey » Tue Oct 24, 2006 2:26 pm

Hannes,
Thanks!

I got everything you just said...makes total sense.

This is exactly what I am not getting:

[quote]Say you have a VBS script, and all the text is stored in the variable "fullText"[/quote]

That's the part I don't understand. HOW do you store the text in a variable to be called by imacros. I understand calling the variable once the text has been stored...just not storing the text via a script in the first place...

Thanks again...


P.S. Doesn't the variable need an exclamation point? not as above i.e. {{!myText}} ...thanks
Hannes, Tech Support

Post by Hannes, Tech Support » Wed Oct 25, 2006 12:39 pm

Here's the code to read a file "test.txt" into a variable using VBS:

Code: Select all

Dim objFileSystem, objInputFile

Set objFileSystem = CreateObject("Scripting.fileSystemObject")
Set objInputFile = objFileSystem.OpenTextFile("test.txt", 1)

' read everything in an array
inputData = objInputFile.ReadAll

objInputFile.Close

msgbox inputData
And for your second question:
P.S. Doesn't the variable need an exclamation point? not as above i.e. {{!myText}}
The quick answer is: no.
In general, variables are referred to by doubled curly brackets. The exclamation mark indicates (special) built-in variables.


Hannes
monkey
Posts: 5
Joined: Mon Oct 23, 2006 5:41 pm

Post by monkey » Wed Oct 25, 2006 2:14 pm

Hannes,
THANK YOU!!!

You have been a ton of help! I really appreciate it.

Adam
etzel
Posts: 6
Joined: Wed Jan 14, 2009 1:46 pm

Re: Problems with copy/paste form fill...

Post by etzel » Thu Jan 15, 2009 12:49 pm

So could I use a .txt file saved to a specific file location (I was thinking desktop) as the basis for using iimSet? I want to set a message subject while retaining the formatting and iimSet appears to be the best option for doing that, trouble is the message changes daily (sometimes more often)... If I could use a .txt file with formatting, then I could save each days message over the existing file of that name.

Thanks for any suggestions

Az

Ie. do I need to use iimSet first to import the VBS script (Above) in order to utilise the .txt file?

I am trying to learn this on the fly, I have very limited experience with programming...
iopussid
Posts: 3
Joined: Fri Mar 20, 2009 5:37 pm

Re: Problems with copy/paste form fill...

Post by iopussid » Fri Mar 20, 2009 6:38 pm

Hi,
I tried to extract a large amount of text from a site and pasted it into a Excell cell using VBscipt.

But now I need to paste the same text and the amount into another website's form .

Here is my script:
iret = iim1.iimSet("-var_text", mytext)
iret = iim1.iimPlay("add_to_site")

Here is my macro:
TAB T=2
URL GOTO=http://www.xxxx.com/member/xxxx.php
SIZE X=1292 Y=755
.... (few of DS CMDs here)
...
FRAME F=1
WAIT SECONDS=0.14
DS CMD=LUP X=505 Y=501
WAIT SECONDS=0.422
DS CMD=MOVETO X=505 Y=504
WAIT SECONDS=1.063
DS CMD=MOVETO X=505 Y=507
WAIT SECONDS=1
DS CMD=KEY X=0 Y=0 CONTENT={{text}}

The VB scipt fails at this command and gives this Windows error message:
"iMacros Browser has encountered a problem and needs to close. We are sorry for the inconvenience."

I am using Windows XP SP3.

I have attached the iMacros error log file.

Any help would be greatly appreciated!
iopussid
Posts: 3
Joined: Fri Mar 20, 2009 5:37 pm

Re: Problems with copy/paste form fill...

Post by iopussid » Fri Mar 20, 2009 6:41 pm

Also I am using iopus version 6.00
iopussid
Posts: 3
Joined: Fri Mar 20, 2009 5:37 pm

Re: Problems with copy/paste form fill...

Post by iopussid » Fri Mar 20, 2009 6:44 pm

I tried uploading the error log as attachment.
I couldn't see it attached to my first post.

I am pasting it (sorry for this big post)

3/20/2009 11:52:45 PM 3380 Macro completed
3/20/2009 11:52:45 PM 3380 NIS-CMD: appSendText| Row# 2
3/20/2009 11:52:45 PM 3380 NIS-CMD: PLAY| -macro add_to_site -var_text Did[SP]you[SP]know[SP]that[SP]your[SP]goldfgfd[SP]can[SP]live[SP]for[SP]over[SP]10[SP]years?[SP]Under[SP]the[SP]right[SP]conditions[SP]he[SP]can[SP]live[SP]even[SP]longer[SP]but[SP]most[SP]never[SP]make[SP]it[SP]past[SP]the[SP]first[SP]year![SP]If[SP]you[SP]want[SP]your[SP]goldfgfd[SP]to[SP]live[SP]long[SP]and[SP]healthy[SP]lives,[SP]you’ve[SP]got[SP]to[SP]provide[SP]the[SP]proper[SP]environment.[BR][LF][BR][LF]It’s[SP]a[SP]common[SP]misconception[SP]that[SP]a[SP]goldfgfd[SP]can[SP]live[SP]in[SP]a[SP]tiny[SP]bowl.[SP]In[SP]order[SP]for[SP]him[SP]to[SP]survive[SP]for[SP]any[SP]length[SP]of[SP]time,[SP]you’ll[SP]need[SP]to[SP]do[SP]frequent[SP]water[SP]changes[SP]and[SP]cleanings[SP]of[SP]the[SP]bowl[SP]–[SP]that’s[SP]a[SP]lot[SP]of[SP]work[SP]and[SP]living[SP]in[SP]a[SP]bowl[SP]isn’t[SP]much[SP]fun[SP]so[SP]it’s[SP]best[SP]to[SP]keep[SP]your[SP]fgfd[SP]in[SP]a[SP]regular[SP]tank[SP]with[SP]a[SP]proper[SP]filtration[SP]system.[BR][LF][BR][LF]The[SP]size[SP]of[SP]your[SP]tank[SP]depends[SP]on[SP]how[SP]many[SP]goldfgfd[SP]you[SP]want[SP]to[SP]keep[SP]in[SP]it.[SP]A[SP]good[SP]rule[SP]of[SP]thumb[SP]is[SP]to[SP]allocate[SP]about[SP]7[SP]gallons[SP]of[SP]water[SP]per[SP]fgfd,[SP]so[SP]if[SP]you[SP]want[SP]5[SP]goldfgfd[SP]a[SP]35[SP]gallon[SP]tank[SP]is[SP]recommended.[SP]It’s[SP]better[SP]to[SP]keep[SP]fgfd[SP]in[SP]a[SP]long[SP]tank[SP]that[SP]has[SP]plenty[SP]of[SP]surface[SP]to[SP]air[SP]space[SP]as[SP]goldfgfd[SP]like[SP]to[SP]have[SP]a[SP]lot[SP]of[SP]oxygen[SP]in[SP]their[SP]water.[SP]A[SP]tall[SP]hexagon[SP]shaped[SP]tank[SP]won’t[SP]be[SP]the[SP]best[SP]tank[SP]for[SP]these[SP]fgfd.[BR][LF][BR][LF]Goldfgfd[SP]like[SP]their[SP]water[SP]to[SP]be[SP]a[SP]little[SP]on[SP]the[SP]cool[SP]side[SP]–[SP]between[SP]65[SP]and[SP]72[SP]degrees[SP]Fahrenheit[SP]so[SP]in[SP]most[SP]cases[SP]a[SP]heater[SP]is[SP]not[SP]necessary.[SP]You[SP]should,[SP]however[SP]have[SP]a[SP]thermometer[SP]in[SP]the[SP]tank[SP]and[SP]take[SP]the[SP]appropriate[SP]measures[SP]if[SP]the[SP]temperature[SP]gets[SP]above[SP]72[SP]degrees[SP]as[SP]higher[SP]temperatures[SP]can[SP]make[SP]your[SP]fgfd[SP]more[SP]susceptible[SP]to[SP]disease.[SP]Bear[SP]in[SP]mind[SP]that[SP]most[SP]other[SP]tropical[SP]fgfd[SP]like[SP]their[SP]water[SP]on[SP]the[SP]warm[SP]side,[SP]so[SP]you[SP]will[SP]have[SP]to[SP]be[SP]careful[SP]what[SP]fgfd[SP]you[SP]put[SP]in[SP]the[SP]tank[SP]with[SP]your[SP]goldfgfd.[BR][LF][BR][LF]Provide[SP]the[SP]goldfgfd[SP]tank[SP]with[SP]a[SP]filtration[SP]system[SP]that[SP]is[SP]appropriate[SP]for[SP]the[SP]size[SP]of[SP]the[SP]tank.[SP]If[SP]you[SP]are[SP]keeping[SP]the[SP]fancy[SP]tailed[SP]goldfgfd,[SP]don’t[SP]use[SP]a[SP]system[SP]that[SP]will[SP]provide[SP]too[SP]much[SP]current[SP]as[SP]this[SP]can[SP]make[SP]it[SP]difficult[SP]for[SP]them[SP]to[SP]swim[SP]around.[SP]You’ll[SP]also[SP]want[SP]to[SP]provide[SP]periodic[SP]water[SP]changes[SP]as[SP]you[SP]should[SP]with[SP]any[SP]tank.[BR][LF][BR][LF]One[SP]of[SP]the[SP]main[SP]reasons[SP]that[SP]fgfd[SP]become[SP]sick[SP]is[SP]due[SP]to[SP]poor[SP]water[SP]quality.[SP]To[SP]keep[SP]your[SP]goldfgfd[SP]healthy,[SP]make[SP]sure[SP]you[SP]provide[SP]the[SP]filtration[SP]and[SP]water[SP]changes[SP]but[SP]also[SP]be[SP]careful[SP]about[SP]overcrowding[SP]and[SP]overfeeding.[SP]Too[SP]many[SP]fgfd[SP]or[SP]too[SP]much[SP]decaying[SP]food[SP]and[SP]waste[SP]will[SP]cause[SP]the[SP]water[SP]in[SP]your[SP]tank[SP]to[SP]become[SP]toxic[SP]to[SP]your[SP]fgfd.[BR][LF][BR][LF]Keeping[SP]goldfgfd[SP]can[SP]be[SP]a[SP]wonderful[SP]hobby[SP]and[SP]with[SP]minimal[SP]work,[SP]you[SP]can[SP]get[SP]a[SP]tank[SP]up[SP]and[SP]keep[SP]it[SP]running[SP]with[SP]healthy[SP]fgfd.[SP][BR][LF][BR][LF][BR][LF]vcvvcv[SP]the[SP]vcvcv[SP][BR][LF][BR][LF]vcv[SP]vcvcvc[SP]vcv[SP]vcxvcx[SP]vcv[SP]cvcx[SP]of[SP]http://www.cvcvcvcxvcx.com">cvcxvcvcx.com[SP]–[SP]vcx[SP]E[SP]vcxv[SP]cxv[SP]where[SP]you[SP]can[SP]cvvcx[SP]more[SP]about[SP]keeping[SP]http://www.vcvcxvcv.com/vcvcxvcxvxccx.html">[SP]cxvcxfgfd[BR][LF][BR][LF]vcvcxv[SP]cxv[SP]vcx[SP]cvc[SP]and[SP]cvcx[SP]this[SP]cxvcx[SP]as[SP]cxv[SP]vc[SP]vcx[SP]vcvcx[SP]vcx[SP]cx[SP]cx[SP]the[SP]cx[SP]acx[SP]yovcx[SP]mcxvt[SP]cxnxc[SP]the[SP]rcxvcxvcx[SP]vcxvcxx[SP]wicx[SP]acx[SP]icx[SP]accxvcxvcxe[SP]lcasdfsfdks.
3/20/2009 11:52:45 PM 3380 START add_to_site.iim
3/20/2009 11:52:45 PM 3380 http://www.xxxx.com/member/xxxx.php 0||||
3/20/2009 11:52:47 PM 3380 about:blank 0||||
Post Reply