Jump to content

Enable a website to control another website


scopev24
 Share

Recommended Posts

Hi all!

Spent the past few days reading the forums and playin' around with autoit. Great tool :mellow:

Right now, I'm not quite sure if autoit/autoitx can accomplish what I'm trying to do.

I know, that I can start an IE instance, navigate, fill out forms and submit them. From what I've read so far I think it is possible, too, to attach to an already started IE instance. So an autoit script is able to navigate to some url, log me in, do some action, e.g. start a search.

Now here comes the point:

I'd like to do just this, simulating a user on a website doing some stuff. But I'd like to trigger this action from another website.

Background: We develop an intranet web-based software. There are other web based applications on the network, and our users also use those applications. Usually they do some research using our application, and then, switch browser windows, and start a search in another application with the results just obtained.

Let's call our main web-app App-A and another web application App-B.

Now user logs in into App-A, triggers a search. Now I'd like to have a button on the website saying "locate this search result in App-B". When the user clicks on it, autoit does some kind of alt-tab to another IE instance (where App-B is be already opened and user logged in), fill out a search form of App-B and submit.

To sum up, we try to provide a "jump to another web-app and do some stuff"-function on our website.

I suceeded in using an example I've found on the forums, where an activex control just opens a tool tip... Dunno if this is the way to go.

Any suggestions?

thanks in advance,

scope

Link to comment
Share on other sites

If I understand correctly, you want your web page to start a process on the local computer outside of the browser? That is a huge security issue waiting to happen.

Hi!

Yes, that's correct. I want the web page to start another browser instance, or, since users usually have both apps opened, switch to another window, fill out a form and send it.

This is (of course?) not possible by using javascript, because of the inter-domain-access-restriction.

To make that clear: We are talking about an intranet application with a closed user group. I just would like to have some kind of IE "plugin" that can be triggered from within our site to avoid excess copy&paste between the two applications, i.e. the needed values are transfered to the other website into various forms "on the fly". This should be as easy as possible for the user. I do not want to weaken the security settings of the IE to allow for our needs, just some kind of addon, even if this needs to be installed by every user. If this "plugin" can be installed via our website, of course after asking if it is ok to do so, that would be great. If all those things are not possible, we might be going for a standalone app, sitting in the taskbar and waiting for our website to trigger it. But that seems rather unconvenient to me.

Any indeas?

thanks!

scope

Link to comment
Share on other sites

Hi!

Currently it develops as follows:

I started a C# dll project. Added a reference to autoitx3.dll.

This is my test-class:

using System;
using System.Runtime.InteropServices;

namespace RemoteControlNS
{
 public interface RemoteControlSignatures
 {
  string openNotepad();
 }

 [ClassInterface(ClassInterfaceType.AutoDual)]
 public class RemoteControl : RemoteControlSignatures
 {
  public string openNotepad()
  {
   AutoItX3Lib.AutoItX3Class au3 = new AutoItX3Lib.AutoItX3Class();

   au3.AutoItSetOption("WinTitleMatchMode", 4);

   if (au3.WinExists("Unbenannt - Editor", "") == 0)
   {
    au3.Run(@"C:\WINDOWS\SYSTEM32\notepad.exe", "", au3.SW_SHOW);
   }
   else
   {
    au3.WinActivate("Unbenannt - Editor", "");
   }

   return "Hello World!";
  }
 }
}

If the resulting dll files are correctly registered, the following works:

<html>

<head>

<script language="javascript">

<!-- Load the ActiveX object -->

var x = new ActiveXObject("RemoteControlNS.RemoteControl");

alert( x.openNotepad() );

</script>

</head>

<body>

</body>

</html>

If I can start notepad, I should be able to attach to a running instance of IE...

From what I've read so far, it is not possible to use IE.au3 from within autoitx, therefor I'd have to reimplment the methods needed in C#.

greetings,

scope

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...