I want to write a script or Automator workflow/app that emails a random shortcut of the day to three recipients. The source is from an Excel spreadsheet. One column is the shortcut, and the second column is the definition. Anyone have experience?

I want to write a script or Automator workflow/app that automatically emails a random shortcut of the day to three recipients. The source is from an Excel spreadsheet. One column is the shortcut, and the second column is the definition. Anyone have similar experience and know that this would work?

I have had a first stab at the script, below.  It uses a file to store the shortcuts and command [descriptions].  You should be able to see from the script annotations how to add a new one.  (I populated 1-4 with real data, but got lazy after that, so you have a few placeholders to work with first.
As I have noted, once you are happy that you have all the data in the file, you can comment out part of the script for ongoing use.  (BTW, my reluctance to use Excel is that I don't currently have it installed and I don't want to offer wrong advice.  If you have Numbers, I do have that and could probably modify to work with a spreadsheet from there.  This might be especially useful if you have the data already sitting in Excel.)
A few things came-up whilist I was writing the script:
1.     Currently, all recipients will not only get the same tip at the same time, but they will see the names and email addresses of the others who receive them.  It is possible to modify this.
2.     I have added a property gRandomCheck which keeps track of which shortcut has already been used (since the last time the script was compiled.  This will prevent the same tip being sent more than once.    When all tips have been sent once, the script will alert you and not send anything until reset.  It does not check on a per-addressee basis (which would be a refinement).  (If you add a new addressee at this stage, the whole process will start again, and you may not really want this to be the behaviour.)
3.     The way that I have built the list, commandList, is deliberately cumbersome - it's for the sake of clarity.  If you prefer, you can construct the whole list as {{shortcut:"X", command:"X"}, {shortcut:"Y", command:"Y"}}
Have a look - I am sure you will have questions!
SCRIPT STARTS HERE  Paste the following lines (thru the end) into a new AppleScript Editor document and press RUN
--The property gRandomCheck persists between runs and is used to stop sending the same hint twice.
property gRandomCheck : {}
--I am defining a file on the desktop.  It doesn't have to be in this location
set theFolder to path to desktop
set commandFile to (theFolder as text) & "CommandFile.csv"
--(* Unless you need to change the file contents you do not need to write to it each time.  Remove the "--" on this line and before the asterisk about 18 lines below
--Follow this format and enter as many records as you like on a new line - each with a unique name
set record1 to {shortcut:"Z", command:"Undo"}
set record2 to {shortcut:"R", command:"Record"}
set record3 to {shortcut:"⇧R", command:"Record Toggle"}
set record4 to {shortcut:"⌘.", command:"Discard Recording & Return to Last Play Position"}
set record5 to {shortcut:"X", command:"x"}
set record6 to {shortcut:"X", command:"x"}
set record7 to {shortcut:"X", command:"x"}
set record8 to {shortcut:"X", command:"x"}
set record9 to {shortcut:"X", command:"x"}
set record10 to {shortcut:"X", command:"x"}
set record11 to {shortcut:"X", command:"x"}
set record12 to {shortcut:"X", command:"x"}
set record13 to {shortcut:"X", command:"x"}
--Make sure you add the record name before randomCheck:
set commandList to {record1, record2, record3, record4, record5, record6, record7, record8, record9, record10, record11, record12, record13}
--This part writes the above records to the file each time.
set fileRef to open for access commandFile with write permission
set eof of fileRef to 0
write commandList to fileRef starting at eof as list
close access fileRef
--remove "--" here to stop writing (see above)*)
--This reads from the file
set fileRef to open for access commandFile with write permission
set commandList to read fileRef as list
close access fileRef
--Here's where the random record is chosen
set selected to 0
if (count of gRandomCheck) is not (count of commandList) then
          repeat
                    set selected to (random number from 1 to (count of commandList))
                    if selected is not in gRandomCheck then
                              set gRandomCheck to gRandomCheck & selected
                              exit repeat
                    end if
          end repeat
else
          display dialog "You have sent all shortcuts to all recipients once.  Recompile to reset"
          return
end if
--This is setting-up the format of the mail contents
set messageText to ("Shortcut: " & shortcut of record selected of commandList & return & "Command: " & command of record selected of commandList)
tell application "Mail"
  --When you're ready to use, you probably will not want Mail popping to the front, so add "--" before activate
  activate
  --You can change the subject of the message here.  You can also set visible:true to visible:false when you are happy all is working OK
          set theMessage to (make new outgoing message with properties {visible:true, subject:"Today's Logic Pro Shortcut", content:messageText})
          tell theMessage
  --You can add new recipients here.  Just add a new line.  Modify the names and addresses here to real ones
                    make new to recipient with properties {name:"Fred Smith", address:"[email protected]"}
                    make new to recipient with properties {name:"John Smith", address:"[email protected]"}
  --When you are ready to start sending, remove the dashes before "send" below
  --send
          end tell
end tell

Similar Messages

  • My mac will not copy more than one file at a time and gets locked up if the file is too large, my mac will not copy more than one file at a time and gets locked up if the file is too large

    my mac will not copy more than one file at a time and gets locked up if the file is too large, my mac will not copy more than one file at a time and gets locked up if the file is too large

    So now that you have repeated the same thing three times that doesn't make things any clearer at all.
    You are copying files from where to where?
    How are you attempting to copy files, software or click and drag?
    Any other detail would be helpful.
    Allan

  • If I rent a movie and I later I decide that I want to buy it, Am I going to need to download it once for the rental and a second time for the purchase?

    I just wanted to know if I rent a movie and I later I decide that I want to buy it, Am I going to need to download it once for the rental and a second time for the purchase?

    You will need to redownload it - rentals expire and are deleted, either 30 days after renting it, or 48 hours (24 hours if you are in the US) after starting to watch it, whichever is the soonest.

  • HT1694 My hotmail access disappeared from my iPad. When I go to settings and click 'mail, contacts, calendars' the page freezes. It doesn't allow me to the account setting. Anyone have suggestions?

    My hotmail access disappeared from my iPad. When I go to settings and click 'mail, contacts, calendars' the page freezes. It doesn't allow me to the account setting. Anyone have suggestions?

    Your Settings app is crashing. Sometimes, the only way to fix this is by restoring the iOS software but hopefully it will not come to that.
    1. Quit the app completely and restart the iPad. Go to the home screen first by tapping the home button. Double tap the home button and the task bar will appear with all of your recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button or anywhere above the task bar. Restart the iPad.
    Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    2. Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    3. You can try resetting all settings. Settings>General>Reset>Reset All Settings. You will have to enter all of your app preferences and device settings again.

  • My ipad 2 will not connect to the internet I've tried to manually enter it but its not recognising it or finding any connections.  I've reset it to factory settings twice and its not clearing it.  Does anyone have any ideas??

    My ipad 2 will not connect to the internet I've tried to manually enter it but its not recognising it or finding any connections.  I've reset it to factory settings twice and its not clearing it.  Does anyone have any ideas?? 

    Some things to try first:
    1. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    2. Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    3. Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    4. Go into your router security settings and change from WEP to WPA with AES.
    5.  Renew IP Address: (especially if you are droping internet connection)
        •    Launch Settings app
        •    Tap on Wi-Fi
        •    Tap on the blue arrow of the Wi-Fi network that you connect to from the list
        •    In the window that opens, tap on the Renew Lease button
    6. Potential Quick Fixes When Your iPad Won’t Connect to Your Wifi Network
    http://ipadinsight.com/ipad-tips-tricks/potential-quick-fixes-when-your-ipad-won t-connect-to-your-wifi-network/
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    Fix WiFi Issue for iOS 7
    http://ipadnerds.com/fix-wifi-issue-ios-7/
    iOS 6 Wifi Problems/Fixes
    Wi-Fi Fix for iOS 6
    https://discussions.apple.com/thread/4823738?tstart=240
    How To: Workaround iPad Wi-Fi Issues
    http://www.theipadfan.com/workaround-ipad-wifi-issues/
    Another Fix For iOS 6 WiFi Problems
    http://tabletcrunch.com/2012/10/27/fix-ios-6-wifi-problems-ssid/
    Wifi Doesn't Connect After Waking From Sleep - Sometimes increasing screen brightness prevents the failure to reconnect after waking from sleep. According to Apple, “If brightness is at lowest level, increase it by moving the slider to the right and set auto brightness to off.”
    Fix For iOS 6 WiFi Problems?
    http://tabletcrunch.com/2012/09/27/fix-ios-6-wifi-problems/
    Did iOS 6 Screw Your Wi-Fi? Here’s How to Fix It
    http://gizmodo.com/5944761/does-ios-6-have-a-wi+fi-bug
    How To Fix Wi-Fi Connectivity Issue After Upgrading To iOS 6
    http://www.iphonehacks.com/2012/09/fix-wi-fi-connectivity-issue-after-upgrading- to-ios-6.html
    iOS 6 iPad 3 wi-fi "connection fix" for netgear router
    http://www.youtube.com/watch?v=XsWS4ha-dn0
    Apple's iOS 6 Wi-Fi problems
    http://www.zdnet.com/apples-ios-6-wi-fi-problems-linger-on-7000004799/
    ~~~~~~~~~~~~~~~~~~~~~~~
    How to Boost Your Wi-Fi Signal
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Boost-Your-Wi-Fi-Signal.h tm
    Troubleshooting a Weak Wi-Fi Signal
    http://ipad.about.com/od/iPad_Troubleshooting/a/Troubleshooting-A-Weak-Wi-Fi-Sig nal.htm
    How to Fix a Poor Wi-Fi Signal on Your iPad
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Fix-A-Poor-Wi-Fi-Signal-O n-Your-iPad.htm
    iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    WiFi Connecting/Troubleshooting http://www.apple.com/support/ipad/wifi/
    How to Fix: My iPad Won't Connect to WiFi
    http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-My-Ipad-Wont-Connect -To-Wi-Fi.htm
    iOS: Connecting to the Internet http://support.apple.com/kb/HT1695
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Connect iPad to Wi-Fi (with troubleshooting info)
    http://thehowto.wikidot.com/wifi-connect-ipad
    10 Ways to Boost Your Wireless Signal
    http://www.pcmag.com/article2/0,2817,2372811,00.asp
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    How To Fix iPhone, iPad, iPod Touch Wi-Fi Connectivity Issue http://tinyurl.com/7nvxbmz
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    Some Wi-Fi losses may stem from a problematic interaction between Wi-Fi and cellular data connections. Numerous users have found that turning off Cellular Data in Settings gets their Wi-Fi working again.
    You may have many apps open which can possibly cause the slowdown and possibly the loss of wifi. In iOS 4-6 double tap your Home button & at the bottom of the screen you will see the icons of all open apps. Close those you are not using by pressing on an icon until all icons wiggle - then tap the minus sign. For iOS 7 users, there’s an easy way to see which apps are open in order to close them. By double-tapping the home button on your iPhone or iPad, the new multitasking feature in iOS 7 shows full page previews of all your open apps. Simply scroll horizontally to see all your apps, and close the apps with a simple flick towards the top of the screen.
    Wi-Fi or Bluetooth settings grayed out or dim
    http://support.apple.com/kb/TS1559
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • When i open an mp3 file from a source other than apple, does itunes create it's own file and can I then delete the original mp3?

    when I open a music file from a source other than apple, does itunes create it's own file and can I then delete the original mp3?

    If you use iTunes' default settings then when you add a file to iTunes it places a copy of the file in the iTunes media folder and it leaves the original in place.  The exception is when you drag it to the Automatically Add To iTunes folder.
    It does not convert the file.  You can delete the original if you wish.

  • How can I move all my bookmarks from different Firefox profiles into one area to organize them and then place them into the different Firefox profiles?

    How can I move all my bookmarks from different Firefox profiles (would like to move whole bookmark folders at once if possible) into one area to organize them and then place them into the different Firefox profiles? This is all under one window user account, I am using windows 8.1. Even if you have information on how to do it on a different windows, it may still be helpful. Thanks for any input you have.

    Just a note about the difference between these two things:
    * "export" and "import" use an ancient HTML document format that all browsers can understand. When you import bookmarks, Firefox may place them into an Imported Bookmarks folder, or into Unsorted Bookmarks. This does not displace existing bookmarks, and Firefox does not automatically remove duplicates.
    * "backup" and "restore" use a more comprehensive JSON data file, which contains extra information about your bookmarks (such as tags) not contained in the traditional export file. HOWEVER, a restore completely replaces all existing bookmarks, so the restore feature cannot be used to merge in a set of additional bookmarks.
    Related support articles:
    * [[Export Firefox bookmarks to an HTML file to back up or transfer bookmarks]]
    * [[Import Bookmarks from a HTML file]]
    * [[Restore bookmarks from backup or move them to another computer]]
    Some users find the disk-based Windows Favorites folder a convenient way to organize bookmarks. If you do, too, and you do not need to preserve tags on your bookmarks, you could export each profile's bookmarks to HTML and import them all into IE11. Organize them in the Windows Favorites folder, then export from IE11 to HTML and import that file into each Firefox profile. See: [http://windows.microsoft.com/en-us/internet-explorer/add-view-organize-favorites].

  • I am trying to print a color photo on my MacBook Pro from iPhoto (not using Photoshop) using Epson 2200 printer, and everything I do in the Color Matching and Print Settings results in a photo with a pink cast to it. What am I doing wrong?

    I am trying to print a color photo on my MacBook Pro from iPhoto (not using Photoshop) using Epson 2200 printer, and everything I do in the Color Matching and Print Settings results in a photo with a pink cast to it. What am I doing wrong?

    Have you checked the ink cartridges and made sure the nozzles are clear? Are you able to print from outside of iPhoto with the correct color?
    Try the following: make temporary copy of the library and do the following:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home()/Library/ Preferences folder.
    2 - delete iPhoto's cache file, Cache.db, that is located in your
         User/Home()/Library/Caches/com.apple.iPhoto folder. 
    3 - launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences.
    OT

  • I did a full system restore to my phone along with the new 7.0 update. Now I went to restore my phone setting back through Itunes and it goes through all the steps but when it is completed it wont get past the "Connect to Itunes" screen

    I did a full system restore to my phone along with the new 7.0 update. Now I went to restore my phone setting back through Itunes and it goes through all the steps but when it is completed it wont get past the "Connect to Itunes" screen

    So what happens when you connect to iTunes?

  • HT1918 I am trying to enter the No. Of my VISA card (which I normaly use for payments) in the billing info of my account and it is not accepted. Does anyone have any idea why?

    I am trying to enter the No. Of my VISA card (which I normaly use for payments) in the billing info of my account and it is not accepted. Does anyone have any idea why?

    JarleEkanger wrote:
    How about this? Use Delete array subset to extract chunks for averaging, and a shift register to retain the remaining array.
    It is typically not advisable to use "delete from array" in a tight loop. The constant memory reallocations due to array resizing are probably inefficient.
    Here's one simple way to do it..
    (If the number of points is not divisible by 10, the excess tail is discarded. You can easily modify that behavior if desired.)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    averages of 10.png ‏5 KB
    averages of 10.vi ‏9 KB

  • How can I import photos from iPhoto-library to edit in Photoshop CC? - and save it back to the iPhoto-library?

    How can I import photos from iPhoto-library to edit in Photoshop CC? - and save it back to the iPhoto-library?

    How to access iPhoto images for use in Photoshop
    1. In the Finder, navigate to Users > [user name} > Pictures > iPhoto Library. 
    2. Control-click the iPhoto Library file and choose Show Package Contents.
    3. A Finder window opens that shows the contents. The Masters folder (or called Originals folder) contains all of the photographs that are in iPhoto. 
    Photoshop cannot access this folder, but if you make a duplicate of the folder, the dupe will be accessible -- so:
    4. Control-click the folder named Masters (or Originals) and choose Duplicate. 
    5, Drag the duplicate folder which is named "Masters copy" or “Originals copy” from the iPhoto Library Finder window to the Desktop.
    6. Open images in Photoshop from file on desktop.
    7  Rename the folder and move it elsewhere (probably to the Pictures folder), if desired.  

  • HT3743 I was trying to software update i phone 3g, when software downloaded an install, one unknown error has occurred, and asking for restore, at the same time i am trying to re-store again an error of 1015, happen, what i should do

    I was trying to software update i phone 3g, when software downloaded an install, one unknown error has occurred, and asking for restore, at the same time i am trying to re-store again an error of 1015, happen, what i should do, for solution,
    please advise me,
    best regards,
    Ahmed

    try to edit your host file ang delete any line that contain gs.apple.com

  • Since upgrading from Windows Vista to Windows 7 both Internet Explorer and Firefox will not recognize the numbers keys of my keyboard. I get numbers in Word and every other situation, just not in the internet programs.

    Since upgrading from Windows Vista to Windows 7 both Internet Explorer and Firefox will not recognize the numbers keys of my keyboard. I get numbers in Word and every other situation, just not in the internet programs. I have tried uninstalling Firefox and reinstalling with no results.

    If there are problems with importing the IE Favorites in Firefox then export the favorites in IE to an HTML file and import that file in the Firefox Bookmarks Manager.
    If you do not have the menu bar in IE then right-click the toolbar at the top to enable the Menu Bar.
    *Export the favorites in IE to an HTML file (bookmarks.html):<br>File > Import and Export
    *Import the HTML file in Firefox:<br>Bookmarks > Show All Bookmarks > Import & Backup > Import Bookmarks from HTML
    See "Import from another browser" and "Import from file":
    *http://kb.mozillazine.org/Import_bookmarks

  • I want to add a CD to my IPod Classic, the CD has been loaded into my library but my iPod is not showing on i-tunes and I can't get the CD onto my iPod.

    I want to add a CD to my IPod Classic, the CD has been loaded into my library but my iPod is not showing on i-tunes and I can't get the CD onto my iPod.

    Well if your iPod is not appearing under Devices in iTunes when you have it plugged into a high powered USB 2.0 port, then that would explain why this newly loaded CD has not synced to it yet. 
    Have you carefully worked through each and every single suggestion in this Apple support document?
    iPod not recognized in 'My Computer' and in iTunes for Windows
    B-rock

  • Since updating my iphone 4S it has started showing no service, i have gone into the apple store and they couldn't fix it does anyone have any suggestions?

    Since updating my iphone 4S it has started showing no service, i have gone into the apple store and they couldn't fix it does anyone have any suggestions?

    They offered to value my iPhone and then put that money towards buying me out of my contract however I don't want to have to spend more money when my contract ends on august anyway.

Maybe you are looking for

  • Mac mini 2012 - Video Problem (Not HDMI Flickering)

    Hello guys, I have a problem with video, it causes to shut down the monitor while is playing Chefville in facebook, i had no idea why would to turn off monitor. It doesn't present any "beep" sound, it seems Intel HD4000 is a defective. I waited like

  • NOT PRINTING FROM WINDOWS 7 TO MY PHOTOSMART c7180 ALL-IN-ONE (I CAN SEE MESSAGES IN QUEUE)?

    CANNOT PRINTING FROM WINDOWS 7 TO MY PHOTOSMART c7180 ALL-IN-ONE (I CAN SEE MESSAGES IN QUEUE)?

  • Compile errors

    Hi, I am learning Java using a few courses from text books. Everything has been going well so far. I do most of my devleopment on Linux but recently installed the JDK on my Windows partition. The course I am using from the book comes with a library t

  • Short dumps in ST22

    Hi, I get a set of 30 dumps daily on my Solman system. The user is SMD_RFC & the dump is as follows: Runtime Errors         CREATE_DATA_UNKNOWN_TYPE Exception              CX_SY_CREATE_DATA_ERROR Date and Time          28.01.2011 00:30:52 Short text

  • How to share Aperture photos

    Just got 3rd generation Apple TV - does anyone know how to get Aperture photos to show up?  I've set up home sharing