Skip to content

string assigned to variable leads to: Get Contents of URL failed because Shortcuts couldn't convert from Rich text to URL. #29

@chrysaora-achlyos

Description

@chrysaora-achlyos

Describe the bug

string assigned to variable leads to: Get Contents of URL failed because Shortcuts couldn't convert from Rich text to URL.

Assignment of url to cmsURL, then used in downloadURL(url: cmsURL,... generates a "Get Contents of URL failed because Shortcuts couldn't convert from Rich text to URL." error

Import Shortcuts
//
dictionary() >> header
setValue(key: Content-Type, value: "application/json; charset=UTF-8", dictionary: header) >> header
//
var cmsURL = "https://jsonplaceholder.typicode.com/posts"
//
dictionary() >> reqDict
setValue(key:title, value: "My First Post", dictionary: reqDict) >> reqDict
setValue(key:body, value: "0.9", dictionary: reqDict) >> reqDict
setValue(key:userId, value:1, dictionary: reqDict) >> reqDict
//
downloadURL(
url: cmsURL,
method: POST,
headers: header,
requestType: Json,
requestJSON: reqDict,
requestVar: response) >> response
//
quicklook(input: response)

Working code with direct use of string:

import Shortcuts
//
dictionary() >> header
setValue(key: Content-Type, value: "application/json; charset=UTF-8", dictionary: header) >> header
//
dictionary() >> reqDict
setValue(key:title, value: "My First Post", dictionary: reqDict) >> reqDict
setValue(key:body, value: "0.9", dictionary: reqDict) >> reqDict
setValue(key:userId, value:1, dictionary: reqDict) >> reqDict
//
downloadURL(
url: "https://jsonplaceholder.typicode.com/posts",
method: POST,
headers: header,
requestType: Json,
requestJSON: reqDict,
requestVar: response) >> response
//
quicklook(input: response)

To Reproduce

Steps to reproduce the behavior:

  • paste the code above into a.jelly
  • run the command jelly a.jelly --export --out u_a.shortcut
  • run the command shortcuts sign --mode anyone --input u_a.shortcut --output a.shortcut
  • run the command open -a Shortcuts a.shortcut
  • click the "Add Shortcut" button
  • click to select the a Shortcut in Shortcuts
  • click to open the selected shortcut
  • run the shortcut with play icon on top right of shortcut
  • observe "Get Contents of URL failed because Shortcuts couldn't convert from Rich text to URL." error message

Expected behavior

Should preform the same as the second code snippet which runs without error

Screenshots

If applicable, add screenshots to help explain your problem.

Information

  • Device: [macBook Pro, 14-inch, 2021]
  • OS: [Sonoma 14.5]
  • Jellycuts Version [??? jelly command does not provide version info (/opt/homebrew/bin/jelly)]
  • Jailbroken? [No]

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions