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

How can I detect guide changes?

Contributor ,
Mar 20, 2017 Mar 20, 2017

Copy link to clipboard

Copied

Hi,

If I create a new guide I get a JSONEvent like this:

MAKE: {"guideTarget":{"_enum":"guideTarget","_value":"guideTargetCanvas"},"new":{"_obj":"good","kind":{"_enum":"kind","_value":"document"},"null":{"_ref":[{"_id":7764,"_ref":"document"},{"_index":5,"_ref":"good"}]},"orientation":{"_enum":"orientation","_value":"vertical"},"position":{"_unit":"pixelsUnit","_value":1195}},"null":{"_ref":"good"}}

But, no event coming when I drag or delete them.

Thanks in advance,

Oliver

TOPICS
Actions and scripting

Views

618

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
Enthusiast ,
Mar 20, 2017 Mar 20, 2017

Copy link to clipboard

Copied

You are right. It's hidden in toolModalStateChanged

{

    "toolModalStateChanged": {

        "level": 0,

        "state": "exit",

        "tool": {

            "ID": "arwT",

            "title": "Move Tool"

        },

        "kind": "mouse",

        "kcanDispatchWhileModal": true

    }

}

And CC 2014 shows nothing.

I also would like to know answer how to solve it.

Action recorder also can't record it. If you turn on "allow tool recording" it doesn't record guide change.

So you could check guides in some time period or after each "toolModalStateChanged" with Move Tool and With mouse. And this is not good because it include many other things. But there is more possibilities to remove guides. So you need include more events.

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
Contributor ,
Mar 20, 2017 Mar 20, 2017

Copy link to clipboard

Copied

Hi Jarda,

Thanks for Your answer. How do You catch this toolModalStateChanged event? Is this an event? I am getting lost as 1.5 years before when I started to deep dive into "this".

I am currently experimenting with generator/socket events, maybe I can get more information out of PS.

Photoshop Kevlar API Additions for Generator · adobe-photoshop/generator-core Wiki · GitHub

We can register for a few predefined events with "networkEventSubscribe". There is the "Miscellaneous" part at the end of this chapter which is pointing to this C header file : photoshopwindows/PITerminology.h at master · pritianka/photoshopwindows · GitHub

I burned 3 hours of desperate trying on this but can't register these 4 char events. It may be impossible to catch these kind of guide movements this way.

I am afraid the only solution will be to fetch and parse the guides with jsx every time something is changed in the document DOM.

Regards,

Oliver

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 ,
Mar 20, 2017 Mar 20, 2017

Copy link to clipboard

Copied

LATEST

Hmm generator plugin. Thanks for link. I will discover documentation in future.

You can read anything what is inside script listener .log and a little bit more.

E.g. this should trigger script anytime you will use layers alignment

app.notifiersEnabled = true;

app.notifiers.removeAll();

var eventFile = new File(app.path + "/Presets/Scripts/Event Scripts Only/Welcome.jsx");

app.notifiers.add( "Algn", eventFile, "Lyr ");

Be prepared for much more burning hours. 😄

I also did some event listener: ps-events-listener/README.md at master · jardicc/ps-events-listener · GitHub

(some bugs garanted)

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