Jump to content


  • Posts

  • Joined

  • Last visited

P-D's Achievements

Helping Hand

Helping Hand (3/5)



  1. Isn't the double tap hotkey a fantastic feature?! (Keys on the sides of the keyboard are faster to find than in the interior. Two strokes on the same key is simpler than two different keys, and fundamental to human language development to show voluntary utterances, cf. da-da, pa-pa, ma-ma, a-a, oh-oh and so on.) However, sometimes when typing a double tap is fired ‘by mistake’. Is there anyway you can set a specific time interval for the tapping to be considered a ‘double tap’? (In my case I have a very useful workflow that opens Drafts’ Capture window with ⇧ double tap, and fills it with OS selection if any, ⌥ double tap the same with the clipboard and ⌘ double tap with pre-filled notes for a meeting or a phone call on the fly. It happens though, that fast typing may trigger those double taps accidently. The benefit is still greater than the harm but it would be even better if there was an easy way to avoid this behavior.)
  2. Credit to @CJK which I wasn't aware of but was in fact EXACTLY how I scheduled the Drafts action to send an SMS—before—I built my AppleScript and Alfred workflow.
  3. Yes, I would be glad to. Very late to this topic but now in those days before Christmas I left behind(!) my Samsung T5 SSD on the bus some 240 km from home and just HAD to schedule a crucial text message (SMS) to the driver a specific time to remind her to bring it back, which she had promised kindly enough. I learnt that crontab is deprecated and launchd recommended but the process led me anyway to make a simple Alfred workflow to make it easier to schedule cron jobs. And YES, you can write an AppleScript that calls an external trigger for Alfred which I just tested, like this: `30 15 6 1 * osascript -e 'tell application id "com.runningwithcrayons.Alfred" to run trigger "myTrigger" in workflow "com.local.pdl" with argument "test"'` In this case an Alfred workflow with the bundle com.local.pdl (just made up to test this) will run 30 minutes after 15 day 6 of month 1 (i.e. 6 Jan, 15:30). Here is a good tutorial on the Cron format. Normally, you are recommended to go into Terminal and edit the crontab but I found it much easier to make a simple Alfred workflow for that with just a short keyword (‘c’) and a Run Script action (with AppleScript): `run script "~/Your path here/Crontab.scpt"` pointing to an AppleScript elsewhere (se below). That script loads the current crontab and lets you “edit” it in an EXTREMELY SIMPLE dialog box. Nothing fancy, but really fast and helpful. (My original solution was actually to run an action (‘SMS’) in Drafts at the desired time, when I was in a meeting, and received a positive reply minutes later and my SSD back in the evening.) 😅 try set crontabs to do shell script "crontab -l" on error set crontabs to "" end try display dialog "Quick crontab\n(Remember: ⌥⏎ for multiline, \\%)" with title "Cron jobs" default answer crontabs -- Use newline instead of return as separator. set crontabs to (paragraphs of (text returned of the result)) set AppleScript's text item delimiters to linefeed set crontabs to crontabs as text set AppleScript's text item delimiters to "" if crontabs = "" then set cmd to "crontab -r" else set cmd to "echo " & quoted form of crontabs & " | crontab" end if do shell script cmd Also, Alfred’s Snippets come in handy. E.g. in order to insert more complicated jobs that may be hard to remember, just make sure you have a working job and save it as snippet. This one will run 10 am, every Friday (day 5 of the week)—BUT—will only continue with the actual osascript IF and only IF it is the last Friday of the month (because otherwise 7 days from now will return the same month in the date function). `0 10 * * 5 [[ $(date +\%m) != $(date -v+7d +\%m) ]] && osascript -e 'display dialog "Last " & (word 1 of ((current date) as text)) & "this month."'` Enjoy!
  • Create New...