Bugs when Returning JSON Object from Applescript

Describe the bug
A clear and concise description of what the bug is.

Hi, I have been improving some of my "Run Applescript and Show Return Value" widgets with the return JSON function, and in doing so I have noticed a couple bugs. First, when returning a JSON object the option to "Show only icon, not the return value" must be unchecked for it to work, even if you are only returning an icon. This means that I need to use negative space to hide the name of the button for icon only widgets, it would be great to offer the option to return an icon and show only icon.

Second, I use a newline character to create a two line now playing widget, but I want to add support for both iTunes and Spotify in the same applescript, and change the icon based on the application. However, there is a glitch when returning icon_data as well as icon_title where a newline character breaks the widget. Please fix this, I would love to return two lines and change the icon simultaneously! Thanks!

Affected input device (e.g. MacBook Trackpad, Magic Mouse/Trackpad, Touch Bar, etc.):
Touch Bar

Screenshots
If applicable, add screenshots to help explain your problem. (You can just paste or drag them here)

Device information:

  • Type of Mac: MacBook Pro 15" 2017
  • macOS version: 10.13.3
  • BetterTouchTool version: 2.523

Additional information (e.g. StackTraces, related issues, screenshots, workarounds, etc.):

Note: Before bug reporting, please make sure you have the latest version of BetterTouchTool and that you have already tried to restart your system :-). If you encounter a crash, please attach a crash log from the macOS Console.app from the "User Diagnostic Reports" section.

I will look into the icon only problem!

Are you sure the new line problem is not just an escaping issue? If you want to use a \n in a string you would need to escape it to \\n

1 Like

Hey Andreas, you're right about escaping, I should have thought of that! Thanks!!