Jump to content

Recommended Posts

Posted

I have ran into a gotcha using Alfred on multiple machines.
For demonstration, imagine a workflow with a filepath in the configuration:
on Machine A this path is /run/current-system/sw/bin/ffmpeg
on Machine B the path is /opt/homebrew/bin/ffmpeg
I would like to be able to tell Alfred "Hey, don't sync this config" or "Hey, don't sync this field", and then I could set these to be unique across different environments.

Posted

That could lead to some unexpected foot guns when sharing workflows. For your own workflows, it's best to be explicit in the code. You can e.g. check the name of the current user (${USER}) or the Mac’s name (/usr/sbin/scutil --get LocalHostName) then branch accordingly.

Posted (edited)

For anyone who comes across this in the future, I solved this within my workflow like so:

  1. Script Action gets the current Mac's computer name: echo -n $(scutil --get ComputerName).  
  2. Conditional Utility checks the result and branches into…
  3. Arg and Vars Utilities for each machine, which override the existing variables set in the workflow configuration panel.

SCR-20241113-uipl-2.thumb.png.03ea1a0d72766060d5c7a0996aed7fee.png

Edited by Floating.Point

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...