Jump to content

Alfred to Skype Interaction


Recommended Posts

'sr' now works without first selecting the person but the conversation only shows up after I start to type.

All the icons (my own and for friends) now disappeared. I get the skype icon for everyone or rather I slightly different version in which the lower right corner has some color overlay. I can post a screenshot if that would help. 

Link to comment

Yes, the convo is always loaded afterwards and cached. 

 

Did you do "s update"? If yes, and you still don't get the right icons, can you go to Alfred, select the Skype workflow, open a part of it (doesn't matter) and hit "open workflow" directory, then there is a folder "avatars" does it contain images? and if so, the avatars of your friends or just the skype icon multiplied?

 

Thank you for your help, that part I couldn't test on another mac, so any feedback is important! 

 

The colored corner match the current status of a user, white offline, green online, yellow busy, red DND

Edited by xtin
Link to comment

Hi,

 

With latest update (BTW there is no more icon for the extension) and after doing a "s update", I only have one avatar in the avatar directory. (with prior version, I had all avatars)

I don't really know what I can do to debug the issue, any suggestion?

 

Note: the only avatar that gets loaded is from a contact that has been removed from my contact list since a long time, not sure why it is still present in Skype DB.

 

PS: your workflow is awesome!

Link to comment

Hi,

 

With latest update (BTW there is no more icon for the extension) and after doing a "s update", I only have one avatar in the avatar directory. (with prior version, I had all avatars)

I don't really know what I can do to debug the issue, any suggestion?

 

Note: the only avatar that gets loaded is from a contact that has been removed from my contact list since a long time, not sure why it is still present in Skype DB.

 

PS: your workflow is awesome!

 

Hi, for the avatar in the directory, is there online one image or are there variants _online.jpg, _offline.jpg ... ?

Link to comment

No there is only one jpeg image skypepseudo.jpeg

Interesting. What OSX Version are you on? When you s ... it does find all your friends?

 

(BTW Skype stores many things one might believe to be lost in that database...)

Link to comment

Interesting. What OSX Version are you on? When you s ... it does find all your friends?

 

(BTW Skype stores many things one might believe to be lost in that database...)

 

I am using 10.8.3.

When I do "s update" the notification only shows "Skype" (no subtext) and it is very quick (compared to previous version where it takes some time to build the cache)

Link to comment

I am using 10.8.3.

When I do "s update" the notification only shows "Skype" (no subtext) and it is very quick (compared to previous version where it takes some time to build the cache)

 

I tried to debug a bit more and I get:

 

python vinc.py
Traceback (most recent call last):
  File "vinc.py", line 2, in <module>
    s.sendMessage("skype update",show=True)
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/skypingalfred.py", line 144, in sendMessage
    _getAvatars()
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/skypingalfred.py", line 215, in _getAvatars
    bg = Image.open("avatars/"+av[0]+".jpeg").resize((96,96),Image.ANTIALIAS)
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/PIL/Image.py", line 1290, in resize
    self.load()
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/PIL/ImageFile.py", line 164, in load
    self.load_prepare()
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/PIL/ImageFile.py", line 231, in load_prepare
    self.im = Image.core.new(self.mode, self.size)
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/PIL/Image.py", line 37, in __getattr__
    raise ImportError("The _imaging C module is not installed")
ImportError: The _imaging C module is not installed

 

Not sure yet how to fix this since I don't know python, I'll google it. But if someone knows the issue, that would be great :-)

Link to comment

I tried to debug a bit more and I get:

...

Not sure yet how to fix this since I don't know python, I'll google it. But if someone knows the issue, that would be great :-)

 

That's great thank you, exactly what i needed! I will publish a version today that will remedy that problem :)

 

Is it possible to use my custom aliases? For example, I'd love to type "s Dad" instead of "s [my Dad's name]"

Also, thanks for the great workflow. The "Reply to last message" is a huge time saver for me.

What you you can do is rename your dad's visible name in skype so it contains "Dad", you should then be able to "s dad", where he should be the first hit. (If not, add "dad" twice, the entries are sorted by the number of characters that are match your query, e.g. if you do "s dad" and the skypename of your dad is daddaddad, it will return 9 as 9 chars have been matched ;) ) After you changed the name, run "s update" to load the namechange into the cache.

 

(Note: What is displayed as name is what the user has set as his full name, only if no fullname is set, the given name (the one you set) is displayed, for searching though, the account name, fullname and given name are used)

Edited by xtin
Link to comment

Hi, 

I am having the exact same problems as vdesabou. I downloaded the newest version (I think, from the first page of this thread), but the problem persists.

 

Besides that, great workflow idea!

 

Cheers

Link to comment
  • 2 weeks later...

I tried to debug a bit more and I get:

 

python vinc.py
Traceback (most recent call last):
  File "vinc.py", line 2, in <module>
    s.sendMessage("skype update",show=True)
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/skypingalfred.py", line 144, in sendMessage
    _getAvatars()
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/skypingalfred.py", line 215, in _getAvatars
    bg = Image.open("avatars/"+av[0]+".jpeg").resize((96,96),Image.ANTIALIAS)
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/PIL/Image.py", line 1290, in resize
    self.load()
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/PIL/ImageFile.py", line 164, in load
    self.load_prepare()
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/PIL/ImageFile.py", line 231, in load_prepare
    self.im = Image.core.new(self.mode, self.size)
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/PIL/Image.py", line 37, in __getattr__
    raise ImportError("The _imaging C module is not installed")
ImportError: The _imaging C module is not installed

 

Not sure yet how to fix this since I don't know python, I'll google it. But if someone knows the issue, that would be great :-)

 

So I found a way to install the missing _imaging module (found here http://appelfreelance.com/2010/06/libjpeg-pil-snow-leopard-python2-6-_jpeg_resync_to_restart/)

 

http://www.ijg.org/files/jpegsrc.v8.tar.gz

go into your shell environment and untar by running the following

tar -zxvf jpegsrc.v8.tar.gz


cd jpeg-8

then run

./configure
sudo make clean
sudo make
sudo make install

 

Looks better now, but now I get:

 

Traceback (most recent call last):
  File "vinc.py", line 3, in <module>
    print s.sendMessage("skype update")
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/skypingalfred.py", line 144, in sendMessage
    _getAvatars()
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/skypingalfred.py", line 215, in _getAvatars
    bg = Image.open("avatars/"+av[0]+".jpeg").resize((96,96),Image.ANTIALIAS)
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/PIL/Image.py", line 1290, in resize
    self.load()
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/PIL/ImageFile.py", line 201, in load
    raise IOError("image file is truncated (%d bytes not processed)" % len()
IOError: image file is truncated (7 bytes not processed)

 

 

However, I have now 100+ images in avatars directory, so it looks like one of the images is corrupted. 

Any idea how to fix that?

 

Thanks

Link to comment

 

Traceback (most recent call last):
  File "vinc.py", line 3, in <module>
    print s.sendMessage("skype update")
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/skypingalfred.py", line 144, in sendMessage
    _getAvatars()
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/skypingalfred.py", line 215, in _getAvatars
    bg = Image.open("avatars/"+av[0]+".jpeg").resize((96,96),Image.ANTIALIAS)
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/PIL/Image.py", line 1290, in resize
    self.load()
  File "/Users/vincent/Dropbox/Alfred.alfredpreferences/workflows/user.workflow.08332C67-55FC-49BB-B546-E02AC9181AF7/PIL/ImageFile.py", line 201, in load
    raise IOError("image file is truncated (%d bytes not processed)" % len()
IOError: image file is truncated (7 bytes not processed)

 

 

However, I have now 100+ images in avatars directory, so it looks like one of the images is corrupted. 

Any idea how to fix that?

 

Thanks

 

Thanks for digging into this and sorry for my sluggish reply. 

 

Interesting problem... if you delete the avatars folder in the extension directory and try again, does the same number of images show up again? It might be that something went wrong during extraction. The most general tip is to wrap

 
    with contextlib.closing(sqlite3.connect(path).cursor()) as db:
        for av in db.execute("SELECT skypename,avatar_image FROM Contacts WHERE type=1 AND is_permanent=1 UNION"\
                             " SELECT skypename,avatar_image from Accounts"):
            if av[1] is not None:
                with open("avatars/"+av[0]+".jpeg","wr") as f:
                    f.write(str(av[1])[1:]) #For some reason, the first byte is 0, then the jpg starts.
                bg = Image.open("avatars/"+av[0]+".jpeg").resize((96,96),Image.ANTIALIAS)
                bg.save("avatars/"+av[0]+".jpeg")
                for v in vers:
                    bg = Image.open("avatars/"+av[0]+".jpeg")
                    #bg.thumbnail((96,96),Image.ANTIALIAS)
                    fg = Image.open("images/status_"+v+".png")
                    bg.paste(fg, (0, 0), fg)
                    bg.save("avatars/"+av[0]+"_"+v+".jpeg")

with try, except:

 

 

 

with contextlib.closing(sqlite3.connect(path).cursor()) as db:
        for av in db.execute("SELECT skypename,avatar_image FROM Contacts WHERE type=1 AND is_permanent=1 UNION"\
                             " SELECT skypename,avatar_image from Accounts"):
            try:
                if av[1] is not None:
                    with open("avatars/"+av[0]+".jpeg","wr") as f:
                        f.write(str(av[1])[1:]) #For some reason, the first byte is 0, then the jpg starts.
                    bg = Image.open("avatars/"+av[0]+".jpeg").resize((96,96),Image.ANTIALIAS)
                    bg.save("avatars/"+av[0]+".jpeg")
                    for v in vers:
                        bg = Image.open("avatars/"+av[0]+".jpeg")
                        #bg.thumbnail((96,96),Image.ANTIALIAS)
                        fg = Image.open("images/status_"+v+".png")
                        bg.paste(fg, (0, 0), fg)
                        bg.save("avatars/"+av[0]+"_"+v+".jpeg")
            except IOError:
                pass
 

 

Edited by xtin
Link to comment

Thanks for digging into this and sorry for my sluggish reply. 

 

Interesting problem... if you delete the avatars folder in the extension directory and try again, does the same number of images show up again? It might be that something went wrong during extraction. The most general tip is to wrap

with contextlib.closing(sqlite3.connect(path).cursor()) as db:
        for av in db.execute("SELECT skypename,avatar_image FROM Contacts WHERE type=1 AND is_permanent=1 UNION"\
                             " SELECT skypename,avatar_image from Accounts"):
            try:
                if av[1] is not None:
                    with open("avatars/"+av[0]+".jpeg","wr") as f:
                        f.write(str(av[1])[1:]) #For some reason, the first byte is 0, then the jpg starts.
                    bg = Image.open("avatars/"+av[0]+".jpeg").resize((96,96),Image.ANTIALIAS)
                    bg.save("avatars/"+av[0]+".jpeg")
                    for v in vers:
                        bg = Image.open("avatars/"+av[0]+".jpeg")
                        #bg.thumbnail((96,96),Image.ANTIALIAS)
                        fg = Image.open("images/status_"+v+".png")
                        bg.paste(fg, (0, 0), fg)
                        bg.save("avatars/"+av[0]+"_"+v+".jpeg")
            except IOError:
                pass
 

 

 

Thanks that worked!

Link to comment
  • 1 month later...
  • 3 months later...
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...