Skip to main content
Participant
March 30, 2021
Question

convert XML to ATN (action-file)

  • March 30, 2021
  • 1 reply
  • 3243 views

Hi everybody.

I want to convert an XML-File to ATN-File, by using xtools v2.3

ATN to XML works with this snippet, which I found in another forum:

//@show include
//
app;
//
//@includepath "/c/Program Files/Adobe/xtools;/Developer/xtools"
//
//@include "xlib/PSConstants.js"
//@include "xlib/Stream.js"
//@include "xlib/stdlib.js"
//@include "xlib/GenericUI.jsx"
//@include "xlib/Action.js"
//@include "xlib/xml/atn2bin.jsx"
//@include "xlib/xml/action2xml.jsx"
//
//@include "xlib/ActionStream.js"
//@include "xlib/ieee754.js"
//

function main() {
  var file = File("SOURCE.atn");
  var actFile = new ActionFile();
  actFile.read(file);
  var xml = actFile.toXML();
  Stdlib.writeXMLFile("TARGET.xml", xml);
};

main();
// EOF

now I need the code for opposite direction: XML to ATN but have no idea how.
Currently I am using the "ActionFileFromXML.jsx", but this shows up a GUI, but I need a silent script with
file paths in the parameters.
Would be great if someone can provide me a quick code

Thanks everybody

This topic has been closed for replies.

1 reply

JJMack
Community Expert
Community Expert
March 30, 2021

Thet XTools Photoshop scripts are in XTOOLS folder  APP folder and  the Lib Folders is also required for these Photoshop Script to work. Note I have lib as a sub-folder in my App  folder. These Script need to have a Dialog you will not be converting the same XML File to the Same Action Set or the Same Action Set to the Same XML File with these Scripts. You have to pass Files parameter to these scripts. The Scripts are not Photoshop Plug-in Scripts that you can record the file parameters into an Action Steps.  The Scripts will Always display their Dialogs, and output messages.

 

 

JJMack
Participant
August 1, 2021

Sorry, I am realy not an expert, just try to fix ATN I bought I got this error with above script, could anyone help, million thanks.

JJMack
Community Expert
Community Expert
August 1, 2021

It look like you may have been running a photoshop script theat tried to access a Photoshop  Action set "SOURCE.atn" in Photoshop version 2021 root directory on Windows.  That would be an unusual folder for an action set to be???? Are you  trying to use some XTool.  Here is what is in my Photoshop 2021 version 22.4.3 folder. Thet are no "*.atn" files.

 

JJMack