Jump to content
Macro Express Forums

JavaScript or JScript for Edge & external scripts


Recommended Posts

I need confirmation (and can't find on the main Insight Software site), that Macro Express Pro uses Javascript and not JScript.  We use the external script tool to open URLs and write data into the ID fields of the URL. 
JScript works with IE9 however JScript 10 is AKA JScript.net
Since our companies are moving to "Edge" as their Default Browser, I am wondering what the external script "Jscript" actually references.

 

Also, does this program allow us to import external scripts?  IE, Does it allow external scripts to be imported and if so, any specifics would be helpful.
Thanks

Link to comment
Share on other sites

The help file says JScript. To be sure, find somehting that is different between the two and make a sample script. The success or failure would confirm which it is. 

 

The scripts are just ASCII text. You can write the text into the macro command which is easiest for simple ones that never change. When I need them variable, I save them in text files and load them into a text variable in MEP and use the variable in the External Script command. 

Link to comment
Share on other sites

Thanks Cory,  I am thinking we are looking to load "Sellenium" as external script. Edge required drivers to link the script and Edge. 
We set ASCII variables (Tab, CRLF) in prompts.   However, you are saying you load alot of ASCII characters in a .txt file on your "c" drive.  Then load the .txt file in MEP which you use in the External script you choose?  (JScript, VBScript or HTA/HTML).  I'm sorry, but the last sentence confuses me.  

 

Link to comment
Share on other sites

I assume you know that all scripting languages are ASCII strings. And one can save those in files. So in the macro I load that string into a variable from the file. Then in the box I use that variable. In this example I use Variable Set String using the Set Value From File option to load the contents into %SomeExternalScript%. This way I can modify the script file and not have to modify the macro. 

 DeleteMe.jpg.a1126072b1a9b67d3a374da18fa8fe2d.jpg

Also you can mix it up. I find passing parameters tricky sometimes, so I feel it's easier to put MEP variables in my script. When MEP executes that command, those variables become strings. Say you have a script to check the headers on a URI. You can make the URI a variable. I had a recent post with an example of that. 

Link to comment
Share on other sites

I use the .NET WebBrowser control to make my own automated browsers sometimes. This way it's all a model including the rendered DOM which I can interact with programmatically. I figured if I was going to learn a language, which most web automation tools like iMacros need, I woudl just learn how to do it in .NET and make a proper program. 

Most of the ones I do I use the HTTPWebRequest/Response objects as rendering the document takes time and the text is modified before rendering to 'fix' common problems. So I just grab the raw HTML and get what I need from it using RegEx. I can even travers though a series of pages that way picking up tokens and cookies or whatever needed to interact with the statefull... state. It's much faster than navigating and rendering each page. Also I often find tokens can be reused or steps skipped speeding the process.

Also I often find that the navigation isn't necessary and that at the end there's a simple GET with URI parameters or a HTTP POST with parameters I can tweak. Say the web form search offers 10, 50, or 100 results per page. Well that's a parameter in the post data and I change it to 10,000. I can often get the entire results set in a single request. Seconds to get a boatload of data. 

I often avoid reCAPTCHA's too this way as they often only protect the form pages. In many cases the last step is a query in JSON from a script on the web page to a AWS server or somehting. The script takes that then propagates a table on the web page for instance. Well I just copy that request, tweak the parameters, and get huge JSON DataSets I can port directly into my MS SQL database using the JSON Deserializer. No HTML, no DOM. Just the data. 

And for pushing data though forms it's also similar. I analyze and make a stripped down process that just uses POST requests to push a bunch of data to their server. No filling out textboxes or clicking buttons. Just send the data like the Web Browser does. 

  • Like 1
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...