Hi Spready
You know how to get the field contents into a variable, just not how to insert those contents into the command in the right place?
Getting the contents is simple anyway
Combining that into the command string you want is also fairly easy, it gets tricky to visualise at times with the opening and closing of quotes when concatenating literal text with values and the spacing between.
Code: Select all
get shell("ffmpeg -f lavfi -i color=c=blue:" & tSize & " -t 5 -r 5 -pix_fmt yuv420p -tune stillimage test mp4")
The basic concatenation operator in LiveCode is &. There is a space between the tSize value and the -t switch thst follows. The double ampersand && operator could be used here to combine the string with a whitespace.
It can be easier to see by building up the final line in stages and add content "after" the current data
Code: Select all
put "ffmpeg -f lavfi -i color=c=blue:" into tCommand
put tSize & space after tCommand
put "-t 5 -r 5 -pix_fmt yuv420p -tune stillimage test mp4" after tCommand
get shell(tCommand)
It is also possible to use "merge" to combine text, which looks like maybe the way you were going, with the double square brackets. Thierry shows how above.
Getting the right concatenation is only a trivial part of the game though if you are having users insert their own values into the GUI. It will be much more work to ensure that the inserted values are valid (eg not text when a number is required) and within range (eg an integer between 1 and 10)