• 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
Re: Delivery Status Notification (Delay)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Delivery Status Notification (Delay)


  • Subject: Re: Delivery Status Notification (Delay)
  • From: Emmanuel LEVY <email@hidden>
  • Date: Fri, 22 Oct 2010 11:54:57 +0200


On Oct 22, 2010, at 5:46 AM, Robert Poland wrote:


On Oct 21, 2010, at 7:01 PM, Deivy Petrescu wrote:


On Oct 21, 2010, at 6:23 PM, Robert Poland wrote:


On Oct 21, 2010, at 3:03 PM, Deivy Petrescu wrote:


On Oct 21, 2010, at 2:11 PM, Robert Poland wrote:


On Oct 21, 2010, at 11:45 AM, Deivy Petrescu wrote:


On Oct 21, 2010, at 9:28 AM, Robert Poland wrote:

Thanks Brian,

But the question was directed to Smile not Script Editor.


On Oct 21, 2010, at 7:21 AM, Brian Christmas wrote:

G'day Robert

Works fine for me, using 10.6.4 and the 'run' button in script editor

Regards

Santa

global a
set a to (short date string of (current date))
my thisTime()

on thisTime()
	display dialog a
end thisTime


Bob,
It works as expected in Smile.
It will not work in Smile's terminal because of the way Smile's terminal is set.
Each line can be run independently.


If you run the script you posted in Smile's terminal the way you posted it, you will get an error, "thisTime() blah blah"
This because thisTime() is called before being defined.


So if you run

on thisTime()
	display dialog a
end thisTime

before the script, then it kinds of get dissociated from the script and it will not know that a and a are the same a.... :)
You can run in Script mode however.




Deivy Petrescu
email@hidden

Deivy,

ALL combinations seem to run without a problem.

It does not run here in terminal.
And it certainly it would give you more errors if you run it in the order you wrote, that is the call to the handler before the handler.


However, you are right. I did not understand the original question.
Answers below

The question is why when I validate the scripts in script mode or terminal mode do I get the two errors.


-- Undefined variables:

show window "untitled 3" selection {102, 103} -- undefined var: a
-- 	display dialog a

You are getting this message because "a" is not defined in the handler.
If you want to get rid of this message, then add


global a

to the top of your handler.


---------------------------------------------------- -- Unused variables:

show window "untitled 3" selection {14, 15} -- unused var: a
--  set a to (short date string of (current date))



You are getting this message because "a" is only used once in this script.
In its definition. Therefore, it is telling you may be you don't really need this "a" variable.


Actually we could point out to Emmanuel that, if there is a global a, then this message should not show up.



Robert Poland - Fort Collins, CO

Hope this clarifies.Deivy


Deivy Petrescu email@hidden

Deivy,

This doesn't generate any errors, but not very logical either;

global a
set a to (short date string of (current date))
set b to a
set a to b
my thisTime()

on thisTime()
	global a
	display dialog a
end thisTime


Robert Poland - Fort Collins, CO


Robert,

There are no errors in the messages you get.
They are called warnings.
You do not have to change your script because of warnings.
It makes sense for someone to point out that you only used the variable "a" in its definition and nowhere else.
So, may be it is not necessary.
It is not the case in your code, but it could be.
So if your intention is not to get any warnings, use the code above or



on thisTime(a) display dialog a end thisTime

set a to (short date string of (current date))
thisTime(a)

Which is much cleaner and generates no warnings.

Deivy Petrescu
email@hidden


Deivy,

That must be another one for Emmanuel, They are titled "Script errors".


Robert Poland - Fort Collins, CO

A point Deivy makes, I think, is that, depending on your usage of a given piece of script, a given structure - such as your lines about "a" - may error or work. Sorry it's unclear, but isn't Smile complicated enough so.


Emmanuel

_______________________________________________
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
References: 
 >Fwd: Delivery Status Notification (Delay) (From: Robert Poland <email@hidden>)
 >Re: Delivery Status Notification (Delay) (From: Brian Christmas <email@hidden>)
 >Re: Delivery Status Notification (Delay) (From: Robert Poland <email@hidden>)
 >Re: Delivery Status Notification (Delay) (From: Deivy Petrescu <email@hidden>)
 >Re: Delivery Status Notification (Delay) (From: Robert Poland <email@hidden>)
 >Re: Delivery Status Notification (Delay) (From: Deivy Petrescu <email@hidden>)
 >Re: Delivery Status Notification (Delay) (From: Robert Poland <email@hidden>)
 >Re: Delivery Status Notification (Delay) (From: Deivy Petrescu <email@hidden>)
 >Re: Delivery Status Notification (Delay) (From: Robert Poland <email@hidden>)

  • Prev by Date: [ANN] New book on AppleScriptObjC
  • Next by Date: Open movie on second monitor
  • Previous by thread: Re: Delivery Status Notification (Delay)
  • Next by thread: Scripting and Back to Mac
  • Index(es):
    • Date
    • Thread