Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • That is one way to do it. I was trying to understand why the do shell script part of my AppleScript was failing. I didn't figure out why but did find how to circumvent the issue. Where is the best place to add this circumvention? Commented Feb 22, 2021 at 19:59
  • 1
    @John, RE: "I was trying to understand why the do shell script part of my AppleScript was failing." -- The issues appears to be in the | pbcopy segment of the command, in that the output of pbpaste | gsed 's/\\x2D/\\xE2\\x96\\xB8/g' is correctly # 6C (d1/s2): F 11▸12 100 Fly (1:12.95Y) in the do shell script command, buts gets mangled being piped to pbcopy See updated answer for another method example. Commented Feb 22, 2021 at 20:46
  • Yeah, it's how Script Editor is interpreting that content. I tried using pbpaste with the flag -Prefer {rtf} but it made no difference. It think there is a missing command that helps Apple Script interpret the kind of text its getting back from the shell script before it puts in back on the clipboard. Commented Feb 22, 2021 at 21:54