Jump to content

vdesabou

Member
  • Posts

    466
  • Joined

  • Last visited

  • Days Won

    22

Posts posted by vdesabou

  1. alfred-mountain-lion-builtin-sharing

    ==========================

    Use built-in sharing introduced in Mac OS X 10.8 Mountain Lion directly from Alfred!

    Description

    This workflow is using the amazing command line terminal-share

    You can call directly share command (or use a hotkey) if you just want to share a message.

    If you want to share a file (image, video or any other kind), you can select it using a File Action, or set a hotkey.

    It currently supports all services except sinaweibo,youku and tudou (I can add them in a future release).

    Based on the type of the selected file, services proposed will change.

    Here are some examples:

    Screenshots

    4tab60.png

    Download the workflow

    Download the workflow below and open in Alfred.

    Download Workflow

    History

    1.11:

    1.10:
    • fix AllayOop version
    1.9:
    • Added hotkeys to call built-in facebook, twitter, imessage and email
    i0SR+.png

    1.8:

    • Fix problem introduced in version 1.7 with files names with spaces
    1.7:
    • Fixed a bug where image was not displayed in the sharing window
    1.6:
    • Start Droplr if needed before trying to upload
    1.5:
    • Added support of droplr (using cmd modifier). It will upload selected file to Droplr, and then paste at the end of the message the url. It only works with facebook, twitter, imessage and email (other services don't use message).
    1.4:
    • Improve handling of special characters
    1.3:
    • The terminal-share is now included is the workflow
    • Twitter issue is fixed
    • Minor fixes
    1.2:
    • Added abilitity to cancel file sharing by selecting the Selected file entry
    1.1:
    • Support of Alleyoop
    1.0:
    • Initial Version
    Credits
  2. You can get hot key information from plist variable in main.py  

     

    For example,  Cntl-Command-E is represented as  '{'type': 'alfred.workflow.trigger.hotkey', 'config': {'leftcursor': False, 'argument': 0, 'hotkey': 14, 'action': 0, 'hotstring': 'E', 'hotmod': 1310720, 'modsmode': 0}', but I don't know the whole information how to interpret.

     

    Indeed, that's tricky! But it seems Shawn Rice, the author of the help workflow was able to decrypt it, see http://www.alfredforum.com/topic/1653-workflows-help-workflow/

     

    That's just in case you wanted to add this, I personally don't use much hotkeys :-)

     

    Thanks again for this great workflow

  3. 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 :-)

  4. 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)

  5. 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!

  6. That's awesome, I will use it very often!

     

    However, it is not working on my side. Trying to execute the python script on command line, I get:

     

    python main.py "test"
    Traceback (most recent call last):
      File "main.py", line 31, in <module>
        keyword = ",".join([o['config']['keyword'] for o in plist['objects'] if 'alfred.workflow.input' in o['type'] ])
    KeyError: 'keyword'
    

     

     

    Any idea how to fix this?

     

    Cheers

  7. Hi David,

     

    I believe this is because LANG was not set when invoking the script with Alfred.

     

    In terminal, If I do:

    $ echo $LANG
    fr_FR.UTF-8
    
    $ ksh repro.ksh
    tete
    
    $ unset LANG
    
    
    $ ksh repro.ksh
    sed: 1: "y/ÀÁÂÃÄÅÆÇÈÉ� ...": transform strings are not the same length
    
    

     

     

    So I added in the "repro2" repro.ksh script, export LANG='fr_FR.UTF-8' and now it works!

     

    Problem solved. Thanks  

  8. Yes, it seems related to sed indeed, but that's strange that it is only happening when using Alfred.

     

    I've simplified the code:

     

    Looks like using combination of y/"accented character" is causing the issue:

    mystring="Têté"
    mystring=$(echo "$mystring" | sed y/ê/e/)
    echo "$mystring"
    

     

    is not working

     

    If i do:

     

    mystring="Têté"
    mystring=$(echo "$mystring" | sed y/t/b/)
    echo "$mystring"
    

     

    or :

    mystring="Têté"
    mystring=$(echo "$mystring" | sed s/ê/e/)
    echo "$mystring" 

     

     

    It is working

     

    Weird...

     

    Thanks for your help, I'm getting crazy :-)

  9. Hi,

     

    I have a difference of behavior when I execute a ksh script in a "Run script" action in Alfred and in a terminal.

     

    The code is as following:

    SPEC_CHAR="ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ"
    NORM_CHAR="AAAAAAACEEEEIIIIDNOOOOOOUUUUYPSaaaaaaaceeeeiiiionoooooouuuuyby"
    
    mystring="têté"
    mystring=$(print $mystring | sed 'y/'${SPEC_CHAR}'/'${NORM_CHAR}'/')
    echo "$mystring" 

     

    When I execute in terminal, I have:

     

    /Users/vincent/Downloads>

     

    ksh repro.ksh
    tete
     
    But when I execute it in Alfred (see workflow with reproduction here http://d.pr/f/ShJl ), I get an empty string for $mystring
     
    Any idea what's wrong here?
     
    Mac OS 10.8.3
    Alfred: 2.0.2
    Reproducible: Yes
     

     

×
×
  • Create New...