Jump to content
spacecadet9

Fantastical Workflow

Recommended Posts

I've amended this on my Alfred to allow a modifier after the date to choose whether to add the event directly, or to open Fantastical to review first.

set str to q as string
set AppleScript's text item delimiters to " " as string
considering case
	set len to str's last text item's length
end considering
set AppleScript's text item delimiters to ""
set theend to text ((-(" "'s length) - len) + 1) thru -1 of q
set q to text 1 thru (-(" "'s length) - len) of q
if theend does not contain "rev" then
	tell application "Fantastical" to parse sentence q with add immediately
else
	tell application "Fantastical" to parse sentence q
end if

If you add 'rev' after the text for the new event, you can review in fantastical first; if rev doesn't appear, then the event is added directly. To change the default, change the line 

if theend does not contain "rev" then

to 

if theend contains "add" then

and use the phrase 'add' afterwards to force it be added directly.

Share this post


Link to post

@theboyler - I'm not proficient with scripting at all. Where would I copy your enhancement to the exisisting workflow script. What I've done is this.

 

on alfred_script(q)

tell application "Fantastical"

  parse sentence q

end tell

end alfred_script

 

set str to q as string

set AppleScript's text item delimiters to " " as string

considering case

set len to str's last text item's length

end considering

set AppleScript's text item delimiters to ""

set theend to text ((-(" "'s length) - len) + 1) thru -1 of q

set q to text 1 thru (-(" "'s length) - len) of q

if theend does not contain "rev" then

tell application "Fantastical" to parse sentence q with add immediately

else

tell application "Fantastical" to parse sentence q

end if

 

 

Any help would be greatly appreciated!

 

Rick

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...