• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Yet another question?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Yet another question?


  • Subject: Yet another question?
  • From: Brian Christmas <email@hidden>
  • Date: Tue, 16 Feb 2016 21:09:59 +1100

G’day

I’ve bypassed my previous request on addressing an already opened second Application by storing its unique build number when setting the Accessibility, and then bypassing my ‘set-accessibility’ routine if the second apps build number matches.

But I’ve struck a weird problem. The Mail addressing script below runs in about a second in Applescript, but is taking 20+ seconds in my ASObjC application. Anyone know of a fix, please. I’ve addressed the window by 'window 1’, and also its name, no effect.

Regards

Santa

on fileAndMailHandlingSubRoutine4_OpenUpMailFile()
try
my fordEvent()
tell application "Mail"
activate
open my currentMailItem
tell application "System Events" to tell process "Mail"
set tempName to name of window 1
try
tell window tempName
set x to 0
# Sheet opens straight away
keystroke "s" using {command down, shift down}
# These are as slow as a wet week
tell pop up button 1 of group 1 of sheet 1
click
try
click menu item 3 of menu 1
end try
end tell
set value of text field 1 of sheet 1 to (my printDateTimeName & ".eml" as text)
end tell
click button 1 of sheet 1 of window 1
try
keystroke return
end try
on error errmsg number errnum
set my attachmentMailFlag to "Errors found"
if errnum is not in {-1700, -1719} then tell application "System Events" to display dialog "Major Error: fileAndMailHandlingSubRoutine4, Saving email.  Error number " & errnum & " Error " & errmsg as text giving up after 40
my mainLoopReturnEmpty()
end try
end tell
try
close every window
end try
end tell
my fileAndMailHandlingSubRoutine5_ZipAndSaveFile()
on error errmsg number errnum
set my attachmentMailFlag to "Errors found"
tell application "Mail"
try
close every window
end try
end tell
if errnum is not in {-1700, -1728} then
tell application "System Events" to display dialog "Loop Runner's fileAndMailHandlingSubRoutine4 . There is a 'Compressing Files' problem on the Mac in fileAndMailHandlingSubRoutine4 OpenUpMailFile.  Error number " & errnum & " Error " & errmsg as text giving up after 40
set my errorMessage to my errorMessage & "There was a file compressing problem when saving the file to the Mac in fileAndMailHandlingSubRoutine4." & return
set my tryToSave to false
my mainLoopReturnEmpty()
else
my finishUpRunner()
end if
end try
end fileAndMailHandlingSubRoutine4_OpenUpMailFile

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Yet another question?
      • From: Brian Christmas <email@hidden>
    • Re: Yet another question?
      • From: Brian Christmas <email@hidden>
  • Prev by Date: I think I'm batting my head up against a brick wall!
  • Next by Date: Re: Yet another question?
  • Previous by thread: I think I'm batting my head up against a brick wall!
  • Next by thread: Re: Yet another question?
  • Index(es):
    • Date
    • Thread