Jump to content

shmulvad

Member
  • Posts

    21
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by shmulvad

  1. @PHlllPP You can change the renaming logic in the file tiny_upload.py in the function get_new_and_bak_file() to suit your needs. But your changes will be overwritten when the workflow is updated next time so it is not recommended.

  2. @PHlllPP You need to edit the workflow variables. Click the button that looks like [x].

     

    As for your other question, I don’t really see that the benefit in allowing multiple ways of handling renaming originals would outweight the additional mental burden. I would need some convincing arguments to do this.

  3. Thanks for making me aware of the unbundled library. Good to hear you got it solved for now, but as deanishe says the proper solution is for it to be bundled.

    I am busy with exams at the moment but will try to release a new version where this is fixed soon. I will probably look into your other suggestion as well, but no promises on when.

  4. Just now, deanishe said:

     

    Out of interest, why have you written the workflow to use a custom Anaconda installation instead of one of the system Pythons that everybody has?

     

    It is just the installation I use per default on my personal system if I do not set up a new separate environment for a Python project. I wrote the workflow because I personally had a use case for it and afterward thought I might as well release it publicly now that the workflow existed anyway. When I tried using just "python" from within Alfred to call it, it didn't work on my system (even though "python --version" gives me 3.8.5 in a regular terminal session, even when no conda env is activated). It could be fixed by using the absolute path, so I just did that. I can see it also works (on my system at least) when using "python3" which I agree would have been a better choice as the default.

  5. On 1/8/2021 at 12:20 AM, DaniTz said:

    doesn't work for me. I've tried for at least an hour, ending up installing different versions of python 3 on a new M1 mac mini. I really wish for it to work but it doesn't. First notification is a starting the compression/resizing then another one with Status which is blank and nothing happens. I would appreciate some help

     

    Thanks,

    Dan

     

    Hi Dan. Sorry, but I do not have a M1 machine to test on. I am not sure what causes the issue based on your information, but since at least some of the workflow works based on your information, I think it is not a problem with your Python version and something else is causing it. Can you check the log using the Workflow Debugger and report back on what you see?

  6. I've added the code to remove the quarantine flag as suggested by @vitor. However, before I did this, I didn't seem to get the warning myself when I deleted the binary and then added it as a new freshly downloaded one. So I'm not sure whether or not this fixes it.

  7. Nice to hear that you like it, DanP!

     

    I don't know how to not have that message show up. If someone more experienced in macOS development here on the forum can me tell how to accomplish it (without having to buy an Apple Developer account), I'll be happy to implement it.

  8. 1 minute ago, mixterdee said:

    I've used the old workflow for years and as you mentioned it hasn't been updated so thought I'd give yours a try. Unfortunately I can't enter my API key. Once I click on Enter/Change API Key it switches to the default search. Can you suggest what could be causing the issue?

     

    Sorry about that. This workflow uses Python 3. Does it work if you do "which python3" in your Terminal and set that as the path for the variable "pythonPath" in the workflow?

  9. An Alfred 4 workflow for quickly compressing and resizing images using TinyPNG. Simply select a collection of images or a folder in Finder and activate the workflow.

    compressing.gif?raw=true

    Installation and Getting Started

    1. Install alfred-tinypng workflow.
    2. All further updates are handled automatically.

    You will need to configure the workflow with an API key from TinyPNG. Type tinypng_api to get a link to the pagewhere you can get your API key and to actually set the key when you have gotten it.

    tinypng_api.png?raw=true

    Usage

    Select either a folder, image file or a number of image files in Finder. Afterward, open Alfred and type tinypng. You are presented with the following choices:

    tinypng.png?raw=true

    Choose an item based on what you want. When selected, the workflow will start compressing/resizing the image(s). After it is done, they will be saved to the same directory and with the same filename as the original image. The original image will be preserved with .bak prepended before the file extension. I.e. if compressing img.jpg, this will now become img.bak.jpg and the compressed image will be saved as img.jpg.

    Refer to the TinyPNG documentation for a full explanation of the different resizing options.

    Why? Another TinyPNG workflow already exists

    • It doesn't support choosing the files based on what is selected in Finder (which I personally prefer).
    • Only simple compression is supported whereas all TinyPNG compressions and resizing options are supported in this workflow.
    • It seems to be abandoned by the creator (has not been updated since 2015).

    Credits

    The workflow makes use of the following:

     

    Code and more can be viewed on the associated GitHub-repo. If you find this workflow useful, stars are appreciated.

  10. NightShift

    Quickly turn on/off Night Shift or set it to a custom value between 0 - 100.

     

    Installation

    1. To download, visit the latest release at GitHub.
    2. All further updates are handled automatically.

     

    Description

    Quickly turn on/off Night Shift or set it to a value between 0-100. No more fiddling with deep settings when you either want to save your eyes or need to work with accurate colors!

    In Alfred, type night followed by either off, on or a number between 0 - 100.

    edfepA0.png

     

    Credits

    The workflow makes use of the following:

    1. nshift by leberwurstsaft as the backend for setting the values.
    2. OneUpdater by vitorgalvao for handling automatic updates.
  11. 1 hour ago, deanishe said:

     

    FYI, XML feedback has been deprecated for quite some time now. You should generally use JSON in new workflows. Not least because it's easy to do without needing any libraries.

     

    Okay, I didn't know that - thanks for letting me know! :)

    The workflow is now updated to use JSON. I'll agree with you, that is much cleaner.

  12. Roman Numeral Converter

    Convert between roman numerals and arabic integers

     

    Installation

    1. To download, visit the latest release at GitHub.
    2. All further updates are handled automatically.

     

    Description

    This is a fairly simple workflow for converting between roman numerals and arabic integers. This has been made before by Tyler Eich (Packal link), but hasn't been updated since 2015 and stopped working on my computer during an Alfred or macOS update (can't remember which). But I had an use case for this, and therefore I made a new version written in Python for this simple task.

     

    In Alfred, type rn and enter either your roman numeral or arabic integer. Selected result is copied to your clipboard. 

    arabic_to_roman.png

    roman_to_arabic.png

     

     

    The expression is being evaluated as you type it. If the expression cannot be evaluated, for example if you are using illegal characters, user will be notified about that. 

    gibberish.png

     

    Note

    The workflow doesn't support incorrectly written roman numerals, i.e. "IC", and will also notify user about this:

    invalid_roman.png

     

    Credits

    The workflow makes use of the following code to focus on the implementation of the conversion between the number systems rather than focusing on a lot of Alfred Workflow related stuff.

    1. OneUpdater to easily check for updates by vitorgalvao.
    2. Alfred Workflow Feedback XML Generation to easily add items by lrrfantasy.

     

     

  13. 1 hour ago, vitor said:

     

    What does that exactly mean? You’ll need to provide further details for me to be able to help. Does it only work sometimes? Does it never work? Does it do something different than expected?

    • Open the debugger, set the log output to “All Information”, do the action and post the output.

    • What’s your exact Alfred version?

    •  

      What’s your exact macOS version?

     

    After first reinstalling the workflow and then restarting my Mac it now works again. I am (and was) using macOS 10.14.1 and Alfred v. 3.7.

    Sorry for not trying this out before commenting.

  14. I really wanted the feature I describe above, so I went ahead and modified the code to achieve this behaviour. I don't have any experience with Perl, so I guess the stuff I have rewritten is pretty poorly written code, but for now it works. This is what is now shown when the workflow is called with an expression that can be evaluated:

    RMgMDW7.png

     

    And this is what it looks like when you insert an expression that can't be evaluated:

    VcHG7dL.png

     

    I have forked the original repo and made a pull request. For now, the modified workflow can be downloaded from here,

  15. I really find this workflow useful and have been using it a lot.

     

    Would it be possible to add to it, so that instead of having to press a modifier key to copy different results other than binary and then view them, the result in both decimal, hex, binary and octal is immediately printed to the screen as four separate items in Alfred? And then copying a result is just done by selecting the corresponding item?

  16. Hey

     

    I'm trying to make an AppleScript to be run from Alfred, that should quickly set a specified speaker as audio output device if it is currently connected (in example below "My Awesome Speaker"), and otherwise don't do anything. I have gotten most of the functionality down (toggling between speaker/internal speaker), but I'm having a problem in the instance that the speaker isn't connected.

     

    When this is the case, the script has already clicked on the audioMenu, making the dropdown be there until a mouse click. I thought I could make it go away by branching with an "if else" and then if the speaker isn't connected, then just clicking the audioMenu again (because I've seen similar behaviour (with succes) for other menu bar scripts). But if I instead do this, the audio dropdown will still be staying until a click has been made, and then the script clicks the audio icon again making it doubly annoying.

     

     

    on alfred_script(q)
    
    set speakerName to "My Awesome Speaker"
    set internalSpeakers to "Internal Speakers"
    
    activate application "SystemUIServer"
    tell application "System Events"
    	tell process "SystemUIServer"
    		-- Working CONNECT Script.  Goes through the following:
    		-- Clicks on Audio Menu (OSX Top Menu Bar)
    		-- Clicks your speaker if not connected
    		-- Else if connected, then disconnects by clicking Internal Speakers
    		set audioMenu to menu bar item 4 of menu bar 1
    		tell audioMenu
    			click
    			if exists menu item speakerName of menu 1 then
    				set speakerMenuItem to menu item speakerName of menu 1
    				if value of attribute "AXMenuItemMarkChar" of speakerMenuItem is "✓" then
    					click menu item internalSpeakers of menu 1
    					return "Disconnecting from " & speakerName & "..."
    				else
    					click speakerMenuItem
    					return "Connecting to " & speakerName & "..."
    				end if
    			else
    				-- Doesn't work for now. Just clicks it again after you deselect menu, making it double annoying
    				--click audioMenu
    				return "Doesn't look like you're connected to " & speakerName & "..."
    			end if
    		end tell
    	end tell
    end tell
    end alfred_script

    How can I fix this, so the dropdown actually goes away if speaker is not connected?

     

×
×
  • Create New...