nisus.com
https://www.nisus.com/forum/

active doc question
https://www.nisus.com/forum/viewtopic.php?f=17&t=5725
Page 1 of 1

Author:  js [ 2014-05-03 06:53:40 ]
Post subject:  active doc question

I have an open document called "MYDOC". I would like to test whether it is active and if not make it active. I wrote

Code:
$doc = Document.active
if $doc = "MYDOC"
   prompt "$doc is active"
else
   Document.setActive $doc
end


What's wrong with this? The macro doesn't complain. But whether MYDOC is actually active or not, I always get the answer that it is.

Author:  phspaelti [ 2014-05-03 15:36:39 ]
Post subject:  Re: active doc question

Two problems:
  1. "=" is an assignment, "==" is a comparison
  2. $doc is an object
Try
Code:
if $doc.name == "MYDOC"

Author:  js [ 2014-05-04 06:23:28 ]
Post subject:  Re: active doc question

Glad to have you helping. Thank You.

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/