I currently have a large action script tied to a button press. I wish to also run the same code on a timer, say every hour. Is there a way to do this, while accessing the properties necessary within the button’s normal view?
Move the code to a project library script, declaring function arguments for the items it needs. Replace the event code with a one-line function call, supplying the needed arguments. Use that same function call in the other event.
As a workflow practice I highly recommend to get in the habit of writing all your business logic scripts in the project library first and then calling them from the appropriate spots. Helps keep your code DRY and also lets you look at all the logic surrounding an entity in your system in a single place which can be very helpful for troubleshooting or when you come back to it months later.
No, I don’t think so. A timer script will not know anything about your button’s view.
Now, if those properties should be accessible to a timer script, then this probably means that they should not be in a view. There’s a scope issue somewhere.
There are several places where they could be set instead, depending on what they are and what they’re used for: session custom properties, tags, database…