On Oct 8, 2016, at 04:05 PM, Brian Christmas <email@hidden> wrote:
If anyone reading the list finds errors,, please let me know.
I’d still appreciate any, however minor, or complex, suggested additions.
Hi Brian,
I applaud Chris for giving server space and you for attempting the daunting task of making a useful AS reference tool. As it grows, finding the relevent bit for a particular situation will get more and more difficult. Being searchable is helpful, but consider a hierarchical structure that would allow "drilling down" by topic into the information.
Also, I'd suggest adding more explanation to item #2. What follows isn't meant as a replacement for tip #2, but is only a report about some issues with it. Perhaps you can integrate it as part of a new tip #2.
If the default text item delimiters in your code have been altered, BOTH examples will fail, so the second example is NOT a workaround for that situation.
Your second example IS, however, a way to get the Desktop alias coerced to text. But so is this:
set aPath to "" & (path to desktop) & "This is a file Name.dat" The above example works on the basis that, when concatenating, the class of the leftmost item being concatenated dictates the class of the result—unless coercion fails at some point during concatenation.
The failure in your first example (below) is due to the fact that the second item, a string, can't be coerced to an alias, which is the class of the first item:
set aPath to ((path to desktop) & "This is a file Name.dat" as text) Thus, the concatenation fails before the trailing "as text" can be executed.
Regards, Stan C.
|