Jump to content

Chris Messina

Member
  • Posts

    451
  • Joined

  • Last visited

  • Days Won

    28

Reputation Activity

  1. Like
    Chris Messina reacted to vitor in Using python3 in Run Script blocks?   
    That’s not an oddity of your system, it’s expected. It isn’t worth going into the Python 2/3 kerfuffle here but don’t expect that to ever be updated on macOS. Apple is actively removing scripting languages and no longer updates them.
     

    Because you’re using Python3 features. macOS has never shipped Python3, though it installs it with the developer tools.
     

    Yes, but you can’t paste the script into the box. There are a few ways to do it; one is to set it as /bin/bash then /full/path/to/python3 /path/to/your/script.
     
    Note that using Python3 currently makes your Workflow harder to share, which you may or not care about. There are plenty of Python3 Workflows shared on the forum (e.g. by @Acidham) so look at those for ideas.
  2. Thanks
    Chris Messina reacted to deanishe in Using python3 in Run Script blocks?   
    That’s easy enough to check, isn’t it? /usr/bin/python is always Python 2. Python 3 is /usr/bin/python3 (and part of the developer tools, as Vítor noted).
     
     
    The best thing to do with Python 3 is to use bash/zsh and set export PATH=/opt/homebrew/bin:/usr/local/bin:$PATH at the top of the script. Then call your workflow just using python3 (e.g. python3 myscript.py "$1" or with the shebang #!/usr/bin/env python3
     
    That way, the workflow should work with either Homebrew Python 3 or the one from Apple's developer tools.
     
    You shouldn't use Python 2, even though it is installed, because it's dead. It will never be updated again.
  3. Thanks
    Chris Messina reacted to mcskrzypczak in [2.2] Get App Icon   
    Introduction
    Have you ever needed that specific app icon to use in your review? Get App Icon workflow comes to help! Open up Alfred, type 'icon' and app's name. If it one installed in your macOS, you should find it in the list. Press Enter and the icon will await on your Desktop.
    What if that's the app for iPhone or iPad (or just app from Mac App Store)? Just use the 'online' option to search and download.
    Download
    from Packal → link direct download → link Screenshots
    http://i.imgur.com/QLa4WD5m.pnghttp://i.imgur.com/8MUWUrkm.pnghttp://i.imgur.com/JhJJfhJm.pnghttp://i.imgur.com/Muq658Jm.pnghttp://i.imgur.com/Xbowu4gm.png 
     
    How it works?
    To invoke Get App Icon workflow:
    use the icon keyword which will list all available in /Application folder apps; at top of results there is option to switch to online (App Store / Mac App Store) search that will search for typed app name; use File Action Extract app icon on chosen app on your Mac. The workflow behaves as follow:
    when used with local application it converts app’s icon in .icns format into .png using the biggest icon size (which is usually 1024 × 1024 or 512 × 512 px) and save it into Desktop folder; when used with online application it downloads its icon in .png format (please read Tips also for further information). Requirements
    installed Python version 3 installed Pillow library for Python 3  
    Changelist:
    2.2:
    added workflow's description country code and limit are set as Environment Variables, so there is no need to edit files, just change them in Workflow Environment Variables window bug fixes 2.1:
    bug fixes 2.0:
    action rewritten to use Python3 1.5:
    initial public release
  4. Thanks
    Chris Messina reacted to mcskrzypczak in [2.2] Get App Icon   
    I've finally updated the action (see the first post for download).
     
    The new version require python3 and Pillow installed.
  5. Thanks
    Chris Messina reacted to vitor in process screenshots w imageoptim   
    All you have to do is use the screencapture tool which ships with macOS to take the screenshot, then compress it. It’s done in three short lines in a Run Script Action with default options:
     
    readonly image="${HOME}/Desktop/$(date).png" screencapture "${image}" open -a 'ImageOptim' "${image}"  
    If you want the screen capture to be interactive, change the second line to screencapture -i "${image}". If you want more options, open a terminal and run man screencapture.

    This method will open ImageOptim’s GUI, though. I’ve opened a pull request with one of the Workflows you linked to add support for an External Trigger. Meaning that if they merge it (or just download this version which is ready), you can replace the third line from above with:
     
    osascript -e "tell application id \"com.runningwithcrayons.Alfred\" to run trigger \"optmize_image\" in workflow \"ws.willner.alfred.imageoptim\" with argument \"${image}\""  
    And it will do what you want.

    To trigger the code, use whatever you want. You’ll likely want a Hotkey Trigger. If you want to use the default screenshooting shortcuts, you’ll have to disable them from macOS in System Preferences → Keyboard → Shortcuts → Screenshots.
  6. Like
    Chris Messina got a reaction from null in process screenshots w imageoptim   
    Maybe @Mr Pennyworth could add this to his Cleanshot Workflow (if you're willing to try Cleanshot).
     
    Another way to solve for this is to attach a Folder Action (unrelated to Alfred) that runs an ImageOptim CLI script any time a new image is added to your Screenshots folder, which you can set by using this command:
     
    defaults write com.apple.screencapture location /path/;killall SystemUIServer
     
    This blog post about @vitor's TinyPNG Workflow may also be relevant.
  7. Like
    Chris Messina reacted to deanishe in Workflow Folders   
    Then create a category called "Pinned" and put the workflows in it.
     
    The whole "the Alfred team has very limited resources for implementing new features" message isn't really getting through to you, is it?
  8. Thanks
    Chris Messina reacted to Andrew in "Eject" commands missing   
    This is now in 4.6.2 b1276 pre-release. You may need to reset the eject exclusion list if you've already edited it.
  9. Thanks
    Chris Messina reacted to Andrew in Hotkey combination combos shouldn't be detected in disabled Workflows   
    The behaviour has now been rectified in the 4.6.2 b1276 pre-release, so you shouldn't see odd situations where you can't set a combo used in a disabled workflow.
  10. Like
    Chris Messina reacted to Andrew in "Eject" commands missing   
    I'm likely going to be moving to a different macOS framework for discovering and presenting ejectable drives in the future, however, I do agree that these backup volumes shouldn't be shown for now.
     
    Alfred uses NSString isLike: for this comparison, which allows NSPredicate style formatting (cut down REGEX). I could limit this catching the wrong items by using something a bit janky like this in the default ignore list:
     
    [0-9]*-[0-9]*-[0-9]*-*.backup  
  11. Thanks
    Chris Messina reacted to Andrew in Environmental variables as Titles aren't evaluated for filtering in List Filters   
    Thanks for spotting this Chris, taking a quick look at the code, I can see why this is happening. I'll look at fixing this for the next release  
     
    Cheers,
    Andrew
  12. Thanks
    Chris Messina reacted to deanishe in Creating nested navigation trees with List Filters   
    That’s what Script Filters are for. If you want to use a static JSON file, just use cat file.json as the Script.
     
     
    Seems likely. Perhaps a bug?
     
     
    Instead of having a "Clears value of {query} …" Arg & Vars on every branch out of the Conditional, you could put just one before it to clear arg and set a variable from {query}, then switch on the variable in the Conditional.
     
    More generally, moving more of the workflow into scripts. It's significantly easier to manage complexity in code. You could replace the Conditional and its List Filters with a single script. That really pays dividends when you decide you want to change something.
  13. Thanks
    Chris Messina reacted to vitor in Workflow libraries and helpers   
    Libraries and Frameworks

    Python 3: Alfred-Workflow, by Adam Hitchcock
    Python 3: Ualfred, by @chaojie
    Dart: Alfred Workflow, by Klemen Tusar
    Go: go-alfred by Jason Cheatham
    PHP: Alfred Workflows PHP Helper by @joetannenbaum

    Other Utilities

    Add auto-updating to your Workflow: OneUpdater, by @vitor
    iTerm2 intergration: Custom Alfred iTerm Scripts, by @vitor
     

    All the libraries on this list are (at the time of the last edit) up-to-date and their developers are either still supporting them or forum regulars. That means any problems you find and suggestions you have are likely to be addressed.

    If there’s any library you think belongs in (or should be removed from) this list, leave a reply below. I’ll evaluate it and then hide the comments (so the thread can be kept tidy).
     
  14. Like
    Chris Messina reacted to Neilio in "Eject" commands missing   
    @Chris Messina Thanks for posting this – I thought I was losing it a little when I couldn't get the eject command to appear. This seems like a small UX issue where the eject command is the only contextual System option – the Eject command should still show up in the results but there should be a "No [type of thing] connected" or something like that. Anyway, glad to know it was a simple fix.
  15. Like
    Chris Messina reacted to vitor in Shortcuts — Run installled macOS shortcuts   
    Usage

    Search all your shortcuts via the sc keyword or search by folder name with scd.


    ↩: Run the shortcut. ⌘↩: Run the shortcut with an argument. ⌥↩: Open the shortcut for editing.
    Use the Universal Action to run the shortcut on files or as another way to provide an argument.



    The list of shortcuts is cached for faster results. An immediate cache rebuild can be forced with ⌘⌥⌃↩.

    ⤓ Install on the Alfred Gallery | Source
     
     
  16. Like
    Chris Messina reacted to Andrew in How can I quickly find hotkey combination conflicts?   
    I've managed to reproduce it and can see what is happening under the hood, and can see why this has led to confusing behaviour.
     
    We have quite a high support load at the moment with people upgrading to Monterey, so I can't promise an imminent fix, but I'll try to get it sorted for the next pre-release.
  17. Like
    Chris Messina reacted to Andrew in Hotkey combination combos shouldn't be detected in disabled Workflows   
    I'm moving this to closed as this isn't a "conflict", it's just a highlight to show you that there is another workflow using that combo. This doesn't stop the hotkey from working, and seeing that the combo is shared with a disabled workflow is still useful as this notifies of any potential future "conflict".
     
    I've added more details in your other thread.
  18. Like
    Chris Messina reacted to Andrew in How can I quickly find hotkey combination conflicts?   
    There is no need to do lower level searching like this, simply right click on the hotkey object and it'll show you the shared hotkey combos:
     

     
    The feature to enable shared hotkey combinations was added in Alfred 4.1, and the orange highlight you're seeing isn't a conflict, it's just to make you aware that another hotkey shares the same combination. The hotkey will still work, and there is internal logic to ensure the correct one is "run". Here is an extract from the change log which explains shared hotkeys:
     
    Hotkey Trigger
    The same hotkey combination can now be shared across multiple triggers matching different conditions Added navigation to related hotkeys on the contextual popup menu for a hotkey trigger in the workflow editor Prioritisation of shared hotkey to run, with the following priority: In Focus match takes highest priority, e.g. Hotkey only when Safari in focus Not in Focus takes secondary priority, e.g. Hotkey only when Spotify not in focus Falls back to hotkey with no app specific focus configured Hints shown in orange if a shared hotkey combination is in use Hotkey Trigger object key combo background changes Subtext under the hotkey field updates with warning Show subtle grey background behind application icons on Hotkey Object in workflow editor where hotkey focus mode is set to "don't have focus" Copy and Paste of object (or object configuration) now also retains the hotkey combo Note that this will naturally create a conflict which you will have to manually resolve I see that you've raised a bug disagreeing with the fact that you shouldn't be notified when a hotkey in a disabled workflow shares the same combination. I left this orange highlight in by design, as a shared combo is still a shared combo whether the workflow. is disabled or not. It's still extremely valuable to see that a combo is used in another workflow, even if it's disabled. This avoids a situation later on when the workflow is re-enabled and the user has no idea the hotkey was previously set to a shared combo.
     
    Just to iterate, shared hotkey combos aren't conflicts, they were a specifically added feature, and extremely useful when paired with the Related Apps option of the hotkey. The orange is just to highlight that you're using the feature.
     
    Do you still feel like there is a bug?
     
    Cheers,
    Andrew
  19. Like
    Chris Messina got a reaction from deanishe in Hotkey combination combos shouldn't be detected in disabled Workflows   
    It turns out that you can have conflicting Hotkey Combos, even if a Workflow is disabled. 
     

     
    It seems like disabled Workflows shouldn't be considered when looking for conflicts. 
  20. Thanks
    Chris Messina reacted to deanishe in "Eject" commands missing   
    Oops. You have it set to "Removable Media". That doesn't include disks. You want one of the other options.
     
    Should have spotted that earlier. Sorry.
  21. Like
    Chris Messina reacted to Ted Curran in Update Alfred with an Alfred command?   
    One of the few things on my Mac that I can't do with Alfred commands is UPDATE ALFRED. Would be awesome if, when I saw the "update available" notification in my window, I could just type "Alfred > Update and Restart" or something. 
     
    Please make it so. 
  22. Like
    Chris Messina reacted to Beatrix Willius in More getting started with Alfred articles   
    I've written a couple more articles on how to get started with Alfred:
     
    How to do debugging in Alfred: http://www.mothsoftware.com/how-to-do-debugging-in-alfred
    Alfred: handling environment variables and parameters: http://www.mothsoftware.com/alfred-handling-environment-variables-and-parameters
    Make an Alfred workflow to save attachments from Mail into a folder: http://www.mothsoftware.com/save-your-attachments-with-an-alfred-workflow
     
     
  23. Like
    Chris Messina reacted to deanishe in How to create a TextBuddy Workflow?   
    It could create a workflow programmatically that contains a Universal Action for each of its transformations. That's how Dash's Alfred integration works. When you update your Dash configuration, it regenerates the workflow.
  24. Like
    Chris Messina reacted to vitor in MarkdownTransform — Convert Markdown to other formats   
    Update.

    Better handling of images when given as HTML tags rather than Markdown.

    To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.
  25. Like
    Chris Messina got a reaction from andy4222 in How to create a TextBuddy Workflow?   
    Like @andy4222, I'm a big fan of TextBuddy. I would like to be able to select some text, invoke Alfred's Universal Actions, then choose from the menu of available options supported by TextBuddy.
     
    More details: like many apps, TextBuddy has its own simply command palette: 

    I've been in touch w/ the developer and we're interested in hooking up Alfred Universal Actions to these actions (e.g. having TextBuddy do the processing, possibly headlessly). 
     
    @dfay's CaseConverter Workflow offers Text Actions:
     

    ...which implies that a TextBuddy Workflow would need to enumerate all of its Text Actions in order for Alfred to list them:
     

     
    — but I'm presuming that there might be a way for TextBuddy to generate a JSON List Filter or something like that would automate and keep-up-to-date that list of commands as they evolve in each app update.
     
    My question is really to support Tyler building a deeper integration with Alfred. Are there tips or best practices for app devs to advertise their services to Alfred's UA engine? 
     
    Thanks!
     
×
×
  • Create New...