On 3 Dec 2015, at 1:51 PM, Brian Christmas <email@hidden> wrote:
I see what you’re hinting at, script Editor inserts the ‘rich’. It doesn’t seem to matter, tho, even tho it’s no longer necessary.
It's a messy situation. Mail defines "rich text", as you can see in its dictionary, and also in its sdef:
<class name="rich text" code="ctxt" plural="rich text" description="Rich (styled) text">
The problem is that the code "ctxt" is also what AppleScript uses for "text", so you have two terms defined with the same code. In such cases, what you get when you decompile/compile can vary; it may well be that some people are seeing it compile as simply text.
if tempMonthMailbox < 10 then set tempMonthMailbox to "0" & tempMonthMailbox as rich text if my theDays < 10 then set my theDays to "0" & my theDays as rich text set tempDailyName to ((my theYear) & " " & tempMonthMailbox & " " & (my theDays) as rich text) set tempYearString to ("Year " & (my theYear) as rich text) make new mailbox with properties {name:tempYearString & "/" & tempMonthMailbox & "/" & tempDailyName & "/" as rich text}
In most of those cases, you don't need either "as rich text" or "as text". There's a temptation to just add it "in case", but it's generally not a good idea; it can end up making other problems hard to track down. If you're concatenating several items, and the first one is text -- which is the case in most of the above -- the result will be text. If it's not, coerce the first item to text and then concatenate the others, or coerce the items individually.
The only time it does anything is when the first item is not text, in which case the & is doing something else -- and you should know about that and fix it, rather than just masking it with a catch-all "as text".
|