I know this is an old thread, but I get an invalid byte sequence in utf-8 (argumenterror) in Sketchup 2018.
It seems backquotes still evaluate to nil in SU2018.
What is awkward:
create file test.rb in SU2018 plugins folder containing:
require 'sketchup'
UI.messagebox(`echo hello`)
Launch SketchUp and an empty messagebox will be shown on my windows machine. However, if I Iaunch Sketchup from cmd, the messagebox will show the output.
Thus, double clicking a shortcut pointing to “C:\Program Files\SketchUp\SketchUp 2018\SketchUp.exe” behaves different than executing “C:\Program Files\SketchUp\SketchUp 2018\SketchUp.exe” in cmd…
The API’s UI::messagebox code has always been known to fail silently. Often the messagebox does not even show (as an empty window.)
We’ve always tried to steer coders away from using a messagebox for testing, and toward outputting to either console (if it’s not broken,) or a log file, etc. (On Windows you can use OutputDebugString and sends strings to MS DebugView.)
Yes, but in this case it is not the message box failing, which is used in this case as a way to provide fast feedback, it’s the backticks that fail. When launching sketchup from command line there seems to be no problem at all executing system commands and retrieving their output. When launching as a normal user would, executing system commands return nil.
Understood. We’ve had these problems before, but for some reason checking %x (backquote) execute strings and the console, (and sometimes unicode paths) seems to get broken every few versions.
@thomthom, checking these need to get added as a procedural item for each cycle.
But this is not even version related. If I boot Sketchup using Command Line, it al works fine. If I launch that very same version of Sketchup double clicking a shortcut it doesn’t work.
If you can show that this happens in EVERY version, then it isn’t version related. But I am saying we’ve had strange bugs happen in some past versions, based upon how SketchUp was started (ie, double-clicking an SKP file, or starting from a shortcut, and running as a normal user, or running SketchUp as an administrator. Etc.)
Hey Ken, feel free to open a specific issue in the GitHub tracker on what you feel is wrong or different than any other issue already logged. (“Squeaky wheel gets the grease”.)