Thanks, but that gives the version of the host application, e.g. InDesign. I am looking to read my own extension's version info as input into the manifest xml - at run time.
AFAIK there is no API exposed by CSXS to get the bundle version. You can read the XML of the manifest and pull out the version though:
private function getExtensionVersion(manifestFile:File):String
var fileStream:FileStream = new FileStream();
var manifestXml:XML = XML(fileStream.readUTFBytes(fileStream.bytesAvailable));
var version:String = getExtensionVersion(basePath.resolvePath('CSXS/manifest.xml'));
Note that basePath is a property on CSExtension.
Hope that helps,
Thanks. That works well !
I seem to be having probelm getting the basePath I've looked everywhere I could to fine it.
Could give me a example of how to get the basePath? or what import needs to be used?
In your MXML file, CSExtension should be the root class. Then you can use "this.basePath":
<csxs:CSExtension xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:csxs="com.adobe.csxs.core.*" applicationComplete="appComplete()">
public function appComplete():void