How to load .atn file in Photoshop?

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

poortip

How to load .atn file in Photoshop?

Post by poortip »

Hi

I need a script that loads an action set(*.atn file) in Photoshop CS5. I searched but couldn't find any solution regarding this.
Please help.

Thanks!
Mikaeru

How to load .atn file in Photoshop?

Post by Mikaeru »

poortip wrote:I need a script that loads an action set(*.atn file) in Photoshop CS5. I searched but couldn't find any solution regarding this.
This works for me in Photoshop CS and CS4 under Mac OS X 10.6.8; please give it a try:

Code: Select allfunction actionsFileFilter (f)
{
   return (f instanceof Folder) || ((f.type === '8BAC') || f.name.match (/\.atn$/i));
}
var select = (File.fs === "Macintosh") ? actionsFileFilter : "Actions Files:*.atn,All Files:*";
var inFile = File.openDialog ("Choose an actions file:", select);
if (inFile)
{
   app.load (inFile);
}

HTH...
Mike Hale

How to load .atn file in Photoshop?

Post by Mike Hale »

Yes, use app.load to add atn or preset files to Photoshop.
Mikaeru

How to load .atn file in Photoshop?

Post by Mikaeru »

Alternatively, instead of using the built-in function app.load (), you can define an equivalent function loadFile () made of Action Manager code:

Code: Select allfunction loadFile (file)
{
   var descriptor = new ActionDescriptor ();
   descriptor.putPath (app.stringIDToTypeID ("target"), file);
   app.executeAction (app.stringIDToTypeID ("open"), descriptor);
}