Skip to main content
Inspiring
October 20, 2009
Question

[CS4][AS] How to specify particular document?

  • October 20, 2009
  • 3 replies
  • 503 views

Hi all

I would like to choose (by name) a particular document from among a number of open documents

The following gives me the error "Can’t get document whose name contains "Cvrs"" : 

set active document to document whose name contains "Cvrs"

But this works:

set active document to every document whose name contains "Cvrs"

Could someone please explain why?

Thanks

d.

This topic has been closed for replies.

3 replies

Inspiring
October 22, 2009

Thanks for your help guys,

These little syntax anomalies are going to do my head in, I'm sure.

Kasyan Servetsky
Legend
October 21, 2009

In your last example you reference to the elements of application — that is all documents. You could also use this:

set active document to documents whose name contains "Cvrs"

But if you have more than one such a document, you'll get en error.


Kasyan

Inspiring
October 21, 2009

I guess the short answer would be "That's the syntax".  You could get a long list of documents whose name contain "Cvrs". Which one should be the one that gets active? I am not sure if "every" would work had you more than one document satisfying the whose clause. You could also use Set active document to first document whose name contains "Cvrs" (if that does make more sense for you.)

Ralf