You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

AppleScript code on discussions.apple.com - missing whitespace

Can someone tell me what is going on here... anytime I look for some sample applescript code on discussions.apple.com I've noticed that white space has been removed making the code unusable without cleanup. This is particularly difficult if you are just starting out (like me) to know where to put the spaces back in.


For example:

in this post https://discussions.apple.com/thread/8164691


in chrome and safari I see...

on addressed chat room message receivedtheMessagefromtheBuddyfortheChat

instead of...

on addressed chat room message received the Message from the Buddy for the Chat


Is this being done deliberately when the code is copied and pasted (and published to the discussion) or am I missing something?



Posted on Aug 19, 2020 9:38 PM

Reply

Similar questions

6 replies

Aug 23, 2020 5:02 AM in response to w33d5

I suggest a couple of online tools that will assist you in learning AppleScript.

  1. Apple's AppleScript Language Guide
  2. MacScripter.net where articles appear in current to oldest order. Some of the older code examples (e.g. 2007) may not work as depicted as AppleScript has evolved over the last few years.


I tend to abbreviate a browser search as: macscripter dates and times to get this result.


When interacting with applications, always check if the Script Editor's File : Open Dictionary… entries provide a scripting dictionary for that application, and follow those associated reserved words during that scripting process.

Aug 20, 2020 7:24 AM in response to w33d5

It was the old hosting software (at that time) stripping the white-space, or the manner in which the author posted the code — so the inevitable code cleanup issue is on the reader.


The current hosting software expects that one will select the <> tool on the bottom toolbar here, paste the code into it, and then add an extra return, followed by clicking the <> tool again. I have not seen it absorb white-space. Just pasting code into the discussion without that <> tool approach will put legibility at risk.

AppleScript code on discussions.apple.com - missing whitespace

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.