undefined docpath
Posted: 2015-09-21 09:21:46
I can‘t get to grips with a seemingly simple macro problem:
I want Nisus to check if a certain document myDoc is open, and if not, to open or to activate it. I wrote this:
The problem is: This works well, if myDoc is not open, or if it is not active. But if no document at all is open Nisus complains that the filepath property requires an object, but get‘s „undefined“ . But that is just why I want to open it: that it is not undefined anymore.
BTW My if-construction is meant to say: (If A) OR (if B) then do C. Is there another way to this?
I want Nisus to check if a certain document myDoc is open, and if not, to open or to activate it. I wrote this:
Code: Select all
$docPath = "~/Documents/myDoc"
$actDoc = Document.active
$actDocPath = $actDoc.filePath
if $actDoc == undefined
Document.open $docPath
elsif $actDocPath != $docPath
Document.open $docPath
end
BTW My if-construction is meant to say: (If A) OR (if B) then do C. Is there another way to this?