When using variables as parameters when starting a program I needed to use a double \\ before the variable name if it was in a string in my previous software.
Like this: %WORKFOLDER%\qrcodes\\%FileName%.png
How do you do that in robotask?
(I'm having trouble finding examples of this)
Another example that works in my previous script:
convert.exe "%CurrentItem%" -quality "70" -resize "990x1490^" -gravity "North" -extent "1200x1800" "%WORKFOLDER%\overlay\\watermark.png" -compose over -composite "%WORKFOLDER%\merged\\%FileName%"
how does that translate to robotask?
Christian
variables as parameters in CLI
-
- Posts: 49
- Joined: Mon Jan 01, 2024 11:21 am
- Contact:
Re: variables as parameters in CLI
I'm sorry I don't understand you......how does that translate to robotask?...
Do you want to put double backslash (\\) before environment variable? Or remove extra slash?
What do you receive from "previous software" and what do you want to get as a result?...if it was in a string in my previous software...
Or do you want to expand environment variables in string?
Oleg Yershov
-
- Posts: 49
- Joined: Mon Jan 01, 2024 11:21 am
- Contact:
Re: variables as parameters in CLI
Apologies if my query was unclear.
When starting a program using robotask run console application it is possible to add parameters.
Do I have to take special measures when merging variables within the command line ?
Like in winautomation it would be:
%WORKFOLDER%\qrcodes\\%FileName%.png (one extra backslash to make sure the variable is recognized as a variable)
and I guess in robotask this would be:
{WORKFOLDER}\qrcodes{FileName}.png
Correct?
Do I need to take certain measures (quotes, special characters, backslash, {} ) so robotask does not misinterpret the command line?
Thanks,
Christian
When starting a program using robotask run console application it is possible to add parameters.
Do I have to take special measures when merging variables within the command line ?
Like in winautomation it would be:
%WORKFOLDER%\qrcodes\\%FileName%.png (one extra backslash to make sure the variable is recognized as a variable)
and I guess in robotask this would be:
{WORKFOLDER}\qrcodes{FileName}.png
Correct?
Do I need to take certain measures (quotes, special characters, backslash, {} ) so robotask does not misinterpret the command line?
Thanks,
Christian
Last edited by photoevents on Mon Jun 17, 2024 11:46 am, edited 1 time in total.
Re: variables as parameters in CLI
No.Do I have to take special measures when merging variables within the command line ?
System (Windows™) uses expressions like %WORKFOLDER% and %FileName% for environment variables in CMD or BATH files. Do you use environment variables?Like in winautomation it would be:
%WORKFOLDER%\qrcodes\\%FileName%.png ...
I think you missed one backslash.and I guess in robotask this would be:
{WORKFOLDER}\qrcodes{FileName}.png
No problem, use the expression as it is:
{WORKFOLDER}\qrcodes\{FileName}.png
without problem. If WORKFOLDER and FileName are internal user variables of RoboTask then the action engine expands then and put values instead of expressions {WORKFOLDER} and {FileName}
Oleg Yershov
-
- Posts: 49
- Joined: Mon Jan 01, 2024 11:21 am
- Contact:
Re: variables as parameters in CLI
use photoheight without braces
If you want to save something to variable you should specify variable name only. It's better to specify the name explicitly.
You can use other variables to form variable name, but I'm afraid that variable photoheight does not contain any value at this moment
If you want to save something to variable you should specify variable name only. It's better to specify the name explicitly.
You can use other variables to form variable name, but I'm afraid that variable photoheight does not contain any value at this moment
Oleg Yershov
-
- Posts: 49
- Joined: Mon Jan 01, 2024 11:21 am
- Contact:
Re: variables as parameters in CLI
Okay, got it working
The whole command line is:
identify -format "%h" "{current_image}"
to get the height of the image
more info on imagemagick identify for those interested:
https://imagemagick.org/Usage/basics/#identify
The whole command line is:
identify -format "%h" "{current_image}"
to get the height of the image
more info on imagemagick identify for those interested:
https://imagemagick.org/Usage/basics/#identify
Re: variables as parameters in CLI
By the way, take a look at the Open Image action.
When you open an image from a file or clipboard, it can determine the height and width of the image.
When you open an image from a file or clipboard, it can determine the height and width of the image.
Oleg Yershov