• 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
Explaining syntax
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Explaining syntax


  • Subject: Explaining syntax
  • From: Ronan O Ciosoig <email@hidden>
  • Date: Sun, 22 Feb 2009 22:58:50 +0100

Hi, can someone explain this syntax to me: 

What is the significance of this bit of code in the below context? 
script name "Notifier" 

tell application "Skype" to set theServerName to (text returned) of (display dialog "Please enter a server name:" with icon 1 default answer "")

tell application "Address Book"
	set allPeopleToContact to ((people whose note contains (("Server: " & theServerName) as string)) as list)
	repeat with thePersonWeAreContacting in allPeopleToContact
		set theFirstName to (first name of thePersonWeAreContacting)
		set thePhone to (value of ((first phone of thePersonWeAreContacting) whose label = "mobile"))

		set theSMSText to "Dear " & theFirstName & ", this little note to inform you that your server \"" & theServerName & "\" suffered a short outage today. Things are now back to normal."
		tell application "Skype"
			set TheSMS to (word 2 of (send command ("CREATE SMS OUTGOING " & thePhone) script name "Notifier") as text)
			send command (("SET SMS " & TheSMS & " BODY " & theSMSText) as string) script name "Notifier"
			send command (("ALTER SMS " & TheSMS & " SEND") as string) script name "Notifier"
		end tell
	end repeat
end tell

From: http://www.oreillynet.com/mac/blog/2006/11/automate_sms_sending_with_skyp.html

In any case... I did a small modification to send a script to be sent using a command line: 

on run argv
set theFirstName to item 1 of argv
set thePhone to item 2 of argv


set theSMStext to "Hey " & theFirstName & ", this is Skype saying hello"


tell application "Skype"
set TheSMS to (word 2 of (send command ("CREATE SMS OUTGOING " & thePhone) script name "Notifier") as text)
send command (("SET SMS " & TheSMS & " BODY " & theSMStext) as string) script name "Notifier"
send command (("ALTER SMS " & TheSMS & " SEND") as string) script name "Notifier"
end tell
end run



And then call it from the command line 
/usr/bin/osascript smsCommandTest.scpt <name> +<countryCode><mobileNumber>

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

  • Prev by Date: Re: adding a new rule to Mail
  • Next by Date: Re: Archiving reminder script fails to work as expected.
  • Previous by thread: Re: Archiving reminder script fails to work as expected.
  • Next by thread: Oddity with quark script
  • Index(es):
    • Date
    • Thread