2

In applescript, how do I make this a multi-line/easy-to-read property list?

set props to {target:"Safari", slideNo:2, propsUrl:"https://docs.google.com/presentation/d/slideId/preview", rewardsUrl:"https://docs.google.com/presentation/d/slideId/preview", coords:{posX:937, posY:497, sizeX:149, sizeY:262}}

something (reasonably) pythonic like...

set props to (
{
    target:"Safari", 
    slideNo:2, 
    propsUrl:"https://docs.google.com/presentation/d/slideId/preview",
    rewardsUrl:"https://docs.google.com/presentation/d/slideId/preview", 
    coords:{posX:937, posY:497, sizeX:149, sizeY:262}
 }
)

Is this possible? Using '¬' at the end of each line seemed to screw up the formatting. Thanks in advance :)

2 Answers 2

1

Or you can also make it more readable by doing something like this...

set props to {target:"Safari", slideNo:2} & ¬
    {propsUrl:"https://docs.google.com/presentation/d/slideId/preview"} & ¬
    {rewardsUrl:"https://docs.google.com/presentation/d/slideId/preview"} & ¬
    {coords:{posX:937, posY:497, sizeX:149, sizeY:262}}
0

If you want it more readable, then use property and separate the list you have into individual properties, e.g.:

property target : "Safari"
property slideNo : 2
property propsUrl : "https://docs.google.com/presentation/d/slideId/preview"
property rewardsUrl : "https://docs.google.com/presentation/d/slideId/preview"
property coords : {posX:937, posY:497, sizeX:149, sizeY:262}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .