Daniele Posted June 13, 2020 Share Posted June 13, 2020 Hello mates, recently I would like to create a new workflow with these features: ->type keyword X Y (X Y are numbers) ->select a random image from a specific folder ->show the image for X second then move to the next (always random) -> next to Y images until -> exit What would be a simple way do to that? Thank you very much Link to comment
deanishe Posted June 13, 2020 Share Posted June 13, 2020 It's fairly simple to do with a few lines of code. 7 minutes ago, Daniele said: show the image for X second then move to the next (always random) How do you want to show the image? Open it in Preview? 8 minutes ago, Daniele said: next to Y images until What does that mean? You want to show a total of Y images? Link to comment
Daniele Posted June 13, 2020 Author Share Posted June 13, 2020 (edited) wow. So simple? Example: keyword 30 5 this show 5 random images from a specific directory for 30 second each one in preview Edited June 13, 2020 by Daniele Link to comment
deanishe Posted June 13, 2020 Share Posted June 13, 2020 Here’s a simple workflow to open random images in Preview. Here are the usage instructions, and they’re also in the workflow. Link to comment
Daniele Posted June 13, 2020 Author Share Posted June 13, 2020 (edited) WOWOWWOWOWOW DEAN! You're so great! Thank you very much mate, much appreciated 🙂 May I ask you something to add???? -Can I choose different directory based on a List Filter choice in Alfred? (I assume to have 4 different directory with different images) Example (models, heads, hands, other) -Can you show the image in full screen mode?? -Optional: because I don't have any signal, may you play a sound in the half of time and another one just before the end for every image shown? I hope this don't bother you. Thank you anyway 🙂 Edited June 13, 2020 by Daniele Link to comment
deanishe Posted June 13, 2020 Share Posted June 13, 2020 I've added the sound and fullscreen because they require a bit of AppleScript. You can add the List Filter yourself. You just need to insert it in front of the Script Filter with an Arg and Vars utility to set the variable IMAGE_DIR to the directory it should look in for images. Link to comment
Daniele Posted June 13, 2020 Author Share Posted June 13, 2020 Great! Works perfecly. I added my Script Filter and it is awesome. The only thing, I don't know why but it seems the last image doesn't play sound (only the last one) and also stay opened (It should be closed after the time is expired) Anyway this is great . really Thank you you're so kind and gentle Link to comment
Daniele Posted June 13, 2020 Author Share Posted June 13, 2020 Solved the final image about sound playing (thank you for your comment inside the code), but how to close all the image at the end?? Link to comment
Daniele Posted June 13, 2020 Author Share Posted June 13, 2020 Final thing: ALL SOLVED. Simply I put a simple script at the end " tell application "Preview" to quit It works perfectly. Thank you dude. 🙂 Link to comment
deanishe Posted June 13, 2020 Share Posted June 13, 2020 (edited) 1 hour ago, Daniele said: The only thing, I don't know why but it seems the last image doesn't play sound (only the last one) and also stay opened (It should be closed after the time is expired) Because you didn't say it should close, and there's no point implementing the timer on the last image if it isn't going to do anything when the timer expires. Open the workflow and remove lines 189–191 from the random-images.py file if you want the timer and sounds active for the final image, too. Edited June 13, 2020 by deanishe Link to comment
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