Reading Json response from clipboard

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Junior Coder
Posts: 29
Joined: Wed Mar 10, 2021 5:05 pm

Reading Json response from clipboard

Post by mnaeem » Tue Nov 22, 2022 7:45 pm

Hello Great Minds,
I am using PowerShell script and from PowerShell I am setting up a json content mentioned below in the clipboard, however when I try to fetch the content from the MS script it gives this


Code: Select all

  "errorCode": 0,
  "accountFileInfo": "D:\\Data\\automation\\clientAccount.csv"
MS Script to read the content from clipboard and parse the JSON

Code: Select all

I am getting 2 error prompts
  • Line 6 : not appropriate
  • Unexpected character in JSON data
Please advise how can parse the JSON content from the clipboard.


User avatar
Marcus Tettmar
Site Admin
Posts: 7351
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK

Re: Reading Json response from clipboard

Post by Marcus Tettmar » Wed Nov 23, 2022 4:43 pm


Remove the % characters around the clipboard variable in the JSONParse line. You can also remove Let and the format value.

Code: Select all

Marcus Tettmar |

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts