Jump to content

mikejandreau

Member
  • Posts

    64
  • Joined

  • Last visited

Everything posted by mikejandreau

  1. While we're on it, I also need to grab the "Franz" value from a variable in this line, too: tell application "Franz" to activate With it being AppleScript, it needs to be in quotes, but I can't figure out how to grab the value there and have it be in quotes to appease the AppleScript.
  2. @Vero I can't share the whole Workflow, as it has some company proprietary info in it right now. But here's the "Run NSAppleScript" bit I'm working with, in its entirety: on alfred_script(q) tell application "Franz" to activate tell application "System Events" keystroke "/away " delay 2.5 key code 36 key code 36 delay 2.0 keystroke "/status " set the clipboard to {var:away} tell application "System Events" keystroke "v" using {command down} delay 2.5 key code 36 end tell key code 48 using {command down} end tell if application "Spotify" is running then tell application "Spotify" pause end tell end if end alfred_script Essentially, this bit of the workflow looks to see which Application is running (in my case, Franz), then sends some keystrokes to it to change the status. Then it goes on to pause Spotify. Until now, I'd hard coded the "var:away" bit, but I am rewriting to share with my colleagues and want people to be able to set their own messaging there. Hence the variable. (I have another part of the workflow where they setup all the variables, which is working fine). I suppose I could break this up and use the "Copy to Clipboard" Output in the workflow, but that could get messy with a bunch of different options I'm building in. But if it's the only way, I'm happy to give that a whirl.
  3. I'm building a workflow, and as part of it, I need to copy a variable to my clipboard using Applescript I'm using set the clipboard to {var:VARNAME} and also tried set the clipboard to "{var:VARNAME}" But neither has worked. Is it possible to grab the value of a varname and put it on my clipboard in this manner?
  4. That seems to have worked. The version in /Applications showed as damaged when I tried to overwrite it, which could explain why the update wasn't working. Once I deleted it and copied it over from the .dmg, all appears well again. Thanks Vitor!
  5. For the last few days, my main desktop won't seem to stay upgraded to 3.8. I get the alert there's an update, download it, run it, password input, then a second or two later it seems to want me to upgrade again. I grabbed a video of it happening, which you can see here: https://take.ms/YZn66 I've done this maybe 20 times in the last few days. My other two machines upgraded fine, so I'm sure it's something specific to this machine, I just don't know what to look for.
  6. Sorry, I missed the pinned topic there. Here's the workflow: https://www.dropbox.com/s/4wj5q271p7gw5f2/App Assessment.alfredworkflow?dl=0 The bit I'm having a problem with is between "emailaddress" and "ticketid". The version number of: Alfred 3.7.1 macOS 10.14.1 The version of any non-system language you're using (e.g. nodejs) - N/A The version of any non-system programs you're using (e.g. ffmpeg or youtube-dl) if they aren't bundled in your workflow N/A Any changes you've made to your macOS environment (e.g. via launchctl setenv) or the language you're using (e.g. via Python's usercustomize.py or sitecustomize.py files) -- None.
  7. Part of the workflow I'm building has two Script Filters back to back, which store info input by the user as part of the flow. The issue is that the {query} from the first is maintained in the input window of the second, meaning the user has to manually delete it before inputting their selection for the second Script Filter. Here's a video of it happening: http://take.ms/uwlBk How can I stop this from happening so the "Ticket ID" input isn't pre-filled with whatever was input in the first Script Filter?
  8. Awesome, thank you for going above and beyond! I'll also adapt this to validate other inputs I need to validate, too.
  9. To clarify, here's my section of the flow in question. I want to go from the Post Notification Action back to the Email Input, but I can't connect the two.
  10. Looks like that'll work. I've thrown a Script Filter in line after the ask for the email address with regex in it. I then fork for regex matches and regex doesn't match. The only issue I see is that I can't loop back from my Script Filter to the Input asking for the email. Ideally I'd like to do: Ask for Email → Regex (script filter) says it doesn't match → Show a Notification → Loop back to Ask for Email step. I don't seem to be able to connect my Regex failure Script Filter back to the input. Am I missing something there?
  11. If I'm using a basic keyword trigger, is there any method I can use to validate the input? For example, if I only want to allow numeric input, or if I want to validate email address formatting?
  12. I figured it out. I don't actually need the AppleScript to get the Variable, since I'm using that variable directly in scripts in the Workflow and not external scripts. Thanks for the help!
  13. Color me a noob, I'm just not getting it. I'm doing what I _think_ should be working, but it's not. Here's what I'm doing: app-trigger.png - this is what triggers when someone types "app" and inputs their app name, this should set the configuration value for APP_NAME to the {query} test.png is the mini separate trigger I wrote to test it. All it does it grab the value from the config and push it to a Notification get_app_name.png should grab the name from the config and set it as a variable notification_with_name.png should push a notification with the value the AppleScript grabbed and set as a variable. I'm clearly missing something, but don't know what. Thanks for your help (and patience!)
  14. So if I use: tell application "Alfred 3" to set configuration "APP_NAME" to value "{query}" As a Run Script (usr/bin/osascript (AS))action after my initial "app" trigger, that'll store my value as a configuration, right? How do I then grab it in something else such as a "Run Terminal Script" action?
  15. I'm building a workflow and could use some help with storing semi-permanent variables. For example, the majority of the workflow will be triggered by the word "app", which asks for a variable of the name of the app the person's working with. I want to store that in a variable that I can use in a different flow within the same workflow, using a different trigger. So my workflow would be: app {query} → do some stuff → ask a question → store that in a variable. Then, if someone uses input trigger "diagnose", I want to execute a script using the very first variable from the "app" trigger (which could have been an hour or days ago). If the user triggers the "app" again, I want the variable value to be overwritten. I'm -- right now -- using the Utility of "Args & Vars" which works if the variable is within the main flow, but not if I try to trigger any of my inputs that comes after the initial "app" trigger. I couldn't find a good doc on how to accomplish this (if it's possible). Can someone point me in the right direction?
  16. I must be stupid. It was stuck because iTunes was frozen. Seems to be fine once I rebooted. Phew.
  17. Hey guys, Part of one of my workflows, when triggered via a keyboard shortcut, pauses any audio/video that's playing and changes the volume on my computer. Here's the (basic) script: on alfred_script(q) --Check App Status, to only act on apps if running tell application "System Events" to set SkypeIsRunning to (count of (every process whose name is "Skype")) > 0 --iTunes if application "iTunes" is running then tell application "iTunes" pause end tell end if if application "Spotify" is running then tell application "Spotify" pause end tell end if if application "Plex Media Player" is running then activate application "Plex Media Player" tell application "System Events" key code 49 end tell end if set curVolume to get volume settings if output muted of curVolume is false then set volume with output muted else set volume without output muted end if end alfred_script It doesn't seem to work anymore in Mojave, likely due to permissions, though I went through the permissions doc (https://www.alfredapp.com/help/getting-started/macos-mojave/) and confirmed Alfred has the right permissions in Privacy for both Accessibility, Full Disk Access and Automation. But yet my script doesn't work. Anyone have any suggestions to try?
  18. I'm running in Terminal so that I can know if there's an error of some kind during any of the steps. Since we're connecting to a number of APIs, including S3 and our own, there's a possibility of some sort of error. I was given a set of instructions folks are using in Terminal and there's a ton of manual steps that they're doing. I was hoping to simplify it with a workflow. I don't know if I could script something to perform the same actions with a Run Script Action, but I'll take a look at those docs and give it a whirl.
  19. I'm looking to build a Workflow that effectively does a series of things in Terminal. My idea is to trigger the Script with a keyword which triggers action 1 in Terminal. Action 2 would run once Action 1 completes. I haven't been able to find any docs on whether or not that's possible. For example, let's say Action 1 is generating a .tar archive of everything in a directory and Action 2 is moving the .tar to a subdirectory (or something else). Can Alfred know when the first Action is done to kick off the second? (I know I can do the .tar generation and move in one command - that's not what I'm actually doing here, but is just an example of something that came to mind for having Alfred know the first thing's done before doing the second thing.) Hoping it's possible, but I don't think it is.
  20. What's even more weird; if I re-order them so the AppleScript runs first, it works flawlessly. Oh well, it works now with a little bit of re-ordering. Not sure why it didn't work the other way, but I'm happy it's working now!
  21. It works for me too, just not in conjunction with the other scripts. Alfred's completely ignoring that it exists, unless I have the keyboard shortcut execute it and only it.
  22. @deanishe That didn't work either. It's like the workflow completely ignores the script(s) after the Perl scripts complete. Even with the Run NSAppleScript code, if I run it directly from the keyboard shortcut, bypassing the Perl script(s), it works. So it's not a code issue, but something odd happening in the ordering of the workflow, I think. Any other suggestions?
  23. I’m building a workflow that effectively changes input/output on my computer and pauses iTunes/Radium. So when I get a call, I can hit a keyboard shortcut and change my input/output to my headset, then back to speakers when I’m done. That part’s working, but I’ve got a second action executing Applescript chained in that should be pausing iTunes or Radium if they’re running, which doesn’t seem to be working. If I assign a keyword or trigger directly to the AppleScript to pause the music, it works, but not when it’s chained after the Perl script to change input/output. I can’t seem to figure out why. I uploaded the .workflow here: http://take.ms/8UUpO if someone can take a look and let me know what I'm missing, I'd appreciate it.
  24. I've duplicated the Workflow as suggested and had changed one trigger to up and one to down, and that was working fine. Something changed and now when I do "up nest" and pick the upstairs Nest, it changes the downstairs workflow to control that Nest and vise versa, effectively making the duplication of the Workflow useless. Is this due to the API change on Nest's end as well? Thoughts on how I can fix this so each Workflow will control each separate Nest?
×
×
  • Create New...