-
Notifications
You must be signed in to change notification settings - Fork 32
public.open.resource
This function is used to open any URL scheme recognized by OS X.
The settings dictionary contain all informations you can set to use this function. Here is a description of each.
Key | Type | Description |
---|---|---|
title | Translatable string (see: Label translation) | Item's title shown in the menu |
computedTitle | Name of the script in Application Support CustomScripts folder |
First line on stdout will be the title |
optionalDisplay | Boolean | Will show the related item only if option key was pressed when Hello-IT menu was shown (supported in Hello-IT 1.4.0+) |
URL | String | Target's URL to open |
hideIfNotAvailable | Boolean | For file:// URL scheme only, menu item will be hidden if the resource does not exist (supported in Hello-IT 1.7.0+) |
The URL scheme must be recognized by OS X and correctly associated with an application. You can test if your system support your URL correctly with Safari. Type your URL in the Safari URL field and it will try to open it. If Safari can't open it by itself it will open it via default application.
If you want to list all know scheme in your system, you can use:
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -dump | grep 'flags\|bindings' | grep -A1 'url-type' | grep 'bindings' | cut -d\ -f2-
<dict>
<key>functionIdentifier</key>
<string>public.open.resource</string>
<key>settings</key>
<dict>
<key>URL</key>
<string>https://www.dropbox.com/sso/42</string>
<key>title</key>
<string>Dropbox Business</string>
</dict>
</dict>
<dict>
<key>functionIdentifier</key>
<string>public.open.resource</string>
<key>settings</key>
<dict>
<key>URL</key>
<string>rdp://vdi.corp.example.com</string>
<key>title</key>
<string>Your Windows Desktop</string>
</dict>
</dict>
The main implementation of this function is made in the OpenResource plugin from the main project.
The original implementation use NSURL and NSWorkspace classes from the Cocoa framework.
That mean the URL string must be a URL that conforms to RFCs 2396, 1738 and 1808.
Software provided under the BSD 3-clause license. For commercial support and custom development, please contact Abelionni.
- Introduction
- Application Description
- Hello-IT as an LaunchAgent
- Preferences
- Preferences subdomain
- Functions
- Security
- Label translation
- Notifications on state change
- Images
- Logs
- Support and custom requests
- Tell it if you use it!