0
(curl -s 'https://wayfair.com' | grep -q "Sale") && osascript SendMessage.scpt 5555551234 https://wayfair.com

The above works in conjuction with the script below to send a text message if Wayfair have the word sale on their main page. Wayfair is just an example.

on run {targetBuddyPhone, targetMessage}
tell application “Messages”
set targetService to 1st account whose service type = iMessage
set targetBuddy to participant targetBuddyPhone of targetService
send targetMessage to targetBuddy
end tell
end run

Is there a way to run the same command, but negate the information? For example, read through Wayfair's homepage and if Wayfair.com DOES NOT have the word "Sale" on their site, it would then send me a text?

I'm writing this in applescript and I am super new.....

terdon
  • 242,166
  • 1
    Change the && to ||. – Paul_Pedant Apr 14 '23 at 19:32
  • I'll give it a go. What does the | | do? – CaptainNewb Apr 14 '23 at 20:13
  • @Paul_Pedant, you're a genius, thank you!!! – CaptainNewb Apr 14 '23 at 20:18
  • Any idea how I can put this into a bash file so I can put add the bash file to a crontab so it runs every minute? – CaptainNewb Apr 14 '23 at 20:21
  • Since the answer to your question is use the || which is explained in the answer to that other question, I will close this as a duplicate. Please ask about the cron issue separately, but try reading some cron tutorial first so you can ask about any tricky part. It might make more sense to ask on [apple.se] if it's about the macOS-specific applecscript as we're unlikely to know. – terdon Apr 14 '23 at 21:53

0 Answers0