Hey everyone, I’ve got an extension I’m trying to modify… Right now the icons for this extension are SVG files, so they currently only work on PC installs. I’d like for them to work on the Mac, and for that I need PDF icons. I have both of those made already.
What I’m having trouble with is modifying my ruby script to detect Mac VS PC
Is there some way I can do an IF statement that tests for Mac, and if it’s not, it’ll do the PC icons? I’ve tried a few things, and I can’t get anything to work…
Since SketchUp 2014 you can test Sketchup.platform, see the Ruby API documentation. For older versions it was typical to test whether RUBY_PLATFORM =~ /darwin/ to detect Mac.
Be wary of copying code when it is not properly wrapped in the forum (as you did above.)
The forum replaces double quotes with smartquotes, which Ruby cannot understand.
Also in your code snippet you have both a local reference (cmd) and an instance reference (@cmd.)
Other than these, you’ll need to quote the error message.