Jump to content
Macro Express Forums

Text Handling


clipboard

Recommended Posts

Hi folks

This is my first post and I've a feeling that my level of expertise will readily become apparent. At the moment I use a very small macro to help me highlight and save to disk certain web info. I open a web page and on it is listed a whole load of components. Each component is a link to a seperate page which gives the size, pricing, delivery info for that particular piece which I copy to a text file for future use. THE NAME OF THE COMPONENT IS HIGHLIGHTED IN RED AT THE TOP OF ITS OWN PAGE and all other text is the usual black type.

 

Okay, at the moment I open the main web page and click on a component name. When this second page loads I then hit my macro which selects the entire page, copies it to the clipboard, opens notepad, pastes the info onto the page, opens a destination folder on the HD and clicks on "save as". That's it. I then enter the name of the component, save it and then close notepad, close the component page and click on another component on the list and start all over again. There are sometimes 100's of component infos to save (very time consuming). Just using this small macro to select all, copy and paste has saved me hours of boring repetition.

 

What I would really like is to be able to click the fist name on the list and for everything to be fully macroed from there. As the macro made it's way down the list copying, pasteing and saving I would be doing cartwheels in delight but I will settle for......

 

........... I would like to get the macro to enter the name of the component into the notepad "save as" field, save it, close all the windows and return me to the main page. All I have to do is click each item in turn and then hit the macro. Perfect. Any ideas??

 

I thought that the name of the individual component being in RED TEXT may be pertinent!

 

This is my small macro

 

Text Type;<CONTROL>a

Clipboard Copy

Program Launch:notepad.exe

Clipboard Paste

Clipboard Empty

Delay 380 ms

Mouse Move Window 19,38

Mouse Left Button Down

MOuse Left Button Up

Mouse Move Window 50,110

Delay 1031ms

Mouse Left Button Down

MOuse Left Button Up

Delay 520ms

Mouse Move Window 46,60

 

Many thanks and apologies for the amateurish approach. :(

Link to comment
Share on other sites

Hi Randall

 

Thanks for your response. Just checked and yes you can "View code" and "Save As" on both pages............ main listing and sub info page.

 

I'm glad to read that you think it should be easy enough :) . In my limited experience "easy" and "computers" are 2 words which never appear in the same sentence :(

 

 

Best regards

 

Clipboard

Link to comment
Share on other sites

Hi Randall again

 

I use about a dozen different sites but they all have the same access levels. If you can sort out the procedure for this first one I will be able to modify my macros web addresses, etc to suit.

 

One of the main sites I use is "www.futurlec.com". To give you some sort of taster as to my modus operandi ...... click on "components" (top menu), click "LED's/LCD's" (LH menu) and click "LED Displays" (LH menu).

 

This first page I copy and paste 'cos it has all the stock availability and pricing on. Then I click each "more info" tab in turn and use my macro to copy/paste into Notepad and then open the destination folder. The problem as you can see is with the component name. When I type in the "save as" field I often make typos and the comparison prog I use can't find the info 'cos it's got the wrong name!!!!

 

The name "7SEGIRCA_Red Single 7_Segment CA Display" leaves a lot for potential typos (especially after I've done about 250) and this is the name I want my (our) macro to transfer into the "save as" field in Notepad.

 

Hope that gives you some more to work on

 

Appreciate your efforts

 

Best regards

 

clipboard (Keith)

Link to comment
Share on other sites

Hi,

Here is a way to get the simple part; the name in RED!, once you know the web page;

Example of calling macro "WebStringSplit", given you have found;

Web URL = into "Parameter1" [if current web page, use "ALT-d, Control-c, Set string form clipboard]

text before=color="#c41010"> into "Parameter2"

text after=</font> into "Parameter3"

<REM2:paramater1 - Web Site><TVAR2:01:01:http://www.futurlec.com/LED/7SEG1RCA.shtml><TMVAR2:19:01:00:000:000:Parameter1><REM2:parameter2 - Text Before split text><TVAR2:01:01:color="#c41010">><TMVAR2:19:01:00:000:000:Parameter2><REM2:parameter3 - Text After split text><TVAR2:01:01:</font>><TMVAR2:19:01:00:000:000:Parameter3><MACRUN2:{_WebStringSplit}><REM2:Process first significant line (line 2 as first one blank)  of ResultSplit.txt><IVAR2:01:01:0><BTFBEG:001:000002:000001:%InstallationPath%\ResultSplit.txt><NMVAR:08:01:0:0000001:0:0000000><TMVAR2:19:01:00:000:000:ItemName%N1%><BTFEND><REM2:Puts the first text in red into Env Var "ItemName1" or %T1%><TBOX4:T:1:CenterCenter000278000200:000:ItemName1%ItemName1%>
// paramater1 - Web Site

Variable Set String %T1% "http://www.futurlec.com/LED/7SEG1RCA.shtml"

Variable Modify String: Save %T1% to Environment Variable

// parameter2 - Text Before split text

Variable Set String %T1% "color="#c41010">"

Variable Modify String: Save %T1% to Environment Variable

// parameter3 - Text After split text

Variable Set String %T1% "</font>"

Variable Modify String: Save %T1% to Environment Variable

Macro Run: {_WebStringSplit}

// Process first significant line (line 2 as first one blank)  of ResultSplit.txt

Variable Set Integer %N1% to 0

Text File Begin Process: "ResultSplit.txt"

  Variable Modify Integer: Inc (%N1%)

  Variable Modify String: Save %T1% to Environment Variable

Text File End Process

// Puts the first text in red into Env Var "ItemName1" or %T1%

Text Box Display: ItemName1

Best, randall

__WebStringSplit_.mxe

Link to comment
Share on other sites

Hi, again;

Couldn't resist the automation of the table page, either.

You need to import all 3 "mxe" to a library, and run the LinkClick macro;

[To generalise to other sites, you will need to view source and similarly find the text just before and after your links, and in the linked pages, the names in red]

ExampleWebStringSplit2.mxe

{_WebStringSplit2}.mxe

Best, Randall

ExampleWebLinkClick.mxe

Link to comment
Share on other sites

Hi Randall

 

Sorry for the delay in getting back to you but.................... I've been spending a lot of time doing cartwheels lately ;)

 

It all works a treat. Thanks a lot. You've saved me hours and your assistance was first class.

 

I am really sold on ME and intend to get the "Explained" book. When that happens I can start practicing my backflips and somersaults :D

 

Thanks again

 

Best Regards

 

clipboard

(keith)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...