Jump to content

Ian Robert Douglas

Member
  • Content Count

    5
  • Joined

  • Last visited

  1. Very nice. Could this be forked to toggle Reduce Transparency? There's a bug in Mojave that messes with VLC and some other media players, making them unusable unless Reduce Transparency is unchecked. So if I want to play a video with VLC, I have to go first to System Preferences / Accessibility / Display and uncheck "Reduce transparency". It would be great to have a toggle workflow for Alfred for this. I tried amending your code with "reduceTransparency" instead of grayscale, but that isn't working.
  2. As a separate issue, when using this code: source /Users/Decline/.zshrc cd /Users/Decline/SERVER/ && wp-clone "${source_dir}" "${destination_dir}" everything works except one thing. wp-clone should be generating OpenSSL Certificates for the cloned site, but it doesn't. It does in iTerm.app. I see this in the debug window of the Alfred Workflows interface: sudo: no tty present and no askpass program specified sudo: no tty present and no askpass program specified It's referenced twice, I think, because the last two commands of the script are valet commands, each of which in iTerm.app asks for your user password. The first, "valet secure", generates OpenSSL Certificates for the newly created site, for use with https. The second, "valet open", opens the new site in the default web browser. A little unnecessary to ask the user password for either operation, and I will look into that and see if that can be disabled or pre-authorised somewhere, but in the meantime, is there anything I can add to the workflow script that would authorise everything, so that part of the script didn't fail?
  3. @vitor Thank you for your kind words. The modified workflow is perfect! Thank you so very much! It's exactly what I needed. @deanishe Thank you for the reply. The "wp-clone" script I'm using includes commands for Valet+, a fork of Valet for Laravel. It also includes commands for other parts of my usual CLI environment, including mysql. I don't really understand the hierarchy involved, and how to get Alfred's CLI to digest and understand the script to include its parameters if the full path to the script is referenced, instead of PATH. The wp-clone script is in my PATH, so when I run that script in iTerm.app, valet commands, for example, are already pre-loaded or accessible. But running the same script under Alfred's CLI, and only referencing the full path to the script, would that not leave Alfred's CLI unable to understand valet commands? In fact, I'm not even sure how to reference the full path to the script alone. Yep, I'm that ignorant! Right now, in the workflow, I'm using: source /Users/Decline/.zshrc cd /Users/Decline/SERVER/ && wp-clone "${source_dir}" "${destination_dir}" But as you said, I think, on another thread I was reading, this is not exactly efficient, as it is including all parts of my PATH for Alfred to digest, slowing the process down from an optimal speed. The workflow does work, nonetheless. I tried this: source /Users/Decline/local/bin/wp-clone/wp-clone cd /Users/Decline/SERVER/ && wp-clone "${source_dir}" "${destination_dir}" Not sure if that is correct or not, in terms of the first line. It errors out with the following: [16:53:09.566] ERROR: Valet Clone - COPY[Run Script] usage: mkdir [-pv] [-m mode] directory ... usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory /Users/Decline/local/bin/wp-clone/wp-clone:14: command not found: wp sed: wp-config.php: No such file or directory /Users/Decline/local/bin/wp-clone/wp-clone:25: command not found: wp /Users/Decline/local/bin/wp-clone/wp-clone:28: command not found: wp rm: /Users/Decline/SERVER//.sql: No such file or directory /Users/Decline/local/bin/wp-clone/wp-clone:34: command not found: wp /Users/Decline/local/bin/wp-clone/wp-clone:37: command not found: valet /Users/Decline/local/bin/wp-clone/wp-clone:40: command not found: valet /Users/Decline/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/DEF04494-FD56-4A95-B679-46FDE3659389:3: command not found: wp-clone
  4. First, I really apologise for how incompetent I am. Without Google, I'd never be able to do anything. But even with Google, I fail. Basic principles, var, query, just fly right over my head. Doesn't matter how much I concentrate, and how much I read, I just never seem to get it I'm trying to construct an Alfred workflow to do the following: I want to create a command consisting of three elements: 1. wp-clone 2. site1 3. site2 #1 is constant. #2 and #3 are variables. They are basically source-folder, destination-folder. The names would change in real use. I'm just using "site1" and "site2" here to illustrate. The final command, which I'd like to pass to iTerm.app, would look like this: wp-clone site1 site2 So what would be ideal is if I can: 1. Pull up the Alfred window (option-space) and start typing "Valet Clone". Press return and it auto-completes (like a keyword would) 2. On return a space inserts and I enter the first argument, where I input "site1" (without quotes: it's basically a directory name) 3. Return again and I get to insert another input, "site2" (again, without quotes: the second directory) 4. Return again and these two variables or arguments are put together and formed as the command: wp-clone site1 site2 It would be great, at that point, if I can run this in the background. Something like: export PATH=/usr/local/bin:$PATH cd /Users/Decline/SERVER/ && wp-clone {query1} {query2} (I would need PATH included as "wp-clone" is a command Alfred's command line wouldn't recognise.) However, I don't mind if the next stage is simply to open iTerm.app and paste the combined command there. The big problem I have is knowing how on earth to get those two variables (site1 and site1) into a single command, and in an elegant way in Alfred's GUI. I just can't wrap my head around it Attached is an attempt, which doesn't work at all, to hack something together in a workflow. Can someone point me in the right direction? Please, any input, imagine you're speaking to a small child, or a Golden Retriever. Many thanks in advance, ian My lame attempt (junk, doesn't work): Valet Clone Alfred Workflow
×
×
  • Create New...