Jump to content

Inconsistent behaviour with File Action Trigger


Recommended Posts

Hey everyone,

 

macOS: 13.4.1 (22F82)
Alfred: 5.1.1 [2138]

 

I noticed some inconsitent behaviour with the File Action Trigger and Univeral Action Trigger (limited to Files): If triggered via the Alfred File Search, the clipboard stays unchanged. If triggered via the Universal Action Hotkey, the file get's copied to clipboard. (The described behaviour occurs regardless of the settings in "Universal Actions" -> "Workflow Keyword Inputs" and "Workflow Script Filters".)

 

Steps to reproduce:

  1. Download this minimal test workflow: https://www.dropbox.com/scl/fi/fghkwc91zb2jdxvmxyz6m/test.alfredworkflow?dl=0&rlkey=bpkr2xx2cjxrmdmd0r4kjhct2 (Keyword is "test")
  2. Search a file with Alfred File Seach
  3. Execute the test workflow on it -> Clipboard stays unchanged
  4. Now highlight a file in Finder
  5. Hit your Universal Action Hotkey (default: option+Cmd+#)
  6. Execute the test workflow on it -> File gets copied to clipboard

 

This makes it hard to develop workflows that interact with files and rely on the latest clipboard entry. Especially for people who don't have clipboard history enabled.

 

An example:

I'm trying to develop a workflow that encrypts a file with age. After encrypting the file the auto-generated passphrase from age gets copied into clipboard. For decryption, the workflow tries to retrieve the passphrase from latest clipboard entry - which doesn't work if executed by highlighting a file in Finder and triggering via the Universal Action Hotkey.

 

Thanks in advance for any additional info or help.

 

Best,

Sam

Link to comment

With the “Arg and Vars” utility you could set an environment variable to the previous clipboard with {clipboard:1} and read the variable to decrypt. For that to work, the clipboard history most likely has to be enabled though.

Edited by zeitlings
Link to comment

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...