Jump to content

Request: New Event to Calendar workflow


Recommended Posts

  • 4 weeks later...

Here you go:  http://bit.ly/124R6CP

 

That took waaaaaaay too long for me to figure out.

It may have taken you too long but it was certainly worth it.  It works AND you've solved the issue I had with the other Calendar workflows -- namely, that the script needed a delay to execute properly if Calendar wasn't open.

 

Thanks for the hard work -- I, and I hope others, really appreciate it.

 

PS.  Any chance of adding a Notification Alert to the workflow?

Edited by thinkfilm
Link to comment

Here you go:  http://bit.ly/124R6CP

 

That took waaaaaaay too long for me to figure out.

 you can just use keystroke to print the parameter straight in the box:

 

 

 

on alfred_script(q)

tell application "Calendar" to activate
delay 0.5
tell application "System Events"
keystroke "n" using {command down}
keystroke q
keystroke return
end tell

end alfred_script
 
Link to comment
  • 1 month later...
  • 1 month later...

Nice one Zapacoman. Is there any chance that this could be changed to work with Google Calendar?.

 

 

This should work for Gcal assuming the page doesn't take more than 1 second to load.  If it does based on your internet connection speed, just add more delay:

 

 

on alfred_script(q)

tell application "Finder"
set the clipboard to q
end tell

tell application "Safari" to activate
tell application "Safari" to open location "https://www.google.com/calendar?tab=cc"
delay 0.5
tell application "System Events"
	keystroke "q"
	delay 1
	keystroke "v" using {command down}
	keystroke space
	keystroke return
end tell

end alfred_script
Edited by zapacoman
Link to comment
  • 10 months later...

Came across this and it's exactly what I wanted, except that I'm not crazy about the 0.5 second delay. There's no guarantee Calendar will be running in 0.5 seconds, and if it's already running then you have to wait 0.5 seconds for nothing. So I tweaked it a bit (with the help of reddit.com/u/cooper12), and made it run immediately if Calendar is running, otherwise wait until Calendar is ready.

on alfred_script(q)
    activate application "Calendar"
    repeat until application "Calendar" is running
        delay 0.1
    end repeat
    activate application "Calendar"
    tell application "System Events"
        keystroke "n" using {command down}
        keystroke q
        keystroke return
    end tell
end alfred_script

 

Link to comment
  • 5 years later...
4 hours ago, helwaser said:

how do i open your link please?

 

You can't: the domain doesn't exist any more. I've no idea why you're seeing that searchguide.level3.com. It's probably something your ISP/DNS-provider is doing when your request a non-existent domain.

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