sepulchra Posted December 8, 2024 Posted December 8, 2024 I only know bits of code from participating in this forum and brute force trying to learn things. I’m hoping that I can turn this request for help into a learning experience. I use chronosync for my regular backups and I would like to trigger some of them through alfred. Chronosync can be scripted via applescript and what I would like to do is have my workflow return a list of my chronosync documents (they live in a specific directory), select one and have that document be passed as a argument/variable so it can be run in a applescript that runs the backup. I know that running 'ls' on the directory where my sync documents are stored will return a list of those files, but this is where my knowledge stops but i would imagine this workflow could run in script filter to do the following: - return list of chronosync documents - document is chosen from list - that document is passed as argument to chronosync applescript I imagine some my answers lie here and this moom workflow I use regularly appears to do something similar except the moom snapshots are returned via applescript instead of pulling files from a directory. I would be appreciative of something that might get me started... maybe another workflow in the gallery that does something similar so I can try and learn what it is doing? I'm a total novice. And if anyone is wondering I'm totally using this as a form of procrastination as I should be doing something else with this time.
Stephen_C Posted December 8, 2024 Posted December 8, 2024 I'm not sure if it will help but you could take a look at my Search files by extension workflow—which contains a script filter that returns files from a folder and then passes on the selected file for action. Stephen sepulchra 1
vitor Posted December 8, 2024 Posted December 8, 2024 The workflow @Stephen_C listed is probably closer to what you want, but still it occurred to me a way to do something similar without code. You could use the Folder Contents Automation Task, which is better than ls because the former gives all contents as individual arguments while the latter gives you a long string of one argument you’d need to split. Then connect it directly to the Grid View et voilà, instant listing of the entries. sepulchra 1
Stephen_C Posted December 8, 2024 Posted December 8, 2024 6 minutes ago, vitor said: You could use the Folder Contents Automation Task, which is better than ls because the former gives all contents as individual arguments while the latter gives you a long string of one argument you’d need to split. Then connect it directly to the Grid View et voilà, instant listing of the entries. That, of course, is very neat. 😀 There's always a better way and you always know it! Stephen
sepulchra Posted December 8, 2024 Author Posted December 8, 2024 Thank you both. This is incredibly helpful for me to get started!
vitor Posted December 9, 2024 Posted December 9, 2024 It just occurred to me you could also try a File Filter, scoped to the projects directory and their specific file type.
sepulchra Posted December 9, 2024 Author Posted December 9, 2024 Currently I have a list filter that passes the argument to my applescript which does the trick but procrastination on other projects seemed to be the ideal time to try and lose half a day trying to learn something new. I would like to learn some JSON/script filter stuff so I can be a little fancier....
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