Get Distance / GetDistance (internally is.workflow.actions.getdistance)

This action is not yet complete. Some arguments may be missing.

This action requires that Shortcuts has permission to use WFMainThreadResource,WFLocationAccessResource.

description

summary

Calculates the distance to the location passed into this action.

input

The destination

output

The distance to the location in miles or kilometers.

usage

GetDistance from=("Current Location" | "Custom Location" | variable) location="string" routeType=("Direct" | "Driving" | "Walking") undefined=NotImplemented

arguments


from: Enumeration (Docs)

Default Value: "Current Location"

Accepts a string containing one of the options:

  • Current Location
  • Custom Location

location: Location (Docs)

Placeholder: "One Apple Park Way" Allows Variables: true

Only enabled if: argument WFGetDirectionsFrom == Custom Location

Accepts a string or text with the text. Does not allow newlines.


routeType: Enumeration (Docs)

Default Value: "Direct" Allows Variables: true

Accepts a string or variable containing one of the options:

  • Direct
  • Driving
  • Walking

This parameter is not implemented yet.

The parameter type is WFGetDistanceUnitPickerParameter. If you need to use this parameter, you may be able to use a raw value. Try converting a .shortcut to a .scpl containing the values you want in this parameter.


source json (for developers)

{
	"ActionClass": "WFGetDistanceAction",
	"ActionKeywords": [
		"maps",
		"directions",
		"calculate"
	],
	"AppIdentifier": "com.apple.Maps",
	"Category": "Location",
	"CreationDate": "2015-01-11T06:00:00.000Z",
	"Description": {
		"DescriptionInput": "The destination",
		"DescriptionResult": "The distance to the location in miles or kilometers.",
		"DescriptionSummary": "Calculates the distance to the location passed into this action."
	},
	"Input": {
		"Multiple": false,
		"Required": true,
		"Types": [
			"NSString",
			"CLLocation",
			"MKMapItem"
		]
	},
	"Name": "Get Distance",
	"Output": {
		"Multiple": false,
		"OutputName": "Distance",
		"Types": [
			"NSNumber"
		]
	},
	"Parameters": [
		{
			"Class": "WFEnumerationParameter",
			"DefaultValue": "Current Location",
			"DisallowedVariableTypes": [
				"Ask",
				"Variable"
			],
			"Items": [
				"Current Location",
				"Custom Location"
			],
			"Key": "WFGetDirectionsFrom",
			"Label": "From"
		},
		{
			"Class": "WFLocationFieldParameter",
			"Key": "WFGetDirectionsCustomLocation",
			"Label": "Location",
			"Placeholder": "One Apple Park Way",
			"RequiredResources": [
				{
					"WFParameterKey": "WFGetDirectionsFrom",
					"WFParameterValue": "Custom Location",
					"WFResourceClass": "WFParameterRelationResource"
				}
			],
			"TextAlignment": "Right"
		},
		{
			"Class": "WFEnumerationParameter",
			"DefaultValue": "Direct",
			"Items": [
				"Direct",
				"Driving",
				"Walking"
			],
			"Key": "WFGetDirectionsActionMode",
			"Label": "Route Type"
		},
		{
			"Class": "WFGetDistanceUnitPickerParameter",
			"Items": [
				"Miles",
				"Kilometers"
			],
			"Key": "WFDistanceUnit",
			"Label": "Unit"
		}
	],
	"RequiredResources": [
		"WFMainThreadResource",
		"WFLocationAccessResource"
	],
	"Subcategory": "Maps",
	"UnsupportedEnvironments": [
		"Background"
	]
}