Jump to content

AutoIT and Java with JACOB


TehnicDream
 Share

Recommended Posts

Hi, im new to autoit and i have a little problem i have to do a app to start some web pages and some windows base programs oane of them is Skype,

the problem is that Skype starts but only in system tray and i do not know how to appear on desktop the code i use is below:

 

public static String jvmBitVersion(){
        return System.getProperty("sun.arch.data.model");
}   
    
    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {                                         
                  
        String jacobDllVersionToUse;
            if (jvmBitVersion().contains("32")){
                jacobDllVersionToUse = "jacob-1.18-M2-x86.dll";
            }
            else {
                jacobDllVersionToUse = "jacob-1.18-M2-x64.dll";
            }

        File file = new File("lib", jacobDllVersionToUse);
        System.setProperty(LibraryLoader.JACOB_DLL_PATH, file.getAbsolutePath());

            AutoItX x = new AutoItX();
                x.run("C:\\Program Files (x86)\\Skype\\Phone\\Skype.exe");
                x.sleep(2000);
                x.winWaitActive("Skype");
                x.winActivate("Skype");
                
    }

 

Edited by TehnicDream
Link to comment
Share on other sites

Hi again i did it but the problem new is that i cant send tab or somting else only plain text

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {                                         
                  
        String jacobDllVersionToUse;
            if (jvmBitVersion().contains("32")){
                jacobDllVersionToUse = "jacob-1.18-M2-x86.dll";
            }
            else {
                jacobDllVersionToUse = "jacob-1.18-M2-x64.dll";
            }

        File file = new File("lib", jacobDllVersionToUse);
        System.setProperty(LibraryLoader.JACOB_DLL_PATH, file.getAbsolutePath());

        AutoItX x = new AutoItX();
        x.run("Skype", "C:/Program Files (x86)/Skype/Phone", AutoItX.SW_MAXIMIZE);
        x.winActivate("Skype");
        x.winWaitActive("Skype");
        x.sleep(2000);
        x.send("nu mai merge de aici sau pana aici merge");
        x.sleep(1000);
        x.send("{TAB}!n");

    }

 

Link to comment
Share on other sites

Hi im new with AutoIT and i have a problem with integration with java i  manage to do a script to open skype throw a java app but the problem is that the autoit part only sends text i need to sends things like ENTER and TAB this is the code

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {                                         

        String jacobDllVersionToUse;
            if (jvmBitVersion().contains("32")){
                jacobDllVersionToUse = "jacob-1.18-M2-x86.dll";
            }
            else {
                jacobDllVersionToUse = "jacob-1.18-M2-x64.dll";
            }
         try{ 
        File file = new File("lib", jacobDllVersionToUse);
        System.setProperty(LibraryLoader.JACOB_DLL_PATH, file.getAbsolutePath());
 
        AutoItX x = new AutoItX();
        x.run("Skype", "C:/Program Files (x86)/Skype/Phone", AutoItX.SW_SHOW);
        x.winActivate("Skype");
        x.winWaitActive("Skype");
        x.sleep(2000);
        x.send("{TAB}!n" );
         }catch(Exception e){
           
       } 
    }

Thy

Link to comment
Share on other sites

  • Developers

Ok, sory i will repost ther,

Thy

No need to repost, just request for getting it moved or else you end up with 2 threads on the same topic.

Topics merged. :)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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

×
×
  • Create New...