Copy and paste variable, append

Discussions and Tech Support related to the iMacros Google Chrome extension.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Copy and paste variable, append

by pbieber on Mon Sep 04, 2017 12:13 am

Hi everyone

Windows 7 Enterprise
Version 6.1 build 7601 Service Pack 1
Chrome Version 60.0.3112.113 (Official Build) (32-bit)

I'm making a very simple Macro, and what I need to do is copy and paste a field content rather than paste text as shown below.

Basically, we have two fields, from another website that we need to paste the information from, the Requestor Location (School Name) (Line 5) and the Number (Line 8).

I have spent a long time using Extract and Variable functions without success, it is a very simple webform to copy and paste. I haven't gotten the attempts down here, but the simple copy and paste that the iMacro will do when recording:

VERSION BUILD=9030808 RECORDER=FX
TAB T=1
URL GOTO=https://tracer.eq.edu.au/HRMIS/Replacements/OperatorConsole.aspx
TAG POS=1 TYPE=DIV ATTR=ID:ctl00_b_bc_ac_ucQueue_divAddbooking
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:ctl00_b_bc_ac_ucRequestTab_selSchool_cbSchool_Input CONTENT=Moggill<SP>State<SP>School
TAG POS=1 TYPE=LI ATTR=TXT:0073<SP>|<SP>Moggill<SP>State<SP>School
TAG POS=1 TYPE=A ATTR=ID:ctl00_b_bc_ac_ucRequestTab_rptReasons_ctl00_rpbBooking_i0_i0_btnToday
TAG POS=1 TYPE=TEXTAREA FORM=ID:aspnetForm ATTR=ID:ctl00_b_bc_ac_ucRequestTab_taOperatorNotes_txt CONTENT=HR1687949



Also how to append text

Rather than replacing it using this code
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:u_cs_hr_req.do ATTR=ID:u_cs_hr_req.short_description CONTENT=05/09/2017<SP>TRACER<SP>New<SP>Request<SP>Line<SP>+1

I would like to append simply +1 on the end and the date on the front (which I can change in the macro as appropriate).

It would be super as it would save me so much time at work to be able to copy the school name from a field, paste it into the webform, and the same name with HR number.
pbieber
 
Posts: 1
Joined: Sun Sep 03, 2017 11:50 pm

Re: Copy and paste variable, append

by chivracq on Mon Sep 04, 2017 2:52 am

pbieber wrote:Hi everyone

Code: Select all
Windows 7 Enterprise
Version 6.1 build 7601 Service Pack 1
Chrome Version 60.0.3112.113 (Official Build) (32-bit)


I'm making a very simple Macro, and what I need to do is copy and paste a field content rather than paste text as shown below.

Basically, we have two fields, from another website that we need to paste the information from, the Requestor Location (School Name) (Line 5) and the Number (Line 8).

I have spent a long time using Extract and Variable functions without success, it is a very simple webform to copy and paste. I haven't gotten the attempts down here, but the simple copy and paste that the iMacro will do when recording:

Code: Select all
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
URL GOTO=https://tracer.eq.edu.au/HRMIS/Replacements/OperatorConsole.aspx
TAG POS=1 TYPE=DIV ATTR=ID:ctl00_b_bc_ac_ucQueue_divAddbooking
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:ctl00_b_bc_ac_ucRequestTab_selSchool_cbSchool_Input CONTENT=Moggill<SP>State<SP>School
TAG POS=1 TYPE=LI ATTR=TXT:0073<SP>|<SP>Moggill<SP>State<SP>School
TAG POS=1 TYPE=A ATTR=ID:ctl00_b_bc_ac_ucRequestTab_rptReasons_ctl00_rpbBooking_i0_i0_btnToday
TAG POS=1 TYPE=TEXTAREA FORM=ID:aspnetForm ATTR=ID:ctl00_b_bc_ac_ucRequestTab_taOperatorNotes_txt CONTENT=HR1687949


Also how to append text

Rather than replacing it using this code
Code: Select all
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:u_cs_hr_req.do ATTR=ID:u_cs_hr_req.short_description CONTENT=05/09/2017<SP>TRACER<SP>New<SP>Request<SP>Line<SP>+1


I would like to append simply +1 on the end and the date on the front (which I can change in the macro as appropriate).

It would be super as it would save me so much time at work to be able to copy the school name from a field, paste it into the webform, and the same name with HR number.

Your iMacros Version is missing..., v9.0.3 is a Version for FF but if you are on CR60, then I guess you are probably using v8.4.4 for CR...

iMacros can use the OS Clipboard with '!CLIPBOARD' but the pasting part with '{{!CLIPBOARD}}' is not supported on CR... (But there is a Workaround using the 'EVENT' Mode with 'Ctrl^v'...)
But you probably don't need to use the Clipboard and let iMacros extract (=copy) the 2 Fields from Site_1 on Tab_1 to then paste them on Site_2 on Tab_2.
But the Script you've posted only handles the pasting part on Site_2..., can you record tagging the 2 Fields on Site_1...?
Then you simply need to add "EXTRACT=TXT" at the end of each 'TAG' Statement, store each Extract in a Temp Var (x2) and reuse those 2 Vars for the Paste on Site_2. If you can post the mini-Script for tagging the 2 Fields from Site_1, I can adapt your Script for you...

I don't completely understand the "Append" part, it's an 'INPUT' Field, so you must type its Content anyway...
But for "easy Access", you can declare 2 Vars at the beginning of your Script like:
Code: Select all
SET Short_Descr_Date "05/09/2017"
SET Short_Descr_Nb "+1"

'TAG POS=1 TYPE=INPUT:TEXT FORM=ID:u_cs_hr_req.do ATTR=ID:u_cs_hr_req.short_description CONTENT=05/09/2017<SP>TRACER<SP>New<SP>Request<SP>Line<SP>+1
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:u_cs_hr_req.do ATTR=ID:u_cs_hr_req.short_description CONTENT={{Short_Descr_Date}}<SP>TRACER<SP>New<SP>Request<SP>Line<SP>{{Short_Descr_Nb}}
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6479
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to iMacros for Chrome

Who is online

Users browsing this forum: No registered users and 1 guest

-->