Jump to content

Jono

Member
  • Posts

    178
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Jono

  1. 7 hours ago, Vero said:

    @Jono Under Appearance > Options, you can decide when the subtext should appear. If you don't want the subtext, you can remove it (though I'm not sure I'd recommend it as, when searching for folders or files, it gives valuable context)

     

    Thanks, I realise that.

     

    I currently have it set to only show subtext for the selected result. I find it useful for folders as I sometimes have folders named exactly the same (or very similar), but as I said previously I don't really need to see the full path to apps, or their extension 🙂

  2. Quote
    On 2/18/2021 at 12:16 AM, deanishe said:

    Nope, afraid not. But I'm trying to persuade @Andrew to add support for showing custom file icons instead of the filetype icons, which would open the door to exporting your bookmarks as .webloc or .url files with whatever icons you like.


    Actually, it would be great if there was just an option to show the bookmark icon of your default browser, like it does in Spotlight 🙂

     

  3. 19 hours ago, deanishe said:

     

    Totally broken, or just a bit? (Not that I plan on resurrecting the workflow unless Apple uncripples Safari's extension APIs.)

     

    No, not totally broken. It works but even though I replaced the icons it still showed the old ones. I guess I need to dig a little deeper to make sure I 'got 'em all'!

     

     

    19 hours ago, deanishe said:

    Nope, afraid not. But I'm trying to persuade @Andrew to add support for showing custom file icons instead of the filetype icons, which would open the door to exporting your bookmarks as .webloc or .url files with whatever icons you like.


    That would be SOOoo much better! Pretty please @Andrew! 😃 

  4. I'm wondering if what I'm wanting to achieve is possible 🤔

     

    Here's my current theme

     

    332722785_themealfred2.jpg.33cbbe6539cd626441f5cd752b769942.jpg

     

     

    I was wanting to make the horizontal line at the top (just under the search field) a different opacity to all the others below it, and also full width like Spotlight.

     

    2003634690_themespotlight.jpg.3b9450b5b39eeb0317d0e0dbe55d1e0e.jpg

     

    Is that possible?

     

    …also, the background colour for the selected text seems pretty high at the top. Is there any way to reduce that? 🙂

  5. 3 hours ago, deanishe said:

     

    Those variables only exist in your script. Use echo to send text to a notification: echo "${fileName}"

     

    Ah, right. Where should 'echo "${fileName}"' go in the script? At the end after 'done'? And I should still add {query} in the notification?

     

    I've tried it in various places in the script, but it either shows the filename along with the full path of the input and output, or just shows the full path of the input and output (no filename on it's own) 😐

  6. 6 minutes ago, vitor said:
    
    for theFile in $@; do

    Make it

    
    for theFile in "$@"; do

    Or arguments may re-split on spaces. Even if Alfred takes that into account, it’s a good idea to do so anyway.

    
    outputFile=$"$HOME/Desktop/$fileName.jpg"

    What’s the first $ for? And use curly braces around variables; from all the places in the script, those are the most relevant.


    Also, I recommend you use the long form of flags in scripts (s → --setProperty), as you’ll understand them better later on.

    
    outputFile="${HOME}/Desktop/${fileName}.jpg"

    Finally, note that with the current implementation you may be overwriting files, which you likely want to avoid.

    
    for theFile in "${@}"; do
      fileName="$(basename "${theFile%.*}")"
      saveDir="${HOME}/Desktop"
    
      outputFile="$([[ -f "${saveDir}/${fileName}.jpg" ]] && echo "${saveDir}/${fileName}-${RANDOM}.jpg" || echo "${saveDir}/${fileName}.jpg")"
    
      sips --setProperty format jpeg --setProperty formatOptions 100 "${theFile}" --out "${outputFile}"
      open -a ImageOptim "${outputFile}"
    done

     

     

    That works, thanks a lot! 🙂

  7. Thanks, this works on images without a space in the filename, but not with spaces in the filename.

     

    Could that be something to do with the line above it?

     

    theFile="${1}"

     

    Also, I wanted to show the name of the image in a notification. I tried {query} but that shows the full path to the original image, and also tried ${fileName} (and variations of it) but that didn't work either. How would I do that?

  8. I don't know much at all about shell scripting, but I managed to cobble together a workflow that actually works.

    theFile="{query}"
    
    theImage=$(basename "${theFile}")
    fileName="${theImage%.*}"
    outputFile=$"$HOME/Desktop/$fileName.jpg"
    
    sips -s format jpeg -s formatOptions 100 "${theFile}" --out "${outputFile}"
    open -a ImageOptim "${outputFile}"

     

    I'm using it as a File Action, so select a PNG image, run the workflow and it converts it to JPG, then runs it though ImageOptim.

     

    This works when selecting single images. but doesn't work if I pass it multiple PNGs. In the File Action part of the workflow I checked 'Accept multiple files', so I'm guessing I need to alter the script to make it work? In the Run Script part of the workflow I tried it with 'running instances' set to Sequentially and then Concurrently, but that didn't make any difference.

     

    Also, I wanted to show the name of the image in a notification. I tried {query} but that shows the full path to the original image, and also tried ${fileName} (and variations of it) but that didn't work either.

     

    Any help would be appreciated 🙂

     

     

     

     

    Screenshot 2020-03-03 at 9.43.52 am.jpg

×
×
  • Create New...