G’day Phil
You’re right, the repeat and delay don’t make much sense. They’re there because I have to be utterly sure the routine won’t get bypassed. The user MUST know that Accessibility is NOT turned on. So I simply added the repeat in case something was wrong with the try loop, and the delay to make sure the menu was ready. Just safeguards, as I’ve learnt to be very careful over the past few years, and cover everything that might, just might, go wrong.
Probably a waste of coding, but.
However, back to the most important point, what can I use to replace Bill’s routine, in a simple way, if possible?
Regards
Santa
On 6 Oct. 2016, at 4:40 pm, Phil Stokes < email@hidden> wrote:
On 6 Oct 2016, at 10:36, Brian Christmas < email@hidden> wrote:
Anyone got anything simpler, please?
Well, this doesn’t make much sense to me:
tell application “TextEdit" -- do shell script ("sleep 1") tell application "System Events" to tell process "TextEdit" do shell script ("sleep 0.2”)
And your repeat seems redundant. No matter what the condition (pass or fail), you’re exiting the repeat, so this script is only ever going to run once. How about:
set assistTrial to false tell application "TextEdit" activate try close every window saving no end try end tell
delay 1
tell application "System Events" to tell process "TextEdit" try click menu item "Preferences…" of menu 1 of menu bar item "TextEdit" of menu bar 1 set my assistTrial to true on error errmsg number errnum set my assistTrial to false end try end tell
And what, you ask, was the beginning of it all? And it is this...... Existence that multiplied itself For sheer delight of being And plunged with numberless trillions of forms So that it might find itself innumerably
Sri Aurobindo
|