Is restoring text item delimiters necessary?

前端 未结 3 1060
伪装坚强ぢ
伪装坚强ぢ 2020-12-21 11:52

The commonly recommended way to use text item delimiters is like this:

set tid to AppleScript\'s text item delimiters
set AppleScript\'s text item delimiters         


        
3条回答
  •  别那么骄傲
    2020-12-21 12:14

    I remember reading something about this change that you're talking about, that it was no longer necessary to reset them, however I couldn't find anything about it after a Google search. As such I did a quick test. I made these 2 scripts and ran them in AppleScript Editor. First this one...

    set text item delimiters to "something"
    return text item delimiters
    

    And then this one...

    return text item delimiters
    

    The second script returns {""}. So it seems the first script is not affecting the second. I tested this in both 10.6 and 10.8 with the same results.

    Here's applescript release notes. I can't find release notes for 10.7 or 10.8. Searching them turns up nothing on this subject either...

    http://developer.apple.com/library/mac/#releasenotes/AppleScript/RN-AppleScript/RN-10_3/RN-10_3.html#//apple_ref/doc/uid/TP40000982-CH103-SW1
    

    Therefore I have no definitive answer for you. Everyone says to reset them but my simple test shows that it's not required.

    Also you're right, you don't need "Applescript's" outside of tell blocks.

提交回复
热议问题