Jump to content

69wpm

Member
  • Posts

    18
  • Joined

  • Last visited

Posts posted by 69wpm

  1. Every day I have to publish articles on the internet. That means, I also have to work with pictures, especially resizing, which gets annoying if it takes too much time. That's why I was looking for a simple way to resize, crop or pad an image with Alfred. This is the result:

     

    This workflow uses an AppleScript by Herman van Boeijen which I found here.

     

    You have 2 options to use this workflow:

     

    1. You use the command "imgedit" + the name of the image or

    2. You browse your files with Alfred, use the right arrow to show the available options and choose this workflow.

     

    Here some screenshots to demonstrate the workflow a bit better:

     

    z2BMIaV.jpg

     

    5cFyzVS.jpg

     

    jIvZYXE.jpg

     

    iyxVqDa.jpg

     

    2VLVIl9.jpg

     

    APLeZ2W.jpg

     

    Download the workflow here.

  2. Hmmm...I've tried this with several older versions of my settings file but I can't reproduce this error. Could you open up your settings file (at /Users/<you>/Library/Application Support/Alfred 2/Workflow Data/jc-weather/settings.json) and either post it or see if it looks like this? It's OK if you have additional settings, like key.fio, but you should have at least the ones below.

     

      {

        "key.wund": "<your key>",

        "service": "wund",

        "icons": "grzanka",

        "days": 3,

        "time_format": "%A, %B %d, %Y %I:%M%p",

        "version": 3,

        "location": {

          "latitude": 34.0522342,
          "timezone": "America/Los_Angeles",
          "longitude": -118.2436849,
          "name": "Los Angeles, California",

          "short_name": "Los Angeles"

        },

        "units": "si"

      }

    Weird, it looks like this:

     

    {
      "service": "wund", 
      "icons": "grzanka", 
      "key.fio": "88a6b92b8f6ecc59ccbbd8719f7e5f32", 
      "days": 5, 
      "time_format": "%a, %d %b %Y %H:%M", 
      "version": 2, 
      "location": {
        "latitude": 45.755539, 
        "timezone": "Europe/Bucharest", 
        "longitude": 21.237499, 
        "name": "Timisoara, Romania", 
        "short_name": "Timisoara"
      }, 
      "units": "si"
    }
    
  3. I put the test-image file in "Downloads", so there are no spaces in the path. Now, the updated workflow does output an image, but it's not resized. This is the image I used. Also jpg to png does still not work.

  4. Hello,

     

    I had this problem too so i tried adding a delay of 0.5 seconds into the script - it now opens sparrow first before searching.

     

    the script now reads...

     

     

    on alfred_script(q)
    delay 0.5
        tell application "Sparrow" to activate --- activates sparrow
        tell application "System Events"
            tell process "Sparrow" --- implying Sparrow is already activated
                key code 3 using {command down, option down} --- send cmd+alt+F to Sparrow invoking search
                keystroke q --- enter the query
            end tell
        end tell
    end alfred_script

    Cool, that works. Would be cool to extend the script to launch Sparrow first (if it's not already launched) and than execute the script. I am not big into programming, but it should be something like this:

     

    on alfred_script(q)
    tell application "System Events"
        set isSparrowRunning to (count of (every process whose name is "Sparrow")) > 0
    end tell
    if isSparrowRunning then
        tell application "Sparrow" to activate --- activates sparrow
        tell application "System Events"
            tell process "Sparrow" --- implying Sparrow is already activated
                key code 3 using {command down, option down} --- send cmd+alt+F to Sparrow invoking search
                keystroke q --- enter the query
            end tell
        end tell
    else
    	tell application "Sparrow " to launch
    	delay 0.5
        tell application "Sparrow" to activate --- activates sparrow
        tell application "System Events"
            tell process "Sparrow" --- implying Sparrow is already activated
                key code 3 using {command down, option down} --- send cmd+alt+F to Sparrow invoking search
                keystroke q --- enter the query
            end tell
        end tell
    end if
    end alfred_script
    

     

     

     

    It doesn't work as it should, launching Sparrow works, but when it's launched, the window focus and search does not work.  I guess we have to set some delays. Maybe somebody can help out.

×
×
  • Create New...