user429620
user429620

Reputation:

applescript : updating properties?

This is probably a very basic question;

I always see

  make new document with properties { x: "1", y: "2", z: 3" }

But how do I update these properties later?

 tell first document

 -- i am trying to set the volume name property 
 set volume name of document to "BLA"
 -- also tried:
 set properties of first document to {volume name:"BLA"}

 end tell

But that doesn't work at all, what is the official syntax? Can't find it online.

Upvotes: 0

Views: 144

Answers (1)

user866649
user866649

Reputation:

You will need to target the appropriate document (or whatever has the property), but the properties are accessed the same way as any other record property, for example

tell application "whatever"
    set x of document 1 to "5" -- document 1 is usually the front document
    tell document 1 to set x to "5"
end tell

Note that an application property may not be writable - check its scripting dictionary.

Upvotes: 1

Related Questions