broment
broment

Reputation: 76

Any Way to Print to the Console with Color in AppleScript?

In Objective-C, one can print color to the console using the following code:

NSLog(@"\e[1;31mHere is red text!\e[m Here's normal text");

However, if I were to attempt to print the same string using AppleScript's log, I would get Expected “"” but found unknown token. (-2741). Is there any way to print color using AppleScript or was such a capability simply never included?

Thanks.

Upvotes: 0

Views: 203

Answers (1)

Peter Toth
Peter Toth

Reputation: 1004

This worked for me in iTerm2

log(do shell script "echo '\\033[33mHYellow\\033[0m'")

Upvotes: 0

Related Questions