Float toolbar on creation?
-
Does OSX have an API to read it, or do you just open it and parse it yourself?
-
I am Macless. I don't know about plist API readers ...
Here is a 'plist' set someone gave me for info - it is 'readable' - just about...MacPlistArchive.zip
Here's another useful link http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/ConfigFiles.html -
There are plist editors available that make the task much simpler by parsing it for you and showing what can be changed etc. eg http://www.macupdate.com/info.php/id/14363
-
I'll check that out. I got an old Mac mini to test on.
-
hmm... the Info.plist file in the Sketchup application package does not contain the same info we see in the Windows registry...
-
I can't seem to get a handle on the Large Tool Set to hide it, any ideas?
i.e. these don't work:
UI.set_toolbar_visible("Large Tool Set", false) UI.set_toolbar_visible("LargeToolSet", false)
-
@jim said:
I can't seem to get a handle on the Large Tool Set to hide it, any ideas?
i.e. these don't work:
UI.set_toolbar_visible("Large Tool Set", false) UI.set_toolbar_visible("LargeToolSet", false)
Yea - it's untouchable.
UI.toolbar_names
["Standard", "Principle", "Camera", "Drawing", "Edit", "Construction", "Walk", "DisplayMode", "StandardViews", "Section", "Google", "GettingStarted", "VCB"]
That's the only ones we can get. And this is on PC. On Mac it's two completely different names. -
I've managed to get a list of Ruby created toolbars on PC.
But on Mac I got some problems.
I found a plist at /Users/<user>/Library/Preferences/One com.google.sketchupfree.plist and one com.google.sketchupfree7.plist
What I'm not sure how to is:
- find the current user so I know the path to the plist
- the name of the plist - which I think is related to the application id. http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/UserPreferences.html#//apple_ref/doc/uid/20002092 Need a way to get the application’s bundle identifier for the Sketchup version the script is running in.
- the toolbar names I get from these files doesn't seem to be 100% complete. think they might only appear if they've been shown at some point.
-
@thomthom said:
I've managed to get a list of Ruby created toolbars on PC.
But on Mac I got some problems.
I found a plist at /Users/<user>/Library/Preferences/One com.google.sketchupfree.plist and one com.google.sketchupfree7.plist
What I'm not sure how to is:
- find the current user so I know the path to the plist
- the name of the plist - which I think is related to the application id. http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/UserPreferences.html#//apple_ref/doc/uid/20002092 Need a way to get the application’s bundle identifier for the Sketchup version the script is running in.
- the toolbar names I get from these files doesn't seem to be 100% complete. think they might only appear if they've been shown at some point.
I suspect the com.google.sketchupfree7.plist refers to a later install and that you can delete the other (maybe from a SU6 install?) without problems - just rename it temporarily and try .
I only have com.google.sketchuppro7.plist; com.google.sketchuppro7.LSSharedFileList.plist; com.google.LayOut.plist; com.google.LayOut.LSSharedFileList.plist; com.google.style_builder.plist
All clearly related to my SU 7 pro installation
-
:
-
@chrisjk said:
I suspect the com.google.sketchupfree7.plist refers to a later install and that you can delete the other (maybe from a SU6 install?) without problems - just rename it temporarily and try .
Yes - I have SU6 and SU7 installed.
The thing is - I need a way to determine the filename of the preference file for the Sketchup version the script is running under.
@unknownuser said:
The name of each file in Library/Preferences is comprised of the application’s bundle identifier followed by the .plist extension. For example, the bundle identifier for the TextEdit application is com.apple.TextEdit so its preferences file name is com.apple.TextEdit.plist.
But I have no idea of how to obtain the bundle identifier...
-
Found the username in the ENV array. Still need to get the bundle ID.
-
Ok - made some progress. Got code working on both Windows and OSX 10.4 (SU7.1). Other systems and versions untested.
Note that there are still issues. This code needs to be tested more.
- On Windows it require registry.rb and Win32API from a normal ruby installation. Not sure how to bundle this - in terms of license and general practicability.
- On OSX it appears that toolbar names only appears in the plist if it has previously been shown at some point. If it hasn't then there isn't any trace of it. Looking for other source for the names.
- I'm not familiar with how to get OSX data - so it's a bit of hacky brute force approach. Might be a better method to get the data. Certainly needs testing.
-
The Win version will list old toolbar names - toolbars that are no longer present, but still got remains in the registry.
Was thinking of running a loop testing against
UI.toolbar
- but it will create a new toolbar if given the name of a non-existent toolbar. Acts likeUI::Toolbar.new
. -
For Windows - I'm wondering if it'd be an option to use the Win32 API to read the menu items from the Toolbar menu...
-
A new Windows solution. It uses the Win32 API to read the menu items under
View->Toolbars
. This should allow the list returned to be up to date at any point - even after new toolbars has been created. And it won't list old names.Only thing is that I'm not sure how to get the SU window handle...
Wonder if similar can be done under OSX...
-
What I was thinking (somebody stop me) was hiding all toolbars before creating the new toolbar. Then the user can un-dock it. Finally, unhide all the hidden toolbars. But it's a terrible hack.
-
Does that avoid the shifting of toolbars? It seems to be that the toolbars shift when the Toolbar object is created - even before the toolbar is ever shown.
-
have you guys considered making a dialog window the first time a new plug runs that asks if you would like to run the plug (after all the existing toolbars are loaded) then insert the new toolbar. that way the old toolbars will be in place already, avoiding the startup scramble? (if its possible?)
-
That won't avoid the scramble either. Even if you add toolbars after all the other ones are added it still inserts itself randomly between toolbars.
Selection Toys has a function where the user has to enable to toolbar before it can be accessible. Doesn't prevent the mess though.
Advertisement