Sending an iMessage through Messages upon file download.

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

I have my rules all set up to move files (I'm using it for TV shows) into folders, and used to use a basic automator email script to send an email when a new show was downloaded. This opened Mail to the front of the computer (which is used as a media server with Plex so it's annoying) and you had to have a workflow for each TV Show.

Recently I've moved away from it and started using Messages to push out a "Notification". It works faster, won't bring up Messages, and in general is a lot cleaner. Anyway I am using an embedded script in Hazel to do this. It's working great, but my AppleScript knowledge is a bit minimal, and I'd love it if I didn't have to change the name of the show for every embedded script and could just pull off the Folder name it's going into (most desired) or the file name. I made an attempt to use theFile but it doesn't seem to like it, thinking it's not in the library for Messages.

I know this isn't as much Hazel help, but scripting help, but I know a lot of you are great at it. I will also gladly provide any info on my streamlined system I have. It's awesome.
randallpjenkins
 
Posts: 2
Joined: Tue Oct 30, 2012 11:48 pm

I suggest googling around for more general AppleScript help. "theFile" is an alias and there are several ways to extract path information from it, including the containing folder and file name.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Any chance you can post the script you are using to send the message via iMessage? I'd love to do the same thing! I also might be able to help you change it to make it work.
bondjw07
 
Posts: 11
Joined: Sun Nov 25, 2012 4:58 pm

Sure, obviously using placeholders for the iMessage accounts email address, you can also send to a phone number:
Code: Select all
tell application "Messages"
   set theBuddy to buddy "your@imessage.account" of service "E:sender@imessage.account"
   send "There is a new episode of Workaholics available to watch on the Media Server." to theBuddy
   quit
end tell
randallpjenkins
 
Posts: 2
Joined: Tue Oct 30, 2012 11:48 pm


Return to Support