Can I record actions in InDesign

New Here ,
Feb 18, 2021 Feb 18, 2021

Copy link to clipboard

Copied

Is there a way to record an action in InDeisgn that would work with Photoshop? Rather than having to right click on an image, open in Photoshop, preform an action on my image then save and update the link in Indeisgn, can I do it with one action? So the InDesign action would open the selected image in Photoshop - do a photoshop action with a save and close, then update the link in InDesign. Just saves me a few clicks per image, but as I have thousands of images that need various actions performing on them it would save a lot of time.

TOPICS
Scripting

Views

95

Likes

translate

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

correct answers 1 Correct Answer

Adobe Community Professional , Feb 18, 2021 Feb 18, 2021
Simple answer: no. But maybe you/someone can script something 

Likes

translate

Translate

Translate
Adobe Community Professional ,
Feb 18, 2021 Feb 18, 2021

Copy link to clipboard

Copied

Simple answer: no.

But maybe you/someone can script something 😉

Likes

translate

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
Engaged ,
Feb 20, 2021 Feb 20, 2021

Copy link to clipboard

Copied

Hi @Matthew5C62,
for the use case you mentioned, have a look at Zevrix's LinkOptimizer,

Likes

translate

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 ,
Feb 21, 2021 Feb 21, 2021

Copy link to clipboard

Copied

 

Try this.

Edit the first two variables for your action—the action’s name and it’s group name—names are case sensitive.

 

EDIT: I added a loop to update the link after the Photoshop action runs

 

 

 

 

//Opens a selected image in Photoshop and runs an action
//Rob Day 2-21-2021

//#target indesign
#targetengine "session" 

//edit as needed names are case sensitive
var act = "Your Action"
var actgrp = "Your Action Group"

var doc = app.documents.item(0);
var s = doc.selection[0];

if (s == null || s.constructor.name != "Image") {
	alert("Please Direct Select an Image and Try Again.")
} else {
    var lnk = s.itemLink
    if (lnk.status == LinkStatus.NORMAL || lnk.status == LinkStatus.LINK_OUT_OF_DATE) {
        editImage(s.itemLink.filePath, act, actgrp);
    }else{
        alert("Image link is missing.")
        exit()
    }   
}


while (lnk.status != LinkStatus.NORMAL) {
    lnk.update();
}


/**
* Opens Photoshop via Bridgetalk and runs psScript 
*  the file path to open 
*  the action to run 
*  the actions group
*  value void
* 
*/
function editImage(s, act, actgrp){
    var bt = new BridgeTalk();  
    bt.target = "photoshop";
    bt.body = "var s = '"+s+"'; var act = '"+act+"'; var actgrp = '"+actgrp+"'; var func = " + psScript.toString() + "func();";

    bt.onResult = function(resObj) { }  
    bt.onError = function( inBT ) { alert(inBT.body); };  
    bt.send(8);  
      
    function psScript() {  
        var f = open(File(s)) 
        doAction(act, actgrp)
        f.save()
        f.close()
    }  
}

 

 

 

 

 

Likes

translate

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