Macros and XBS files
Posted: Mon Feb 18, 2013 3:47 pm
Hello,
I am trying to do something simple, but I can't make it work.
I did search a lot on the net, but did not find an adequate answer.
In View mode, I would like to click a button that would resize the displayed image to a specific height (960 pixels for example).
I want to add the command to : Options, Interface, Toolbars, Buttons, View, "Command:"
I was thinking that something like "cmd_Resize [Height=960]", or something close would work,
but it doesn't. I tried the following at the command prompt:
1 - cmd_Resize -> shows me the resize dialog box (I don't need a new button for that)
2 - resize( 1 lanczos 0 960 0 1 0 ) : does not work this way (syntax of an XBS file)
3 - cmd_Resize [ 1 lanczos 0 960 0 1 0 ] : does not care about the arguments, shows me the resize dialog box
Another option would be to write an XBS file, which I can do, and have it run by simply
clicking on my new button. However, if I add my file.XBS to the command prompt, the
XBS file is opened in a text editor, but not executed.
Having a button that would load the XBS file, then execute it would work for me.
I know that an XBS file can be loaded manually, but it takes more clicks than using the
existing resize dialog box.
Basically, I just want to resize the height to 960 (keep ratio) with one click of a button.
Thanks
I am trying to do something simple, but I can't make it work.
I did search a lot on the net, but did not find an adequate answer.
In View mode, I would like to click a button that would resize the displayed image to a specific height (960 pixels for example).
I want to add the command to : Options, Interface, Toolbars, Buttons, View, "Command:"
I was thinking that something like "cmd_Resize [Height=960]", or something close would work,
but it doesn't. I tried the following at the command prompt:
1 - cmd_Resize -> shows me the resize dialog box (I don't need a new button for that)
2 - resize( 1 lanczos 0 960 0 1 0 ) : does not work this way (syntax of an XBS file)
3 - cmd_Resize [ 1 lanczos 0 960 0 1 0 ] : does not care about the arguments, shows me the resize dialog box
Another option would be to write an XBS file, which I can do, and have it run by simply
clicking on my new button. However, if I add my file.XBS to the command prompt, the
XBS file is opened in a text editor, but not executed.
Having a button that would load the XBS file, then execute it would work for me.
I know that an XBS file can be loaded manually, but it takes more clicks than using the
existing resize dialog box.
Basically, I just want to resize the height to 960 (keep ratio) with one click of a button.
Thanks