Jump to content

How do I change this AppleScript to actually get pretty/ useful suggestions in the input bar? (my first real workflow...)


Recommended Posts

Thanks for your help with this!!

 

When I type aa, I want to see:

  • Current session: [timeremaining which can be queried via AppleScript via tell application "Amphetamine" to set timeRemaining to session time remaining]
  • Keep awake for 1 hour
  • Keep awake for 3 hours

 

When I start typing the argument, I want to see:

  • Keep awake for [argument] hours

 

Instead, I'm seeing the following (and also that's my AppleScript in the same screenshot below).

 

How might I fix this?

 

image.png.03a9cf4af1e0c2046d141c970060ff47.png

Link to comment

Ah—sorry for the misunderstanding. You're talking about using a Script Filter Input and, although I've wrestled with them from time to time, I'm not sure my experience matches your requirements! 😀

 

Don't despair, someone with more knowledge than me will be along to assist, I'm sure.

 

Stephen

Link to comment

Having three lines is simple, you could have three Keyword Inputs all using the same keyword or one List Filter Input.

 

But since you want one result to be dynamic, what you indeed need is the Script Filter Input and return the required JSON. In your case you may even need only to care about returning the title.

 

Your first step should be replacing that AppleScript with the equivalent JavaScript for Automation, since AppleScript has poor support for outputting JSON.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...