[phpBB Debug] PHP Notice: in file /viewtopic.php on line 981: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 981: getdate(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
Tynsoe Projects • View topic - Skype

Skype

Skype

Postby cptbigt » Sat Sep 03, 2011 6:00 pm

Is osascript broken in 10.7(.1)? Any applescripts i've been trying to run via geektool seemingly run (such as asking for permission to use Skype, or updating weather icons) however they never provide any output but instead remain empty within geek let (no text). For example I have the following code:

Code: Select all
echo 'Skype:'; osascript ~/Documents/Scripts/SkypeOnlineUsers.scpt | tr , "\n" | iconv -f UTF-8 -t L1


Coupled to the following applescript:

Code: Select all
(* This script displays returns all of your Skype contacts who are online, displays their moodtext (if they have one) and drops the echo123 test contact from the list.
(C) Hannes Bretschneider *)


on remvix(ix, ls)
   if ls is {} then
      return {}
   else if ix is 1 then
      return rest of ls
   else
      return {item 1 of ls} & remvix(ix - 1, rest of ls)
   end if
end remvix

on tail(astring, k)
   return do shell script "echo '" & astring & "' | awk '{{i = " & k & "; while ( i <= NF-1 ) {printf $i \" \"; i++}; printf $i}}'"
end tail

property onlinegroup : 0

on getgroup()
   tell application "Skype"
      if my checkgroup(onlinegroup) is true then
         return onlinegroup
      else
         set hardwired to send command "search groups hardwired" script name "online users"
         set hardwired to my tail(hardwired, 2)
         set hardwired to text items of hardwired
         repeat with i in hardwired
            if my checkgroup(i) is true then
               return i
            end if
         end repeat
      end if
   end tell
end getgroup

on checkgroup(group_id)
   tell application "Skype"
      set grouptype to send command "get group " & group_id & " type" script name "online users"
      set grouptype to my tail(grouptype, 4)
      if grouptype is "ONLINE_FRIENDS" then
         return true
      else
         return false
      end if
   end tell
end checkgroup

property dropped : 0
set text item delimiters to ", "
set onlineusers to {}
tell application "System Events"
   set powerCheck to ((application processes whose (name is equal to "Skype")) count)
   
   if powerCheck = 0 then
      set end of onlineusers to " Skype not running"
   else
      tell application "Skype"
         set onlinegroup to my getgroup()
         set skype_id to send command "get group " & onlinegroup & " users" script name "online users"
         set skype_id to my tail(skype_id, 4)
         set skype_id to text items of skype_id
         repeat with j from 1 to count skype_id
            if item j of skype_id is "echo123" then
               set skype_id_new to my remvix(j, skype_id)
               set dropped to 1
            end if
         end repeat
         if dropped is 1 then
            set skype_id to skype_id_new
         end if
         repeat with i in skype_id
            set aUser to send command "get user " & i & " fullname" script name "online users"
            set aUser to my tail(aUser, 4)
            if aUser is "" then set aUser to i
            set amoodtext to send command "get user " & i & " mood_text" script name "online users"
            set amoodtext to my tail(amoodtext, 4)
            if amoodtext is "" then
               set end of onlineusers to aUser
            else
               set end of onlineusers to aUser
            end if
         end repeat
         
         if (count skype_id) > 0 then
            set item 1 of onlineusers to " " & item 1 of onlineusers
         else
            set beginning of onlineusers to " No Contacts Online"
         end if
         return onlineusers
      end tell
   end if
end tell


However it does not seem work correctly, neither do any of my other osascript commands for weather etc. The above script simply says 'Skype:' from it's echo command but does not display any info. Any help would be appreciated. Thanks!
cptbigt
 
Posts: 2
Joined: Sat Sep 03, 2011 5:59 pm

Re: Skype

Postby cptbigt » Sat Sep 03, 2011 6:01 pm

I'm running 10.7.1 and Geektool Version 3.0.2 (302)
cptbigt
 
Posts: 2
Joined: Sat Sep 03, 2011 5:59 pm


Return to GeekTool

Who is online

Users browsing this forum: No registered users and 10 guests

cron