Other SketchUp versions work fine but not 2019… Can someone verify with the code below?
module RafaelRivera
module TestScript
model = Sketchup.active_model
path = model.path[0...-4]
title = model.title
filename = File.join(path, "#{title}_v2019.skp")
## Model::VERSION_2018 Works but not Model::VERSION_2019
status = model.save_copy(filename, Sketchup::Model::VERSION_2019)
UI.openURL(path)
end # module
end # module
For now I think you can ignore the version parameter when saving to 2019 as it defaults to the running SU version, but if this isn’t fixed in 2020 there will be problems.
# what is this meant to be doing or what does it do on windoze...
UI.openURL(path)
# on a mac it raises a system error trying to open a folder in the default browser...
' There is no application set to open the URL <the path was here>'
# if you want the Folder to open in Finder, you would need a system call using one of these...
system('open', path) || `open "#{path}"` || %x(open "#{path}")
I’ve made a (hopefully) working cross platform method for opening directories. If the path is a file, not a directory, it should also become selected.
Typically this is called “Show in Folder” on windows and “Reveal in Finder” on Mac in my experience. Some programs that seam to have been developed on Mac and then ported to Windows call it “Reveal in Explorer”, which makes little sense as the name of explorer.exe isn’t exposed in the UI, just a technical name. I think “Show in Folder” is used on Mac too in some programs but can’t make any promises.