Jump to content

Oli.

Member
  • Posts

    3
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Oli.'s Achievements

Helping Hand

Helping Hand (3/5)

0

Reputation

  1. Ah ok. So does that mean that that block doesn't actually do anything? Like the same thing would happen if you only wrapped it in - tell application "System Events"?
  2. Thank you for the info! Sending keystrokes like that does seem a little hacky and your browser metaphor is dead on. Maybe Warp will add support for this at some point. I'm not sure how it would be possible for the keystrokes to be sent to the wrong application when it's within the 'tell process "Warp"' block. I'm (obviously) not super familiar with AppleScript, so I'll just trust you on this one. For now this seems to be working and, given I'll only ever be using this for very simple commands, I'm not super worried. Thank you for this. I'm sure if I use Alfred for 10 years straight those 0.3 seconds saved will add up to the time I spent working on this.
  3. I hunted around for how to do this and the only thing I could find was how to do it with iTerm. There is some talk about how to do it with Warp but the consensus was that you just can't because Warp "has no AppleScript support". There is actually a way to do it. (Though this is a workaround because you can't use AppleScript to script Warp) I found this on GitHub; most of the code is unnecessary unless you want to customize tab and window behavior. Here's a simplified version I made. GitHub gist here. on alfred_script(q) tell application "System Events" tell application "Warp" to activate set numWin to count (windows of process "Warp") if numWin < 1 then keystroke "n" using command down delay 0.5 keystroke q keystroke return end tell end alfred_script About the delay... If Warp is already running, you don't need the delay. If it's not already running, the minimum delay for it to work is 0.3 (at least on my machine). I don't know how to check if an app is running using AppleScript, but if I did, I would add an if statement before the activation to set the delay only if the app isn't running yet. If anyone knows how to do that we can save 0.3 precious seconds.
×
×
  • Create New...