sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Plugin] Shortcutter Beta

    Scheduled Pinned Locked Moved Plugins
    98 Posts 14 Posters 43.4k Views 14 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.
    • TIGT Offline
      TIG Moderator
      last edited by

      I hadn't tested it on MAC - just PCs...

      Of course the encoding should be UTF-8 😕
      I suspect that the Gábor v Gabor should not cause an issue as it's behind a # so is never read ?
      BUT the file is ANSI encoded incorrectly - a sure thing to break Ruby2 - but it does not ! 😮
      Somewhere it's encoding changed - the version I sent Gábor via Skype was encoded correctly, subsequent editing by him seems to have changed its encoding for the worse 😕

      BUT now I have a very strange issue with my MAC. 😒
      In v2013 and v2014 in the Ruby Console:

      Sketchup.get_shortcuts returns [] !

      Even though there are many shortcuts listed in the menus and Shortcuts.plist ?

      So then the listing in the dialog is unpopulated as the list is "" !

      I can't see why SketchUp has stopped making these lists 😕 😕 😕

      TIG

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        I have now found that on MAC using a shortcut somehow wakes up the plist and then Sketchup.get_shortcuts returns the array as expected.
        BUT it still fails to populate the shortcutter dialog.
        I suspect that the MAC string that is passed to the JS side contains characters that break it - perhaps we need to encode it Ruby side then decode it JS side ?
        It contains special-characters for Option, Cmd etc - while on PC they would be Alt, Ctrl etc...
        I recast a UTF8-without-BOM encoded version of the .rb so it outputs what it's sending to the JS...

        On MAC with SketchUp just opened [v2014].
        Sketchup.get_shortcuts returns []
        When the the shortcutter runs it sends "" to the JS.
        Which is rubbish !
        BUT when I use just one shortcut !
        It works thereafter... 😕
        Now:
        Sketchup.get_shortcuts
        returns:
        ["A\tselectArcTool:", "B\tselectPaintTool:", "C\tselectCircleTool:", "E\tselectEraseTool:", "F\tselectOffsetTool:", "G\tmakeComponent:", "H\tselectDollyTool:", "K\ttoggleDisplayBackEdges:", "L\tselectLineTool:", "M\tselectMoveTool:", "O\tselectOrbitTool:", "P\tselectPushPullTool:", "Q\tselectRotateTool:", "R\tselectRectangleTool:", "S\tselectScaleTool:", "Space\tselectSelectionTool:", "T\tselectMeasureTool:", "Z\tselectZoomTool:", "|\tviewPerspective:", "⇧Z\tviewZoomExtents:", "⌥S\t/Plugins/SketchUcation/My Shortcuts..."]
        and when the the shortcutter runs the passed string is:
        "A\tselectArcTool:\\nB\tselectPaintTool:\\nC\tselectCircleTool:\\nE\tselectEraseTool:\\nF\tselectOffsetTool:\\nG\tmakeComponent:\\nH\tselectDollyTool:\\nK\ttoggleDisplayBackEdges:\\nL\tselectLineTool:\\nM\tselectMoveTool:\\nO\tselectOrbitTool:\\nP\tselectPushPullTool:\\nQ\tselectRotateTool:\\nR\tselectRectangleTool:\\nS\tselectScaleTool:\\nSpace\tselectSelectionTool:\\nT\tselectMeasureTool:\\nZ\tselectZoomTool:\\n|\tviewPerspective:\\n⇧Z\tviewZoomExtents:\\n⌥S\t/Plugins/SketchUcation/My Shortcuts..."
        BUT it still does NOT populate the dialog - so something is breaking the JS execute_script side...
        I suspect these special MAC symbols 😒

        TIG

        1 Reply Last reply Reply Quote 0
        • Dave RD Offline
          Dave R
          last edited by

          FWIW, this is what I get on my Mac after clearing the Safari caches. I do have shortcuts established.

          2014-04-13_09-06-10.png

          Etaoin Shrdlu

          %

          (THERE'S NO PLACE LIKE)

          G28 X0.0 Y0.0 Z0.0

          M30

          %

          1 Reply Last reply Reply Quote 0
          • TIGT Offline
            TIG Moderator
            last edited by

            Yep, in MAC is it's foobar... 😒
            I suspect it's the special-characters that MACs use for the modifier keys...
            Those will break the server's JS...
            Gábor and I need to look at it tomorrow...

            TIG

            1 Reply Last reply Reply Quote 0
            • D Offline
              driven
              last edited by

              I did try

              			myscuts = (Sketchup.get_shortcuts.to_s.gsub(/⌃/,'Ctrl').gsub(/⌥/,'Alt').gsub(/⇧/,'Shift').split(',').sort.join("\\n"))
              
              

              which almost works on the ruby side if I encode the page UTF-8,

                "AltT\tdoThreeDText;"\n "B\tselectPaintTool;"\n "C\tselectCircleTool;"\n "CtrlAltShiftT\tviewTop;"\n["Space\tselectSelectionTool;"
              

              the last entry for Space is screwed up, and then I get a load error on the html...

              learn from the mistakes of others, you may not live long enough to make them all yourself...

              1 Reply Last reply Reply Quote 0
              • TIGT Offline
                TIG Moderator
                last edited by

                Yes, the script must be encoded as UTF-8-without-BOM to be fully compatible with all versions of SketchUp - I was surprised it hadn't broken v2.14 Ruby2... 😒

                Try this

                myscuts = Sketchup.get_shortcuts.sort.join("\\n").gsub(/#{'⌃'}/, 'Ctrl').gsub(/#{'⌥'}/, 'Alt').gsub(/#{'⇧'}/, 'Shift')
                

                Should perhaps work for MACs ?
                It is something like I am going to test with Gábor tomorrow...

                BUT... do you have any idea why on my MAC Sketchup.get_shortcuts returns [] - so that myscuts == "" - unless I have used one shortcut before that, then it works ?

                TIG

                1 Reply Last reply Reply Quote 0
                • G Offline
                  Gábor
                  last edited by

                  The main problem is that in case of Mac we do not have the menu name at the beginning of each action, so the Javascript and maybe also the HTML has to be prepared first to handle this situation. The javascript populates the paragraphs based on the menuname what is missing in case of MAC. More tomorrow.

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    driven
                    last edited by

                    @tig said:

                    BUT... do you have any idea why on my MAC Sketchup.get_shortcuts returns [] - so that myscuts == "" - unless I have used one shortcut before that, then it works ?

                    on my mac it works from the off...

                    ...and, I do have a 'hunch',

                    I may depend on some of your startup 'Preferences'...

                    I think SU is using these send_actions internally for those as well and 'that' triggers the plist read...

                    try enabling 'Auto activate paint tool' and see if they appear...

                    I can't get it to revert to 'not' showing...

                    learn from the mistakes of others, you may not live long enough to make them all yourself...

                    1 Reply Last reply Reply Quote 0
                    • TIGT Offline
                      TIG Moderator
                      last edited by

                      @gábor said:

                      The main problem is that in case of Mac we do not have the menu name at the beginning of each action, so the Javascript and maybe also the HTML has to be prepared first to handle this situation. The javascript populates the paragraphs based on the menuname what is missing in case of MAC. More tomorrow.
                      We'll Skype on Monday morning [UK time] 😒

                      TIG

                      1 Reply Last reply Reply Quote 0
                      • G Offline
                        Gábor
                        last edited by

                        Version 0.2.0 is out now in the pluginstore. It addresses the MAC issue. MAC users, please test.

                        1 Reply Last reply Reply Quote 0
                        • D Offline
                          driven
                          last edited by

                          getting there...no picture'gram' for ⌃ which is labeled as Opt, but is Control

                          learn from the mistakes of others, you may not live long enough to make them all yourself...

                          1 Reply Last reply Reply Quote 0
                          • G Offline
                            Gábor
                            last edited by

                            @driven said:

                            getting there...

                            Thanks for the tests and advices. Now my only concern is: How does that ^Opt got there and what does it mean? Any clue?

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              driven
                              last edited by

                              ruby returns this "⌃⌥⇧T\tviewTop:"
                              on a mac
                              ⌘ . . . . . ⌘ . . . Command, Cmd, Clover, (formerly) Apple
                              ⌃ . . . . . ⌃ . . . Control, Ctl, Ctrl
                              ⌥ . . . . . ⌥ . . . Option, Opt, (Windows) Alt
                              ⇧ . . . . . ⇧ . . . Shift

                              learn from the mistakes of others, you may not live long enough to make them all yourself...

                              1 Reply Last reply Reply Quote 0
                              • TIGT Offline
                                TIG Moderator
                                last edited by

                                Doh!
                                My fault... 😒
                                Muddled up the modifier key coding...

                                Preparing v0.3.0 which will fix the missing Ctrl !

                                Gábor - you'll need to redo the symbol mapping for Ctl/Opt/Cmd and Ashift ...

                                Update should be ready tomorrow...

                                TIG

                                1 Reply Last reply Reply Quote 0
                                • G Offline
                                  Gábor
                                  last edited by

                                  OK, we will deal with it tomorrow. Now I have other stufff to complete. Sorry.

                                  1 Reply Last reply Reply Quote 0
                                  • D Offline
                                    driven
                                    last edited by

                                    far more worrying...

                                    I edited my Preferences to remove that one, as it didn't work anyway
                                    [you can't even add them with more than one modifier anymore]

                                    after a restart, I'm back to a unfilled dialog...

                                    removed and re-downloaded... still blank

                                    are you modifying live?

                                    EDIT: got them back...
                                    it seems after removing a shortcut, the .get_shortcut returns [] [TIG's issue...]
                                    you have to make a new one and use it, before SU reports it and all the others...
                                    very odd

                                    learn from the mistakes of others, you may not live long enough to make them all yourself...

                                    1 Reply Last reply Reply Quote 0
                                    • jiminy-billy-bobJ Offline
                                      jiminy-billy-bob
                                      last edited by

                                      It would be great to be able to edit the shortcuts right inside SU.

                                      25% off Skatter for SketchUcation Premium Members

                                      1 Reply Last reply Reply Quote 0
                                      • G Offline
                                        Gábor
                                        last edited by

                                        @jiminy-billy-bob said:

                                        It would be great to be able to edit the shortcuts right inside SU.

                                        It's among the plans for further dev.

                                        1 Reply Last reply Reply Quote 0
                                        • TIGT Offline
                                          TIG Moderator
                                          last edited by

                                          Yes once we get it working acceptably on PC & MAC [coming soon 😉 ], then we plan to look at editing and 'syncing' of your shortcuts across your Computers/SketchUpVersions... but that's in the future...

                                          TIG

                                          1 Reply Last reply Reply Quote 0
                                          • G Offline
                                            Gábor
                                            last edited by

                                            Version 0.3.0 is in the pluginstore now. The new version addressed several MAC related issues found in 0.2.0. Please test. Especially MAC users.

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

                                            Advertisement