i am trying to import an xml in actionscript. I a mworking with the indesgin SDK.
Now the SDK is telling me the following:
importXML(fromParam:File = null):void Imports the specified XML file
into an InDesign document.
And a the moment i’m doing it this way:
document.importXML(File.desktopDirectory.resolvePath("baseXml.xml"));
But the problem is that i cant ask the user to add an xml file to their desktop so i can import it when needed. So i added the xml to my project. I added it to the package:
resources/xml/baseXml.xml
Now my problem is that i cant seem to be able to my File object to this path and thus cant select the xml file. Can anyone help me solve this please?
The XML file isn’t in your desktop directory, it’s in the application folder. Try:
The files in the application directory are read-only, however, so if you plan on modifying the XML file you can copy it to somewhere in the
applicationStorageDirectoryusingcopyTo.The other option is to allow the user to choose the file path by using
file.browseForOpen.