Re: How to do a goto with Applescript?
Re: How to do a goto with Applescript?
- Subject: Re: How to do a goto with Applescript?
- From: "Stockly, Ed" <email@hidden>
- Date: Tue, 11 Jan 2011 15:51:15 -0600
- Acceptlanguage: en-US
- Thread-topic: How to do a goto with Applescript?
> I'd say the main issue with that particular script is that it's
> pretty much a giant table lookup, coded as a long sequence of if
> statements only because AppleScript doesn't have a table data type
> (hash/dictionary/associative array/map/whatever).
>
> I do think it would be clearer if the main logic were isolated better
> from the app-specific logic. If I were writing it, I would maybe
> define a script object for each application that's responsible for all
> the stuff specific to that application. Make them all have a handler
> of some specific name (I used "configure" below), to which you pass in
> a record containing the bounds, and then it alters that record as
> needed and does whatever extra app-specific stuff it needs to do, and
> return a success/failure flag (so the main handler can decide what to
> do about those).
If I were doing this, I'd create tab/return delimited data file that the
script would read/write.
AppName ScreenSize left right top bottom ExtraData
Load the file at start with default values.
When the script gets the app name, parse it from the file data.
In addition, I would provide for the user to set up an ap's window with the
size and position they want and save those values for that app to the file.
There could even be a developer script which would allow the developer to
easily record and store default settings on various screen sizes by simply
setting the size running the script, which would update the file.
With this setup, one easily could add new apps, change behavior for numerous
macs by simply distributing a new text/data file.
It would be very simple, give the user more options and flexibility, and
give the script writer a foundation to build on.
ES
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden