Text Properties of Newly Created Fields
Posted: Mon Oct 28, 2013 1:14 am
Two questions:
1- In a new session, make a field. The textSize and textHeight of that field are empty. I always thought that the default "textHeight" was, as the dictionary says, 4/3 times the textSize. But if I set the textSize of that newly created field, the textHeight is still empty. Is the textHeight not automatically set when the textSize is? If I set the textSize in a button script:
Same if you set the textSize of a field by hand, and ask for the textHeight.
2- The templateField seems not to be a global "object", but rather local to the script that creates a new field. In other words, one cannot set the properties of the templateField outside of a handler (or manual action) that creates a new field. In still other words, one cannot set a property there and then assume that a new field dragged from the tools menu will inherit those properties. In a button:
But you will get empty if you drag another field from the tools menu, and ask for the textSize of that last field
The whole point of such an entity is to sit in the background, sort of like a global property set, providing a framework for new fields. I think I have used it this way in the past and thought it was a very cool feature. It has very limited usefulness this way. I am depressed. What am I missing?
Craig Newman
1- In a new session, make a field. The textSize and textHeight of that field are empty. I always thought that the default "textHeight" was, as the dictionary says, 4/3 times the textSize. But if I set the textSize of that newly created field, the textHeight is still empty. Is the textHeight not automatically set when the textSize is? If I set the textSize in a button script:
Code: Select all
on mouseUp
create field
set the textSize of the last field to 12
answer the textSize of the last field && the textHeight of the last field
end mouseUp
2- The templateField seems not to be a global "object", but rather local to the script that creates a new field. In other words, one cannot set the properties of the templateField outside of a handler (or manual action) that creates a new field. In still other words, one cannot set a property there and then assume that a new field dragged from the tools menu will inherit those properties. In a button:
Code: Select all
on mouseUp
set the textSize of the templateField to 12
create field
answer the textSize of the last field -- gives 12
end mouseUp
The whole point of such an entity is to sit in the background, sort of like a global property set, providing a framework for new fields. I think I have used it this way in the past and thought it was a very cool feature. It has very limited usefulness this way. I am depressed. What am I missing?
Craig Newman