How Do I Extract Shipping Address from Shopify Web Page and Paste into Pages Form?

Unfortunately, the URL requires an account an a login. So please just upload the HTML code of the page.
Unless you happen to have a dummy, test account we could use. You could PM me with the login details.

If you click in the "Name" field and then press TAB, does it move the focus to the next field, "Street or P.O.Box" ?

If so, we can extract the data from the web page, then paste and TAB to paste into the Pages form. Make sense?

1 Like

I can also press TAB to go the next field. It goes from all the way from the left to the right side.

OK, assuming that the data on the web page is always in this order:

Fake Customer
Fake street
0543 Faketown
Norway 
928123123

Then this macro should work.

How To Use

  1. Open the web page to the page of interest (that you want to copy FROM)
  2. Switch to the Pages form, and select the "Name" field.
  3. Trigger this macro

It currently uses "Insert text by Typing" because that is what I needed to use in testing with Excel. You may be able to change to "Insert text by Pasting" with Pages app. I don't know since I don't have your Pages file/form.

Let us know if this works, or if you have issues/questions.


updated 2018-03-08 13:59 GMT-0600

MACRO:   Copy Ship Address from Shopify to Pages


  * Added more TABs between typing of data into Pages fields

#### DOWNLOAD:
<a class="attachment" href="/uploads/default/original/3X/2/f/2fa5765b7b7c93cc98dc5d9e37fb36659c189ed5.kmmacros">Copy Ship Address from Shopify to Pages.kmmacros</a> (164 KB)
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**

---



![image|491x1964](upload://fvdBFnvhV7PpqAvrr83miq12CFe.jpg)

I followed all your steps. But I got 1 question and also this happen.

  1. Does this work on any Shopfiy store? Or does the HTML code need to be from the same store?Then I should probably give you our HTML code for our normal store.

This is also the video when I press the button and follow your steps.
Video

AFAIK, it should work with any store that has the same HTML for the Shipping Address section of the web page. The easiest way to find out is to try it.

I see from your video that the tab order is NOT the same as I thought, which the Macro is designed for. But this is easy to fix. Just add additional Type the TAB keystroke actions to move the focus to the proper field:

image

Okey I managed to add the TAB keystroke. The only problem is that is randomly typing out the information on the invoice for some reason? Does it follow my mouse pointer or something else that makes it write random information on a random field.

Here is a video so you can see Video

Also TAB
TAB

I doubt that it is random. You may need to add several TAB keystrokes in the proper places. It may also be necessary to add a brief Pause (like 0.2 sec) in some/all places after the TAB to ensure Pages is ready to receive the typing in the proper location.

@Lamin_Jadama, OK I have update the macro in the above post to add more TABs. Please try this revised macro and let us know if it now works for you.

If it is still giving you problems with the text being typed in the wrong place, you may need to adjust the number of TABs, and/or insert a Pause after the TAB block:

image

It kinda works, the problem is that I have to have my mouse course in some special place to make it work or else it wont at all. Do you know why?

You can see here that how it types out everything depending on where my mouse is when pressing the HOT KEY.

Video

Yes, that is correct. As I stated in my above post with the Macro:

The macro does NOT know where the "Name" field is. So you MUST first click in the Name field (where the data is to be entered), THEN trigger the macro.

From that point, the macro uses TABS to move to the next input field. Again, you may need to adjust the number of TABS to use between fields.

It works! Thank you!

I’m just going to ask one last thing. Is there some way for the macro to copy the “Name” and past it in to “Contact name”. If no, thats alright.

I’m unsure here, because I get an error on my normal shopfiy store for some reason. Does the code only trigger for this words Fakestore
error

Sure. If you mean you want the same data put into both the "Name" field AND the "Contact name" field, then just replace the TAB block with 8 tabs with:

image

Perfect!

Everything is working now, except for the last bit where it will only look for
Fake Customer
Fake street
0543 Faketown
Norway
928123123

Is there any way so that it will look for the information there even if its another name/city/phonenumber/adress?

I made a video to show you what I mean

Looks like you forgot to provide a link to the video.
IAC, it would be helpful if you would also create an example of what you want in the dummy/test account you created, and provide that link.

I found the problem, when I created the Dummy order I used the
URL :https://fakeasstore.myshopify.com/admin/draft_orders/34547728436
Which is for draft orders.

But I will be using this one normally which is normal orders from customers.
URL: https://famme-sportswear.myshopify.com/admin/orders/344594579484

I just need to copy in this URL somewhere so it works with the maestro.

Replace the script in the first Action (Execute JavaScript in Front Browser) with this script:

JavaScript to Extract Shipping Address from Revised Web Page

//--- VER 2.0    2018-03-08  ---
//  Use Revised Order Web Page
//  https://fakeasstore.myshopify.com/admin/orders/326207438900

var custCardElem = document.getElementById('customer-card');

var shipAddrElem = custCardElem.querySelector('p.type--subdued');
shipAddrElem.innerText;

It works fine now!!

I just want to say thank you for everything!

1 Like

@Lamin_Jadama, I hope you don’t mind that I have changed the Title of your Topic:

FROM:
Macro to copy from Google chrome and paste in Invoice Form

TO:
How Do I Extract Shipping Address from Shopify Web Page and Paste into Pages Form?

in order to make it more clear what problem you want to solve, so that it will be easier for future readers to search and find.

No not at all, I’m surprised you understood everything I said! My English is not best.

I have uploaded the final version of this macro to the Macro Library section:

Macro: Extract Data from Web Page and Paste into Mac App [Example]

to make it more accessible.