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

Is it possible to run program functions with javascript?

Enthusiast ,
Oct 28, 2014 Oct 28, 2014

Copy link to clipboard

Copied

In a nutshell, I want to run clean up, but recording it to an action still makes me confirm it. This is a pain on batch items. I'm looking/creating a script that does the same thing as cleanup, but figured I'd ask if one can utilize program functionality with any sort of scripting.

TOPICS
Scripting

Views

641

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

Community Expert , Oct 28, 2014 Oct 28, 2014

sort of, you can run some menu commands, unfortunately in your case, it'll be exactly the same as in the user interface, it will still bring up the dialog.

app.executeMenuCommand ('cleanup menu item')

check here for more command strings

Re: [JS] CS6+ executeMenuCommand

Votes

Translate

Translate
Adobe
Community Expert ,
Oct 28, 2014 Oct 28, 2014

Copy link to clipboard

Copied

sort of, you can run some menu commands, unfortunately in your case, it'll be exactly the same as in the user interface, it will still bring up the dialog.

app.executeMenuCommand ('cleanup menu item')

check here for more command strings

Re: [JS] CS6+ executeMenuCommand

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 ,
Oct 29, 2014 Oct 29, 2014

Copy link to clipboard

Copied

Thanks for this! Thanks for being such a sagely member of the forums! This info doesn't seem to be in the reference guides, is it anywhere else aside from that forum post? I saw it in the object model viewer but it doesn't list much else after that.

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 ,
Oct 29, 2014 Oct 29, 2014

Copy link to clipboard

Copied

This is brilliant Carlos! The fact that I can add logic to things will speed up my process immensely. With actions, I had to add guides in order to make sure the script didn't get an error, which in llly actions is a good 3 or 4 steps. 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
Enthusiast ,
Oct 29, 2014 Oct 29, 2014

Copy link to clipboard

Copied

This has already proved useful, I'll still have to do some loops, but at least an easy method to clean up stray points.

app.executeMenuCommand('Stray Points menu item')

app.executeMenuCommand('clear')

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 Expert ,
Oct 29, 2014 Oct 29, 2014

Copy link to clipboard

Copied

you're welcome, I agree, it is one of the most useful additions to the DOM, it'll be even better if it was documented and if we had all the string commands...at least we have something to play with.

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
Guide ,
Oct 29, 2014 Oct 29, 2014

Copy link to clipboard

Copied

This is another one that could use AHK.

var exe = new File("C:/1enter1enter.exe");

exe.execute();

app.executeMenuCommand ('cleanup menu item');

AHK script:

Sleep, 1000

Send {Enter}

Sleep, 1000

Send {Enter}

the compiled AHK file can be downloaded from:

qwertyfly.com/files/1enter1enter.zip

this is my domain, you may get download blocked due to .exe file in zip.

I suggest installing AHK anyway as it will do a lot for you if you like to script to save you time.

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 ,
Oct 31, 2014 Oct 31, 2014

Copy link to clipboard

Copied

That's awesome! Although, I need it to be mostly compatible on a mac.

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
Guide ,
Nov 02, 2014 Nov 02, 2014

Copy link to clipboard

Copied

I've never spent any time on a mac so would not know where to start.

there are AHK style alternatives, such as AutoKey, but I don't think its still being developed.

maybe some external device such as a Tablet may have programmable keys, but not sure how much flexibility they would offer

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
Guide ,
Nov 02, 2014 Nov 02, 2014

Copy link to clipboard

Copied

LATEST

I also do not do Applescript.

But I think that can simulate keystrokes.

Correct me if I have this wrong...

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