1 (edited by microwerx 2026-04-09 14:32:58)

Topic: Add OptionsNib to pass a string

I want to make an action that acts like the Open URL action. Open URL allows you to specify the URL that you'd like to open. I'd like to make something similar but that uses a different URL scheme. For instance, apps are allowed to specify a custom scheme that opens that app. The built-in ones are `open:` and `shortcut:`. I have a custom app that opens with customapp://0ba204 and I could launch it on the command-line with `open "customapp://0ba204"`.

Maybe this is already supported, but I couldn't seem to find a way to do that.

I think that passing a string could be used to set command-line arguments for a command--so I think this could also be super useful.

Re: Add OptionsNib to pass a string

Here's an example of an action that does this:

# Dropzone Action Info
# Name: Open Different URL Scheme
# Description: Open 
# Creator: Aptonic
# URL: https://aptonic.com
# Events: Clicked
# OptionsNIB: OpenURL
# SkipConfig: No
# RunsSandboxed: Yes
# Version: 1.0
# MinDropzoneVersion: 5.0
 
def clicked
  url = ENV['url']

  if url && !url.empty?
    system('open', url)
    $dz.finish("Opened: #{url}")
  else
    $dz.fail("No URL provided")
  end

  $dz.url(false)
end

This uses the OpenURL OptionsNIB and lets you use alternative URL schemes.

Re: Add OptionsNib to pass a string

I tried to guess URL…but yes, thank you! That’s what I’m looking for.