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

Selecting Artboard 1 and play script

New Here ,
May 22, 2019 May 22, 2019

I have a number of different actions I run, all based around Artboard 1. I'm not to familiar with scripting but it seems like there should be a script that can do the following (that I can then tie to a keyboard shortcut):

1. Make Artboard 1 active

2. Play the currently selected action (there is a button to do this in the Actions panel).

If anyone has done this or knows how to do it any help would be greatly appreciated.

TOPICS
Scripting
2.9K
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
Adobe
Adobe Employee ,
May 22, 2019 May 22, 2019

Discussion moved to Illustrator Scripting​

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
Contributor ,
May 22, 2019 May 22, 2019

Hi,

Here is the small script that can help you to make Artboard 1 as active artboard and call your action.

function main() {

var doc = app.activeDocument;

// Make Artboard 1 as active

for (i = 0; i < doc.artboards.length; i++) {

if (doc.artboards.name == 'Artboard 1') {

doc.artboards.setActiveArtboardIndex(i);

break;

}

}

// call your action - rename accordingly

  app.doScript('Rotate Dialog (selection)', 'Default Actions');

}

main()

In the above script

'Default Actions' - name of set where actions exists

'Rotate Dialog (selection)' - name of the action.

Please change these two things as per your requirement.

Hope this heps you.

Regads

Charu

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
New Here ,
May 23, 2019 May 23, 2019

Charu,

Thanks for the script!

However, do the number of different actions I apply I'm really trying to get the second part of the script to Play the currently selected action (like the button on the bottom of the actions panel). Do you know if that is possible?

Thanks,

Jake

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
Community Expert ,
May 23, 2019 May 23, 2019

no I don't think that's possible, I recorded an action to play currently selected action but it hard coded that specific action.

is there a significant gain automating playing the selected action? you would have to select the action manually anyway

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
New Here ,
May 23, 2019 May 23, 2019

Thanks for trying it!

It probably doesn't save that much time, but with the amount of times per day I end up running the actions I thought it would be helpful to be able to just click the action and press a shortcut key to select artboard 1 and run the action. But I suppose if I just set the keyboard shortcut to select artboard 1 then click the play action button it will still be faster than what I am doing now.

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
Community Expert ,
May 23, 2019 May 23, 2019

or, you could incorporate "select artboard 1" action into all of your actions, that way you would only have to use 1 key combo.

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
Explorer ,
Feb 10, 2022 Feb 10, 2022

Can i Select 2 Artboard to make theme active then play my action

 

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 ,
Feb 10, 2022 Feb 10, 2022
LATEST

You can select or draw a rectangle and find a way to make sure that rectangle is on top of the artboard you want. Then convert the rectangle into an artboard so now you have an active artboard in the same location as your desired active artboard. So in essence you have 2 artboards on top of each other. Maybe that could suffice, but you still would need to run some script to delete extra artboards at the end. 

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