Using PY output as a variable not working in CreateDir

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
garycee
Newbie
Posts: 17
Joined: Mon Jul 20, 2015 7:17 pm

Using PY output as a variable not working in CreateDir

Post by garycee » Tue Apr 09, 2019 3:46 am

For the life of me I dont get why this isn't working.

It outputs the result of my python code as a modal but I can't use it in a string in CreateDir.

Code: Select all

/*
python_code:

some working python code
*/

//THIS WORKS
PYExec>pcode,outputpy
MessageModal>outputpy

//THIS WORKS
let>outputpy=12345
Let>dir=C:\Users\user\Desktop\exampledir\%outputpy%
CreateDir>dir

//THIS DOESNT WORK
PYExec>pcode,outputpy
Let>dir=C:\Users\user\Desktop\exampledir\%outputpy%
CreateDir>dir

//NOR THIS
PYExec>pcode,outputpy
CreateDir>C:\Users\user\Desktop\exampledir\%outputpy%

I even tried something like...

Code: Select all

PYExec>pcode,outputpy
Let>outputpy2=outputpy

//WORKED
MessageModal>C:\Users\user\Desktop\exampledir\%outputpy2%

//DIDNT WORK
CreateDir>C:\Users\user\Desktop\exampledir\%outputpy2%

garycee
Newbie
Posts: 17
Joined: Mon Jul 20, 2015 7:17 pm

Re: Using PY output as a variable not working in CreateDir

Post by garycee » Tue Apr 09, 2019 4:29 am

OK I fixed it.

I was printing the IO to the output in PYexec, I think, rather than doing output and a variable contained in the code.
Not sure why that broke it as it partially worked but its cool now. :)

Post Reply