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

Is there a way to clear or delete actions through scripting?

Contributor ,
May 13, 2015 May 13, 2015

Hello Everyone!

Menu Commands Outline Stroke

I'm trying to make a script that will clear and then reload actions to try to get around that bug. Thanks to quertyfly and moluapple I now know how to make actions through script so all I need to know if there is a way to clear actions through script.

Thanks Everyone!

TOPICS
Scripting
8.7K
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

Guide , May 14, 2015 May 14, 2015

Woo Hoo....

feeling a bit stupid that I had not tried this.

But it works.

You don't even need to first unload each action

to remove a set...

app.unloadAction('Test Set','');

now to activate the file menu...

Translate
Adobe
Guide ,
Oct 19, 2015 Oct 19, 2015

hey silly, your posting using your email.

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 ,
Oct 19, 2015 Oct 19, 2015

Ha, I got a couple of CC accounts through my jobs, so I got tangled up!
Okay, here are some screenshots, and as you may be able to see, it's more than a trivial matter to encode the .app file:Screen Shot 2015-10-19 at 9.45.59 PM.pngScreen Shot 2015-10-19 at 9.46.16 PM.png

Screen Shot 2015-10-19 at 9.46.47 PM.png

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
Guide ,
Oct 19, 2015 Oct 19, 2015

Train of thought:

js creates a .txt file containing the string of sendkeys.

run the precompiled .app script

.app reads this text file and uses the contained string to sendkeys.

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 ,
Oct 19, 2015 Oct 19, 2015

Yea, that's a pretty good idea, can you gift yourself a Mac for xmas?

Although, there's got to be a way to make the .app simply execute my .scpt script without opening or running through script editor, but I just don't know enough about the commands for that.

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
Guide ,
Oct 19, 2015 Oct 19, 2015

I can't even warrant an upgrade for my PC...

That and I want a new lathe...

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 ,
Oct 19, 2015 Oct 19, 2015

Hmm, well if you got any print shops or promo companies nearby, surely you could hustle some funds!

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
Guide ,
Oct 19, 2015 Oct 19, 2015

Ha,

I am in a promo company with an in-house print shop.

but the salary pays my mortgage...

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 ,
Oct 24, 2015 Oct 24, 2015

Been a while since I've been on here, glad it could help. All the credit goes to qwertyfly I learned how to do that from qwertyfly's script earlier with the send keys to make the file menu pop up. Another thing I found useful is I make a keyboard shortcut for isolation mode and I use the send keys to isolate things as well during some scripts.

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
Guide ,
Oct 25, 2015 Oct 25, 2015
LATEST

Thanks for the credit, it's a bit hack but I find it very useful.

Shame it does not translate to mac so well.

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 ,
May 14, 2015 May 14, 2015

I believe Qwerty just solved this! I don't have a CC AI to test on right now, but I will check it out tomorrow!

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 ,
May 14, 2015 May 14, 2015

As for actions triggering scripts, hmm I think for synchronicity, there could be workarounds and while loops to run against an action-made condition (such as new layer with a name, or some kind of work path marker) where a script will know that once this condition is created, the action has played successfully.

However, unloading a set using this method really created some possibilities, which is very nice. Now we can distribute scripts with actions as strings inside them, for the ultimate power! Ha, I would have never thought to try what you did Qwertyfly...‌ great discovery.  This one will be moving us forward for sure.

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 14, 2015 May 14, 2015

HOLY CRAP!! Well done, well done.

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
Guide ,
May 14, 2015 May 14, 2015

still want to work out a way of having the start up script activate file menu.

so that we can remove an action set and then reload it so that scripts are registered

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 ,
May 14, 2015 May 14, 2015

Well I don't think you actually need to remove or reload an action set to show the scripts there, doesn't just showing the file > scripts menu after start make an action remember the script?

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
Guide ,
May 14, 2015 May 14, 2015

no, by the time you activate the file menu, the actions panel has already loaded the actions and decided it can't find the scripts...

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 ,
May 14, 2015 May 14, 2015

Oh I see, well, I guess one "shorter" way to do this would be to have your reloading script inside the script menu, and when you start up AI again, when you activate that reloading script from the file menu, it will at least save the clicks inside the Actions palette

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
Guide ,
May 14, 2015 May 14, 2015

I have an idea.

give me a bit to see if I can get it to work....

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 14, 2015 May 14, 2015

Silly-V wrote:

Oh I see, well, I guess one "shorter" way to do this would be to have your reloading script inside the script menu, and when you start up AI again, when you activate that reloading script from the file menu, it will at least save the clicks inside the Actions palette

That's what I thought the next best approach would be, but the other issue was the Set not being deleted, at least that was the case with CS5, I haven't tried wit CC yet

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 14, 2015 May 14, 2015

That would be the icing on the cake. One script to rule them all

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