Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


convert XML to ATN (action-file)

Community Beginner ,
Mar 29, 2021 Mar 29, 2021

Copy link to clipboard

Copied

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

TOPICS
Actions and scripting

Views

401

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

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.

Capture.jpg

 

 

JJMack

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2021 Aug 01, 2021

Copy link to clipboard

Copied

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.

Untitled.png

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 01, 2021 Aug 01, 2021

Copy link to clipboard

Copied

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.

image.png

 

JJMack

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2021 Aug 01, 2021

Copy link to clipboard

Copied

I think I need to manually change the input/output file to the name of the file I try to convert, I am going to try tonight.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 01, 2021 Aug 01, 2021

Copy link to clipboard

Copied

You can edit actions steps in the Actions palette  it edits as well as records and plays actions,. With a document open in Photoshop highlight the step you want to edit an use the action palette menu record Again. Or click the record button then record the steps you want to replace the step with then press stop recording button, You can the delete or un-check the step step you highlighted for replacement.

 

 

JJMack

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2021 Aug 01, 2021

Copy link to clipboard

Copied

Thanks, it is a long script, and could be difficult to edit using action palette.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 02, 2021 Aug 02, 2021

Copy link to clipboard

Copied

LATEST

Actions are not Photoshop Scripts. However there is a Xtool app photoshop  script "ActionFileToJavascript.jsx" that will convert an action set to JavaScript code.  The action scripts will still be sequence of Photoshop steps that have fixed settings and no programming logic to control execution. You can edit this JavaScript code to  change steps into JavaScript  functions and add logic to program processors  to  process your images some logical way. Scripts are programs they can do things that are not possible with an Action.    The down side is Action Manager code for a photoshop steps is not very readable you need to make javascrpt functions using the Action Manager code to make the steps programable where the script can set the steps setting an use the step when needed.   Actions are a sequence of fixed photoshop steps.      Script are programed procedures that use logic to access your images properties and process them some logical way using photoshop steps.

JJMack

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines