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

Can I make a button to run a script?

Community Beginner ,
Aug 31, 2018 Aug 31, 2018

Copy link to clipboard

Copied

I have a script that I will be using frequently, but going to File > Scripts every time may become pretty tiring - even though it's very useful.

Is it possible to build a panel or create a button that will activate a script? I have some coding knowledge and am willing to try making it myself if someone can point me in the right direction...

TOPICS
Scripting

Views

8.3K

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

Valorous Hero , Sep 04, 2018 Sep 04, 2018

It's possible to create a pure extendscript panel using the floating panel JET mentions, but in order to do this you will have to know the Adobe extendscript javascript, the ScriptUI methods for creating the visual interface such as the dialogs/palettes and then because we're using Illustrator, you will need to use the BridgeTalk object to send the communication between a floating panel and the actual Illustrator application.

Luckily, I've made one some time ago: Adobe-Illustrator/ScriptPanel_2.jsx at master · Silly-V/Adobe-Illustrator · GitHub

...

Votes

Translate

Translate
Adobe
Community Expert ,
Aug 31, 2018 Aug 31, 2018

Copy link to clipboard

Copied

Hi. The closest answer to this would be to create actions. As of Illustrator CC2018, actions can include calls to a script. When you save an action that includes a script, the connection to the script remains with the action.

To create actions in Illustrator, please visit: Use actions to automate tasks in Illustrator


Adobe Community Expert / Adobe Certified Instructor

Votes

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
LEGEND ,
Sep 01, 2018 Sep 01, 2018

Copy link to clipboard

Copied

You can create dialogs (which can contain buttons, fields, and other controls), both as modal alerts and as non-modal palettes in ExtendScript. That doesn't perform the initial launch of the dialog, but as mentioned, an Action can do that.

So you can, for example, create an Action to serve as the button to avoid the arduous task of File>Scripts>MyElaborateScriptedSolution to simply open your scripted palette.

But that palette in turn can contain buttons, fields, and other controls to serve as a floating user interface for the options and interaction you want to provide while using the script.

It's not for scripting beginners. You'll need to search out the current documentation for it. As I recall, the buzzword for it was "ScriptUI" or some such.

JET

Votes

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 Employee ,
Sep 04, 2018 Sep 04, 2018

Copy link to clipboard

Copied

Moved to Illustrator Scripting

Votes

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
Valorous Hero ,
Sep 04, 2018 Sep 04, 2018

Copy link to clipboard

Copied

It's possible to create a pure extendscript panel using the floating panel JET mentions, but in order to do this you will have to know the Adobe extendscript javascript, the ScriptUI methods for creating the visual interface such as the dialogs/palettes and then because we're using Illustrator, you will need to use the BridgeTalk object to send the communication between a floating panel and the actual Illustrator application.

Luckily, I've made one some time ago: Adobe-Illustrator/ScriptPanel_2.jsx at master · Silly-V/Adobe-Illustrator · GitHub

The idea is to have a reference to this script inside your startup scripts, so it launches when you start up Illustrator and produces the buttons for your various scripts. The panel works by living somewhere on your network, or desktop, and when the script panel is placed in the same folder and is launched, it will turn all surrounding scripts into buttons and folders with scripts into category sections. Put a nested script panel in there to get a different set of tools to pop out.

Votes

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
Community Beginner ,
Sep 04, 2018 Sep 04, 2018

Copy link to clipboard

Copied

This script is brilliant. This is exactly what I needed. Thank you!

Votes

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
Valorous Hero ,
Sep 04, 2018 Sep 04, 2018

Copy link to clipboard

Copied

Yea, have fun with it, keep in touch on here to let me know how it goes or if there's any problems you encounter along the way. I always push companies without an existing IT automation delivery mechanism to implement this panel because it means less headache for everyone involved when there's not duplicate or mis-versioned code sitting in individual people's desktop machines.

Votes

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
Participant ,
Sep 06, 2018 Sep 06, 2018

Copy link to clipboard

Copied

Votes

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
Explorer ,
Nov 20, 2019 Nov 20, 2019

Copy link to clipboard

Copied

Hi Alexander, your extension is very very fantastic but unfortunately I can't install the latest version LAScripts_v1.1.0.zxp
It gives me this error "The extension has invalid signature or damaged. Please try to re-download it"
I tried to download with firefox, Chrome, Safari ... always same mistake when I install with Anastasiy's Extension Manager.
furthermore the previous version LAScripts_1.0.9.zxp only works the first time and then stops working ...
Thanks so much!

 

Votes

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
Advocate ,
Jan 13, 2020 Jan 13, 2020

Copy link to clipboard

Copied

I had the same issue, but you can actually install it manually aswell.

  1. Change ZXP extension to zip and than unzip the folder
  2. Find the CEP folder on your OS, if you dont have "extensions" folder, simply make one
    Path

 

Mac: ~/Library/Application Support/Adobe/CEP/extensions/ Win 32bit: C:\Program Files\Common Files\Adobe\CEP\extensions\ Win 64bit: C:\Program Files (x86)\Common Files\Adobe\CEP\extensions\​

 

For me this worked and the panel showed 

Votes

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
Participant ,
Jan 14, 2020 Jan 14, 2020

Copy link to clipboard

Copied

Hello Schroef and thank you! I had already tried the manual installation several times. I had done as you described, but it only works with Illustrator 22.1, not with 23.1.1 and 24.0.2, on macOS 10.13.6 High Sierra.
Which version do you use? Thanks again!
Max

Votes

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
Advocate ,
Jan 14, 2020 Jan 14, 2020

Copy link to clipboard

Copied

@Gamm System,

im an oldy here. Im still on 10.11.6 🙂 

 

I think its perhaps related to the usage of the CEP engine. I just had a look at Adobe github, if im right illustrator 2019 and up uses CEP9 and i believe this extension is still on older CEP. This must be the issue, according to this table. I see that illustrator 2019 support CEP 8 and 9. Illustrator 2018 support CEP 7 and 8.

On this page you also can read that the CSinterface check what version of CEP is used
https://github.com/Adobe-CEP/CEP-Resources/blob/master/CEP_9.x/Documentation/CEP%209.0%20HTML%20Exte...
This extension is using CEP 7. Thats why its still working in 2018 i guess. The dev needs to update i think. Not sure he responds or see my messages on his gitHub. I already asked him to take a look at dot-files. Im running script from an USB drive and see all scripts double due to these dot-files USB drives have on OSX

PS did you also do these commands

In the terminal, enter the command: defaults write com.adobe.CSXS.6 PlayerDebugMode 1
In the terminal, enter the command: defaults write com.adobe.CSXS.7 PlayerDebugMode 1
In the terminal, enter the command: defaults write com.adobe.CSXS.8 PlayerDebugMode 1

I did run these way long back, i found a readme file in the folder "messages" inside "LAscripts" folder

Votes

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
Participant ,
Jan 15, 2020 Jan 15, 2020

Copy link to clipboard

Copied

Exactly! I forgot this step !!! Alexander Ladygin had written it to me long ago ... writing the commands in the terminal everything works.

 

In the terminal, enter the command: defaults write com.adobe.CSXS.6 PlayerDebugMode 1
In the terminal, enter the command: defaults write com.adobe.CSXS.7 PlayerDebugMode 1
In the terminal, enter the command: defaults write com.adobe.CSXS.8 PlayerDebugMode 1
In the terminal, enter the command: defaults write com.adobe.CSXS.9 PlayerDebugMode 1 (maybe this one is superfluous but I wrote it anyway)

Thanks to everyone, I'm not a developer ... just a simple user. Thank you!!!

Votes

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
Advocate ,
Jan 14, 2020 Jan 14, 2020

Copy link to clipboard

Copied

PS if your bold enough and want to try. Perhaps you can dowload the CEP files for engine 9 from their github and replace them. Perhaps it will work if you use the new version for these files.

  1. CEPEngine.js
  2. CSInterface.js

One other thing you could try is use this command in the Terminal

In the terminal, enter the command: defaults write com.adobe.CSXS.9 PlayerDebugMode 1
I did noticed when using CEP you also need to active that code in the Terminal

Votes

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
Advocate ,
Jan 14, 2020 Jan 14, 2020

Copy link to clipboard

Copied

I think this extension needs major upgrading to higher illustrator versions. I just read some parts on the CEP9 cookbook. Ive never really made any panel, but now a bit about scripting.

I hope the dev will pick this up. BUt im not sure, his release was from 2017 and he/she didnt update it for illustrator 2019. I cant really help testing this thing cause im still on 2018 here
https://github.com/Adobe-CEP/CEP-Resources/blob/master/CEP_9.x/Documentation/CEP%209.0%20HTML%20Exte...

Votes

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
Enthusiast ,
Jan 14, 2020 Jan 14, 2020

Copy link to clipboard

Copied

Hi, this is not the case. CEP is backwards compatible so having new versions will have no effect, in the extension's manifest.xml it runs 5.0 (which is supported by all apps 2015+) and in the host app param it covers all future versions of Illustrator, specifically 18.0 and up:

 

<Host Name="ILST" Version="[18.0,99.9]"/>

 

It does run when in Dev context, even in Illustrator 24.0+. Download the ZXP, change it's file extension to ".zip", and extract it inside "..\AppData\Roaming\Adobe\CEP\extensions" (though you have to follow the "debugging unsigned extensions" terminal command or registry change outlined in the CEP Cookbook then relaunch AI for it to work):

 

ice_screenshot_20200114-175537.png

 

@Alexander_Ladygin I didn't see this on your Github so I'm not sure if it's open source. The error on install is "Installation failed because the extension does not contain a valid code signature." I think this might be a faulty ./META-INF/signatures.xml file, oddly when I try to generate a new self-signed cert myself and create a new ZXP I get the same error via ZXPSignCmd.

Votes

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
Participant ,
Jan 15, 2020 Jan 15, 2020

Copy link to clipboard

Copied

Hello Inventsable and thanks! everything works with the manual installation, I just forgot to type the commands in the terminal:
In the terminal, enter the command: defaults write com.adobe.CSXS.6 PlayerDebugMode 1
In the terminal, enter the command: defaults write com.adobe.CSXS.7 PlayerDebugMode 1
In the terminal, enter the command: defaults write com.adobe.CSXS.8 PlayerDebugMode 1
In the terminal, enter the command: defaults write com.adobe.CSXS.9 PlayerDebugMode 1 (maybe this one is superfluous but I wrote it anyway)


Everything works perfectly, thanks again!

Votes

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
Advocate ,
Jan 17, 2020 Jan 17, 2020

Copy link to clipboard

Copied

Ah thanks for clearing. Do you know why on Adobe GitHub each version shows 2 cep version numbers? So for example cep 8 also shows cep7 in the table?

 

I thought had something Todo with usability. Each version probably uses new commands. But I don't understand why cep8 shows also cep7 than?

Votes

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
Enthusiast ,
Jan 14, 2020 Jan 14, 2020

Copy link to clipboard

Copied

A lot of good answers and extensions here but I feel the thread is missing some crucial information. Evaluation of a script is as easy as:

 

$.evalFile(pathToFile)

 

So long as you can create a button, whether through HTML panel or ScriptUI, and trigger the above you can run any script from any button.

Votes

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
Valorous Hero ,
May 08, 2022 May 08, 2022

Copy link to clipboard

Copied

LATEST

This does work, but not for cross-app methods. If you eval a file which has #target photoshop at the top, in Illustrator, the file will still run in Illustrator and not photoshop.

Votes

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