Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tell Grog to glog



On 7/01/07 2:22, Gil Dawson wrote:

Hi--

[...]

Can someone please help me interpret this message?


The "Connection is invalid" message indicates that the caller script was still expecting something from Grog when the latter quit.
Looks like having Grog.app to display some dialog when launched hinders a response to get returned to the caller script.
(don't remember whether this always has been the case...)


Given the above, something like this works:

======== Grog =========
global StartTime

on run
   set StartTime to (current date)
   activate
   display dialog "Grog launched." giving up after 1
end run

on glog(s)
   activate
   display dialog "Grog called with " & ¬
       s & ¬
       " as a parameter."
end glog

on idle
   if (current date) > (StartTime + 10) then quit
   return 5 -- check again in five seconds
end idle
=======================

==== Caller script ====
-- Allow Grog.app to initialize.
ignoring application responses
   tell application "Grog" to run
   delay 2
end ignoring

-- Use Grog.app's script.
tell application "Grog"
   glog("xxx")
   glog("yyy")
end tell
=======================

HTH,
Axel

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >RE: AS and Unicode characters (From: KOENIG Yvan <email@hidden>)
 >Re: AS and Unicode characters (From: "Mark J. Reed" <email@hidden>)
 >Re: AS and Unicode characters (From: KOENIG Yvan <email@hidden>)
 >tell Grog to glog (From: Gil Dawson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.