このサイトをビューするために JavaScript を有効化してください。

Altova XMLSpy 2021 Professional Edition

The JScript below starts the application and shuts it down. If the COM object of the 32-bit XMLSpy cannot be found, the code attempts to get the COM object of the 64-bit application; otherwise, an error is thrown. If an instance of the application is already running, the running instance will be returned.

 

 

メモ:32-ビット XMLSpy では、登録された名前、または COM オブジェクトのプログラム識別子 (ProgId) は以下の通りです:MapForce.ApplicationXMLSpy.Application。64-ビット XMLSpy では、名前は以下の通りです:MapForce_x64.ApplicationXMLSpy_x64.Application。プログラムの呼び出しは自身のレジストリハイブ、またはグループ (32-bit または 64-bit)内の CLASSES レジストリエントリにアクセスすることに注意してください。ですから、標準のコマンドプロンプトと上 64-bit Windows の Windows Explorerを使用してスクリプトを実行すると、 64-ビット XMLSpy. を指す 64-ビットレジストリエントリにアクセスされます。この理由のため、 XMLSpy 32-ビットと 64-ビットの両方がインストールされている場合、 32-ビット XMLSpy. を呼び出すために特別な処理が必要になります。例えば、スクリプトホストがプログラムを呼び出す場合以下を行います:

 

1.ディレクトリを C:\Windows\SysWOW64 に変更します。

2.コマンドライン上で wscript.exe を入力し実行するスクリプトパスを以下のように入力します:

 

wscript.exe "C:\Users\...\Documents\Altova\StyleVision2021\StyleVisionExamples\API\JScript\start.js"wscript.exe "C:\Users\...\Documents\Altova\XMLSpy2021\Examples\API\JScript\start.js"

 

 

// Initialize application's COM object. This will start a new instance of the application and
// return its main COM object. Depending on COM settings, the main COM object of an already
// running application might be returned.
 
try {   objSpy = WScript.GetObject("", "XMLSpy.Application");   }
catch(err) {}
 
if( typeof( objSpy ) == "undefined" )
{
  try   {   objSpy = WScript.GetObject("", "XMLSpy_x64.Application")   }
  catch(err)
  {
     WScript.Echo( "Can't access or create XMLSpy.Application" );
     WScript.Quit();
  }
}
 
// if newly started, the application will start without its UI visible. Set it to visible.
objSpy.Visible = true;
 
WScript.Echo(objSpy.Edition + " has successfully started. ");
 
objSpy.Visible = false;      // will shutdown application if it has no more COM connections
//objSpy.Visible = true;   // will keep application running with UI visible

 

 

The JScript code listed above is available in the sample file Start.js (see Example Files).

(C) 2015-2021 Altova GmbH