Restarting script from where it left off ?

  • strict warning: Only variables should be passed by reference in /var/sites/e/enterpriseios.com/public_html/sites/all/modules/contrib/captcha/captcha.inc on line 61.
  • strict warning: Only variables should be passed by reference in /var/sites/e/enterpriseios.com/public_html/sites/all/modules/contrib/captcha/captcha.inc on line 61.
  • strict warning: Only variables should be passed by reference in /var/sites/e/enterpriseios.com/public_html/sites/all/modules/contrib/captcha/captcha.inc on line 61.
  • strict warning: Declaration of views_handler_field_user_name::init() should be compatible with views_handler_field_user::init(&$view, $data) in /var/sites/e/enterpriseios.com/public_html/sites/all/modules/contrib/views/modules/user/views_handler_field_user_name.inc on line 61.
mcohen's picture

mcohen

Joined: Jun 17, 2014
No votes yet

Is there a way to add to the script/ continue from where it left off/finished ?
I forgot to include the fields on the payment page, and would like to avoid having to walk through the recreation of the script from scratch if possible.

Thanks.

Top
Eight_Quarter_Bit's picture

Eight_Quarter_Bit

Joined: Jan 27, 2012

No such luck I'm afraid

Your rating: None

The answer:

Sadly, in the current iteration, after you have output a constructed process there isn't a convenient way to re-import and edit it.

Semi-technical explanation for why, which you may skip if you are (validly) grumpy from fighting Apple ID setup all day:

Part of the reason for this is a limitation of the way Applescript interacts with UI Elements. UI Element references stored in variables are a data type that cannot be converted to or from a text string (or anything else for that matter.) In layman's terms, this means you can't just save "Button 1 of item 3 of window 1 of application process iTunes" as simple, editable text and then have the script load that reference from text later (at least not without writing an absolutely gargantuan and incredibly slow UI Element parser to translate everything.)

To keep things snappy(ish) when the script is actually clicking things, I actually store the reference to the UI Element in a script blob as its original object class: a real UI Element. However, in order to do this, the UI element must actually exist on your screen ANY time it is stored or referenced, or the script wigs out because the element doesn't exist. There are a few tricks around this, but it seriously complicates matters.

Once you've accumulated a bunch of these UI-Element-reference-encapsulating script blobs, AIDAB dumps the lot of them into the "output script", which is what you run against your user data CSV. This output script executes the stored blobs in sequence, injecting the data from the CSV, and sprinkling in a dash of state checking and verification for flavor. This was the only way I could finagle a method for dynamically specifying and storing references to UI Elements after the elements had ceased to exist, and not making the whole mess slower than molasses on a cold winter morning.

To make things EVEN MORE complicated, the stored script blobs are kept in what's known as a "property", which has the unfortunate attribute of erasing itself any time you go to edit the output script. I kid you not. It's a feature of Applescript that makes sense when you understand the why behind it, but it doesn't really help us out a whole lot in this case.

Because of all that, it is difficult to re-extract the script blobs and edit them, because it's not just a little text list of steps: it's actual chunks of code that are all very state-dependant and stored in a rather unhelpful way. It's theoretically possible, but non-trivial to execute.

It is a valid wish though. Trust me, I stepped through the build-an-output-script steps hundreds of times while designing and debugging AIDAB. I was wishing for that feature too.

Top
mcohen's picture

mcohen

Joined: Jun 14, 2014

EQB - I really appreciate the

Your rating: None

EQB - I really appreciate the detailed explanation - and of course the immensely helpful tool - Thank ya !

PS: How are things looking for the next revision ?

Top

Who is online?

There are currently 0 admins, 0 users and 116 guests online. Connected users: .

Recent Activity