Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to define values in Action menu command?

Contributor ,
Aug 11, 2025 Aug 11, 2025

I am creating an action where I am using a menu command, I have added the distort and transform effect from the effect menu. 

Although this is added, but I am unable to pre-define a set of values here. Right now, It is just getting added.

How to achieve that?

 

StarAG_1-1754905564115.png

 

TOPICS
Feature request , How-to , Scripting
222
Translate
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

Enthusiast , Aug 12, 2025 Aug 12, 2025

Not possible in Action as far as I know, but ExtendScript can set effects via applyEffect.

 

The following code adds a transform effect that scales the selected item to 200% of its width, based on the top left corner.

/**
  * @File applyEffect sample
  * @Version 1.0.0
  * @author sttk3.com
*/

(function() {
  if(app.documents.length <= 0) {return ;}
  var doc = app.documents[0] ;
  var sel = doc.selection ;
  if(sel.length <= 0) {return ;}
  
  var scaleH_Percent = 200 ;
  var scaleV_Percent = 
...
Translate
Adobe
Enthusiast ,
Aug 12, 2025 Aug 12, 2025

Not possible in Action as far as I know, but ExtendScript can set effects via applyEffect.

 

The following code adds a transform effect that scales the selected item to 200% of its width, based on the top left corner.

/**
  * @File applyEffect sample
  * @Version 1.0.0
  * @author sttk3.com
*/

(function() {
  if(app.documents.length <= 0) {return ;}
  var doc = app.documents[0] ;
  var sel = doc.selection ;
  if(sel.length <= 0) {return ;}
  
  var scaleH_Percent = 200 ;
  var scaleV_Percent = 100 ;
  var attrData =
       'R scaleH_Percent ' + scaleH_Percent
    + ' R scaleV_Percent ' + scaleV_Percent
    + ' R scaleH_Factor ' + (scaleH_Percent / 100)
    + ' R scaleV_Factor ' + (scaleV_Percent / 100)
    + ' R moveH_Pts 0'
    + ' R moveV_Pts 0'
    + ' R rotate_Degrees 0'
    + ' R rotate_Radians 0'
    + ' B transformObjects 1'
    + ' B transformPatterns 0'
    + ' B scaleLines 0'
    + ' B reflectX 0'
    + ' B reflectY 0'
    + ' B randomize 0'
    + ' I pinPoint 0'
    + ' I numCopies 0'
  ;
  var xml = <LiveEffect name="Adobe Transform">
      <Dict data={attrData}/>
    </LiveEffect> ;
  XML.prettyPrinting = false ;
  var effectXML = xml.toXMLString() ;

  sel[0].applyEffect(effectXML) ;
})() ;
Translate
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
Valorous Hero ,
Aug 14, 2025 Aug 14, 2025
LATEST

If you say predefined in such a way that you could capture them as graphic styles, then actions could at least apply the graphic style by name.

Translate
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