SU2021 Sketchup.find_support_file Win<>Mac difference

If I run:

Sketchup.find_support_file("su_trimble_connect.rb", "Plugins/")
on both platforms I get a correct path to su_trimble_connect.rb file.

If I rename this file to su_trimble_connect.2rb, the Ruby command:
Sketchup.find_support_file("su_trimble_connect.2rb", "Plugins/")
will find the file just on Windows (21.0.391). On Mac (21.0.392) the file will not be found.

I tested it in SU2019 and it was returning the path on both platforms. I didn’t test it in SU2020.
I am curious whether I can force somehow SU2021.392 on Mac to find the .2rb file too.

I use the .rb rename to toggle between two different plugin versions. .2rb will not be executed. This is why I need to find the presence of deactivated “v2”.

If it is a bug in SU2021 on Mac, then I guess I will have to move the loader.rb to a sub-folder to make the switch work. If someone has a better solution let me know, please.

Where is that renamed .2rb file located? If it is directly in Plugins, it should work. But if it is in a folder below Plugins, I verified that 2019, 2020, and 2021 on Mac all won’t search recursively within subfolders of Plugins. One has to supply the full path to the folder.

I don’t think that is how it was intended to work, as if you know the path why would you need to use this method? But I wonder if it may be a change due to macOS version rather than SketchUp? I have only a Catalina 10.15.7 Mac. What version are you testing on?

Ok. It is SU2021 “bug”. The file is exactly in the same folder when original su_trimble_connect.rb was located. I tested it in 10.14.6. I may check .13, but I am afraid it is “SketchUp’s” internal decision to search only for supported file types.

As I reported, on my Mac 2019 and 2020 behave the same. So it is not a new bug or specific to 2021 unless it is affected by macOS update.

Weird. As I have written, it works ok in SU2019 in the same system.

It was my own fault. :smile:
I didn’t enable displaying file extensions in Finder in 10.14, so when I renamed the file it was:
No wonder it was not found… oh. well. :slight_smile:


Phew! This sounded like a weird bug. :grinning: