Back in 2019 I wrote a little script that would parse your Applications folder and tell you which of your apps were available on Setapp. The goal was to help you figure out which apps you were already using that were also on Setapp, so you could use the Setapp version and direct a little of your subscription fee to your favorite developers.

The script parses the setapps/apps page to see what apps are available, and the markup has changed since I originally wrote the script. Thankfully, Chuck Plater updated the script in a fork to work with the current markup. I’ve implemented his changes in the original script and it’s once again working fine.

To use the script, save it to a text file called onsetapp.rb, then run chmod a+x onsetapp.rb on it. Once you’ve done that, you should be able to execute ./onsetapp.rb and get a list of applications you use that are also available on Setapp.

Thanks to Chuck for the fix. I hope all Setapp subscribers will go to the trouble of using the Setapp version of apps they already own, it really does help the developers (and this script makes it easy). If you’re not already a Setapp user, here’s my affiliate link to start using hundreds of apps for $10 a month.

onsetapp.rbraw
"
#!/usr/bin/env ruby
# encoding: utf-8

# Read /Applications/Setapp to get apps already installed
installed_setapp_apps = Dir.glob('/Applications/Setapp/*.app')
installed_setapp_apps.map! {|app|
  File.basename(app,'.app')
}

# Grab the All Apps page from Setapp to get all available apps
apps_page = `curl -SsL https://setapp.com/apps`
setapp_apps = apps_page.force_encoding('utf-8').scan(/<app-details\s*name=\"(.*?)\"/m).map {|match|
  match[0]
}

# Read /Applications for non-Setapp apps on the system
apps = Dir.glob('/Applications/*.app')
apps.map! {|app|
  basename = File.basename(app,'.app')
  # Setapp disallows version numbers in app names. Strip them from
  # /Application apps for consistency in matching
  basename.sub!(/\s*\d+$/,'')
  basename
}

setapp_apps.sort.uniq.each {|app|
  if apps.include?(app)
    # App is on Setapp
    out = "Setapp has: #{app}"
    if installed_setapp_apps.include?(app)
      # Setapp version is installed (or at least proxied)
      out += " (Installed)"
    end
    $stdout.puts out
  end
}