Jump to content

how to receive 2 keyword input?


Recommended Posts

I want to create reminders item. First keyword is name of  the list, and second keyword is an item name.

 

Something like this:

 
set selectedList to ""
tell application "Reminders"
    set selectedList to list "{first_input}"
    tell selectedList
        make new reminder with properties {name: {second_input}}
    end tell
end tell

How I do that?

 

Link to comment

 

I want to create reminders item. First keyword is name of  the list, and second keyword is an item name.

 

Something like this:

 
set selectedList to ""
tell application "Reminders"
    set selectedList to list "{first_input}"
    tell selectedList
        make new reminder with properties {name: {second_input}}
    end tell
end tell

How I do that?

 

 

 

 

The link mentioned above is a good place to start. If the first field will always only be a single word though, you could just parse the input message to remove the first word and proceed with the rest as the second.

Link to comment

Thank you for the direction guys.

 

So, the conclusion are:

- Alfred does't have native chaining support yet.

- But we can manipulate string as needed

 

Correct?

 

Anyway, this what I came up with

set input to "{query}"
set AppleScript's text item delimiters to {"@"}
set delimitedList to every text item of someText

set todoName to (get item 1 of delimitedList)
set listName to (get item 2 of delimitedList)

tell application "Reminders"
    set selectedList to list listName
    tell selectedList
        make new reminder with properties {name:todoName}
    end tell
end tell

Again, thank you guys.

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...