Adobe AIR to execute program

后端 未结 10 2189
陌清茗
陌清茗 2020-12-01 00:28

I would like to press a button from an Adobe AIR application and execute some installed program. For example, I would have a button named \"Start Winamp\". When this is pres

10条回答
  •  执念已碎
    2020-12-01 00:48

    in mac os x, if you want to launch an .app file, then you have to write the following for the file path. (Assume that the name of the app is xxx)

    if(NativeProcess.isSupported)
    {
        //not correct
        //file = file.resolvePath("/Applications/xxx.app");
    
        //correct
        file = file.resolvePath("/Applications/xxx.app/Contents/MacOS/xxx");
    
        var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
        nativeProcessStartupInfo.executable = file;
        var process:NativeProcess = new NativeProcess();
    
        process.start(nativeProcessStartupInfo);
    
    }
    

提交回复
热议问题