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

CS3 Active Document changed Notification

Explorer ,
Sep 26, 2008 Sep 26, 2008

Copy link to clipboard

Copied

Hi all,

Does anyone know of any reliable way of detecting if the active document has changed? There are a number of notifications relating to document events:

* kAIDocumentChangedNotifier - Sent when the contents of a document have changed.
* kAIDocumentAboutToCloseNotifier - Sent right before the last document window of the artwork is about to be closed.
* kAIDocumentClosedNotifier - Sent when a document has been closed.
* kAIDocumentOpenedNotifier - Sent when a document has been opened.
* kAIDocumentNewNotifier - Sent when a new document has been created.

But none of these tell me when the active document has changed from one to another.

Illustrator CS4 provides a new notification: kAIDocumentViewActiveViewChangedNotifier
but alas this notification is not available in CS3 :(

Any ideas guys?

--W
TOPICS
SDK

Views

1.1K

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
Guide ,
Sep 29, 2008 Sep 29, 2008

Copy link to clipboard

Copied

You're incorrect about kAIDocumentChangedNotifier -- that indicates that the active document has changed 🙂 In fact, the message data is the handle of the document that now has focus if you cast it to AIDocumentHandle!

Hope that helps! If not, post again. I'm very familiar with Illustrator's notifiers, and in particular with documents notifiers.

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 ,
Sep 30, 2008 Sep 30, 2008

Copy link to clipboard

Copied

Well look at that, so it does!

To be honest, I have never really looked at the additional data sent with a notification due to the lack of documentation on what is sent with each notification. I don't suppose you know of somewhere I can obtain a list of the data types sent with the notifications since the Illustrator SDK docs are severely lacking in this area?

Thank you for that little gem of info, you've probably saved me a lot of hair pulling! :)

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 ,
Sep 30, 2008 Sep 30, 2008

Copy link to clipboard

Copied

LATEST
No, I'm afraid it was all trial & error on my part. It's funny, it didn't even occur to me that there wasn't any documentation on it. The docs used to be terrible but after years of pushing them on it (and I'm sure many others did too) they did a fabulous update of the headers to JavaDocs style, and things were much better. I guess having already figured out most of the notifier data I didn't bother to go back and check that. I'll have to make sure to note that next chance I get to give feedback.

Most of the time you can hazard a pretty safe guess. It's often null, which is obvious, but if it's not you just have to look at the header to which it belongs. If there's something complicated that it refers to, there'll be a struct of some kind (like with AISymbols.h). If not, it's got to be something fairly simple, like a handle, and that's usually straight forward enough since the headers are pretty narrow in focus generally.

At any rate, I'm glad I could help.

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