Program Files Equivalent on Mac?

In my FreeDXF extension, I want to search the user’s disc drive for an external executable (Teihga File Converter.)

On Windows, I am searching the C:/Program Files/ODA and C:/Program Files (x86)/ODA folders. These are the default locations which Teihga is installed.

Are there equivalent folders on a Mac I could look in?

Also on WIndows, the executable is TeighaFileConvter.exe. Would someone know what the actual executable is named on the Mac version? @john_drivenupthewall?


I think that would be the user’s Applications folder. Though not sure about this particular Teihga application…

@jim_foltz we already did it in version freedxf-0.10.2

module JF
  module FreeDXF
    module Teigha

      # Teigha Command Line Format is:
      #   Quoted Input Folder
      #   Quoted Output Folder
      #   Output_version {"ACAD9","ACAD10","ACAD12", "ACAD13","ACAD14", "ACAD2000","ACAD2004", "ACAD2007","ACAD2010"}
      #   Output File type {"DWG","DXF","DXB"}
      #   Recurse Input Folder {"0","1"}
      #   Audit each file {"0","1"}
      #   [optional] Input file filter (default:"*.DWG;*.DXF") (Use File.basename(filename))

       if Sketchup.platform == :platform_win
          EXE = "C:/Program Files (x86)/ODA/Teigha File Converter 4.01.0/TeighaFileConverter.exe"
          EXE = "/Applications/"
       OUTPUT_TYPE = "DXF"
       RECURSE = "0"
       AUDIT = "0"


1 Like

Thanks - so if a newer version is installed it over-writes the same folder? I guess it depends of the application. SketchUp, for example, would install different versions to different folder? But Teigha installs to the same folder?

I was trying to avoid recursively going through the entire /Applications folder to save some search time. Maybe it doesn’t matter.

and it’s the only app I’ve ever installed that does that…

File.writable?( "/Applications/")

it’s either there or it’s not, no need to recurse…

if it’s installed, File.writable? still may fail if the user hasn’t run it once from Finder…