There is some strange behavior happening to me when I launch a subprocess in my Ruby plugin. The purpose is reading a line from the output and getting a substring of that line, the name of the project in this case. I use
IO.popen and the code is the following:
my_cmd = 'my_program.exe parameter1 parameter2' project_name = 'ERROR' IO.popen my_cmd do |io| io.each do |line| puts line if line.include?('Project created! The name of the project is: ') project_name = line.split('Project created! The name of the project is:') end end end UI.messagebox(project_name)
When I launch Sketchup from Rubymine, the code works, and it is entering the IF statement.
However, if I open directly SketchUp, as a standard user, the code is not entering the IF statement.