get params from skype api via as

hello,

this is my first post, forgive me if my question is trivial

i`m trying to communicate with skype api via applescript.

im able to send commands, but i cant find solution to get parameters

dictionary for skype says:

send
	script name  Unicode text  -- name of the script sending the command
	command  Unicode text  -- command string

the parameter i.e is

send script name “scriptname” command “GET USER someuser FULLNAME”

works only with quotations for “scriptname”
but anyway i can`t get anything using return, etc.

do i need to make a special script object for handling this?

i know im missing something obvious, but im totally new here,
i guess 1min work.

thanks in advance for any help,

wojciech

You mean get results? Parameters are the values you pass to a command handler. Results are the values that come back from it.

If the dictionary doesn’t list a return value for the send command then that would suggest it’s not intended to return one. If you’ve tested it with a Skype command that should return a value and get nothing back, that probably confirms it. If you believe the ‘send’ command should return a result when it doesn’t (which seems a reasonable assumption), file a bug report on it - it wouldn’t be the first application ever to have a badly designed/broken scripting interface.

HTH

This is a bug. Commands that are supposed to return a result do not. However, commands that tell Skype to do something through the API do seem to work:

property script_name : "SkypeLib"
property the_status_settings : {"ONLINE", "OFFLINE", "SKYPEME", "AWAY", "NA", "DND", "INVISIBLE"}
property skype_path : "" --make sure you only have one copy of Skype installed or hard code the path here.

my skype_set_status("")

on skype_set_status(the_status)
	if skype_path = "" then if not my skype_find_path() then return
	if the_status is in {"", missing value} then set the_status to my skype_choose_status()
	if the_status is in {"false", false} then return
	using terms from application "Skype"
		tell application skype_path
			send command "FOCUS" script name script_name
			send command "SET USERSTATUS " & the_status script name script_name
		end tell
	end using terms from
end skype_set_status

on skype_choose_status()
	activate
	return (choose from list the_status_settings with prompt "Choose a Status:") as Unicode text
end skype_choose_status

on skype_find_path()
	try
		try
			tell application "Finder" to set skype_path to (application file id "com.skype.skype") as Unicode text
		on error
			tell application "Finder" to set skype_path to (application file id "SKYP") as Unicode text
		end try
		return true
	on error
		activate
		display dialog "Skype could not be located on this machine. Make sure you only have one copy of Skype on this machine (including early betas) and try this script again." buttons {"OK"} default button 1 with icon 2 giving up after 10
		return false
	end try
end skype_find_path

For more information on the Skype API, see:

http://www.skype.com/community/devzone/Skype%20API%20description%201.2.pdf

Jon

According to some Skype staff member the current API does not support returning values from Skype. Only sending commands to Skype are currently supported. This should be fixed in the next Beta that will be released shortly.

Livio