Reply to topic  [ 6 posts ] 
'Save Copy As…' in a macro 
Author Message

Joined: 2015-06-27 01:38:22
Posts: 10
After opening a document, I want to run the actions File:Save Copy As… However, the macro stops at 'File'. What am I missing?

Code:
$docActive = Document.active
If $docActive
   File
   Save Copy As…
Else
   Exit
End


2015-12-04 12:37:39
Profile
User avatar

Joined: 2007-02-07 00:58:12
Posts: 876
Location: Japan
pereelmagne wrote:
After opening a document, I want to run the actions File:Save Copy As… However, the macro stops at 'File'. What am I missing?


Well, if you want to run "File:Save Copy As…" you should write "File:Save Copy As…". If you break the command across two lines, you end up with a command "File", which doesn't make any sense to anyone.

_________________
philip


2015-12-04 16:31:53
Profile

Joined: 2015-06-27 01:38:22
Posts: 10
Thanks, but I had already tried the 'File:Save Copy As…' line, and the macro stopped there as well. Now I have just tried the "Save As…" command and it has worked. Here is the macro that works:
Code:
$docActive = Document.active
If ! $docActive
   New
Else $docActive
   File:Save As…
End

Conclusion: the "Save Copy As…" command is not working.


2015-12-07 00:49:25
Profile
User avatar

Joined: 2007-02-07 00:58:12
Posts: 876
Location: Japan
Actually "Save Copy As" and "File:Save Copy As" will work, if you leave out the ellipsis. (This is a general rule for Nisus Menu commands, by the way).

But I am sort of wondering what you are trying to do. Is this part of some larger macro? Usually if you want to do "Save Copy (As)" in a macro, you could use the macro language "Save To" command which, I think, would behave better. As far as I can tell, the macro won't actually stop when you do "Save Copy As" in a macro, whereas for "Save To" it will. Even better, if you already know what name you want to give the copy, you can add that as an argument, and then you won't have to bother with the dialog at all.

For more info on the macro language command(s) see the "Macro Language Reference" in the "Help" menu.

Also:
pereelmagne wrote:
Code:
$docActive = Document.active
If ! $docActive
   New
Else $docActive
   File:Save As…
End



What is the $docActive doing after the Else?

_________________
philip


2015-12-07 06:19:46
Profile

Joined: 2015-06-27 01:38:22
Posts: 10
Yes, you're right. The Save To command works perfectly well.

Thank you very much.


2015-12-22 12:56:05
Profile

Joined: 2008-05-17 04:02:32
Posts: 400
pereelmagne wrote:
After opening a document, I want to run the actions File:Save Copy As… However, the macro stops at 'File'. What am I missing?

This one works for me.
Code:
$docActive = Document.active
If $docActive
   Save Copy As... # Here '...' is not an ellipse but three fullstops.
Else
   Exit
End

As far as I have observed, this kind of deviation is rather common. You can never know “...” following :ApplicationName:Preferences— for example, TextEdit’s Preferences… command— is an ellipse or three fullstops.

That said, I think it would be more convenient if the macro language of a future version of NWP will treat three fullstops as equivalent of a single ellipse as far as menu command name is concerned.

As Philip said, Save Copy As does work but the current behaviour might be confusing for some users, I think.


2017-04-04 12:37:53
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software