gordon192 Posted July 9 Share Posted July 9 I have a Shortcut that sets the creation and modification date of a file to an arbitrary value. If I use a File Action and connect it to Alfred 5's "Run Shortcut" action, it doesn't work. It appears to work and runs without error, but the original file is never modified. However, if instead of using Run Shortcut, I use a Run Script action and execute the following AppleScript, it works perfectly: on run argv set theQuery to item 1 of argv set filePath to POSIX file theQuery tell application "Shortcuts Events" to run shortcut "Set Creation and Modification Date" with input filePath end run The Shortcut: https://www.icloud.com/shortcuts/fa16fc79010246d39e5012d2ea19c2a5 I think I have an idea of what might be happening. If I use the "shortcuts" command line utility to run a shortcut and pass it a file, it appears that shortcuts doesn't actually act on the original file. Instead, it creates a copy of the file in a temporary directory and acts on that instead. This means that any action that attempts to modify the original file just ends up modifying the copy. By contrast, if I run a shortcut using "Shortcut Events" from AppleScript and pass it a file, it operates directly on the original file. I'm not sure what Alfred is doing internally, but the behavior I'm seeing makes me suspect that when you pass a file to Alfred, Shortcuts is executing against a copy of the file and not the original, which will break many workflows. Link to comment Share on other sites More sharing options...
Andrew Posted July 10 Share Posted July 10 @gordon192 thanks for highlighting this, I was noticing some oddities with using the shortcuts command line tool with Alfred. I'll look at switching over to using Shortcut Events Link to comment Share on other sites More sharing options...
Andrew Posted July 11 Share Posted July 11 @gordon192 could you update to b2050, this should now be fixed Link to comment Share on other sites More sharing options...
gordon192 Posted July 11 Author Share Posted July 11 That fixed it! Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now