• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Determine User Operating System

Scheduled Pinned Locked Moved Developers' Forum
4 Posts 4 Posters 145 Views 4 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    kybasche
    last edited by 2 Jun 2012, 07:41

    Hey folks,

    I've searched around, and I'm sure I missed an easy answer - but how can you determine the operating system of a computer within a ruby script? I really just want to know if whoever is using my plugin is on a Mac or PC - is this possible?

    Thanks much, as always!

    Derek

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 2 Jun 2012, 07:49

      RUBY_PLATFORM

      i386-mswin32
      For a Windows system...
      See here http://forums.sketchucation.com/viewtopic.php?p=305368#p305368

      TIG

      1 Reply Last reply Reply Quote 0
      • M Offline
        Michaelv
        last edited by 2 Jun 2012, 17:41

        I looked at that for a while as the ideal is to make scripts that work on both.

        However as of now I think there are enough differences, and quirks that at some point another choice has to be made:

        • Either one doesn't use any problematic known differences and the scripts can be "universal". Very possible with simple scripts with a bit of precautions.
        • Or just write a script and there will be a PC and a Mac version, at this point my preferred solution. It's not that big of a deal. If you use a lot of keyboard inputs, boxes, etc.., It's just easier IMO than writing the tests and all the exceptions.

        I'm not sure there is an explicit list somewhere of differences but to the best of my knowledge:

        • Keyboard input control AND HABITS
        • Input box labels (see my other post)
        • toolbar management
        • file management on Mac cannot have , it must be / (which I think works on both platforms)
        • web dialogs not sure if it's all fine
        • Some PC plugins guys do stuff with window 32 something (like external control or programming or something), etc..of course no such thing on Mac (Used for ruby console management for example, and some other plugins I've seen it in)
        • I'd be very careful about open GL stuff (not encountered yet, so not sure)
        • Cursor management also seems to be different (I think I've seen plugins where PC people use cursor and don't report problems, yet on Mac there is just no cursor (it still works, and one wouldn't know until you dig into the rb and see that Oh there was a cursor management for this plugin)
        • color and texture selection window.

        I may have forgotten a couple. But these are the one I look for systematically in making sure plugins work as intended on Macs (and change accordingly).
        And that list is not one direction. Sometimes the Mac is better or friendlier (toolbars), sometimes the other way as far as I can tell.

        1 Reply Last reply Reply Quote 0
        • D Offline
          Dan Rathbun
          last edited by 2 Jun 2012, 23:27

          I have collected some links to Platform differences in the [ Code Snippets ] index.

          I'm not here much anymore.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          1 / 1
          • First post
            3/4
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement