Swtiched computers and my script broke please help

Ok, so I have this script running on my Mail.app from a rule action. It worked perfectly. Then I switch to a different computer and it's not working on the new one. Can anyone spot anything in the script that might be causing it -- or have any other ideas?
[applescript]
add a mail message to todo.txt
using terms from application "Mail"
on perform mail action with messages selectedMsgs
tell application "Mail"
repeat with msg in selectedMsgs
set theSubject to subject of msg
set theSender to extract name from sender of msg
set theDate to date received of msg
set newDate to my new_date(theDate)
set toText to "@mail @takeaction " & " @" & theSubject & " @date " & newDate
do shell script "/Volumes/JUMP/todo/todo.sh add " & toText
end repeat
end tell
end perform mail action with messages
end using terms from
on new_date(theDate)
set cDate to theDate
set shortDate to short date string of cDate
set theMonth to word 1 of shortDate
if length of theMonth is 1 then set theMonth to "0" & theMonth
set theDay to word 2 of shortDate
if length of theDay is 1 then set theDay to "0" & theDay
set theYear to (year of cDate) - 2000
set YYear to "0" & theYear
set DateString to theMonth & theDay & YYear
end new_date
[/applescript]
PowerBook G4   Mac OS X (10.4)  

Hi Dara
As far as I can see the variable selectedMsgs isn't defined anywhere in the script you've posted, but I suspect the error is not being returned by the "on perform mail action" handler, or that selectedMsgs is being silently coerced into an empty list.
Try this from Script Editor
using terms from application "Mail"
on perform mail action with messages selectedMsgs
tell application "Mail"
return selectedMsgs
repeat with msg in selectedMsgs
-- rest of you script goes here
The script will stop after the "return" statement in line 4 and should show the value of selectedMsgs as its result. If this is an empty list, there's your problem.
If not, you may have to temporarily add a few "display dialog" commands to see if the text variables match what you expect. For example
set newDate to my new_date(theDate)
display dialog newDate
etc etc etc.
Incidentally, your new_date handler will break in 2010. The year will be returned as "010", not "10". Try this instead:
set YYear to text -2 thru of -1 of (year of cDate as string)
Hope some of this helps.
H

Similar Messages

  • My Ipod Touch when I try to connect to ANY computer with ANY USB cable I get "USB Not Recognized" Other Ipod devices work with ALL computers and ALL USB cables PLEASE HELP!!!

    I am using an IPod Touch 3. I get the error message USB Not Recognized. Now I have tried three different USB Cables and three different computers...... Same error message. My daughters IPod Touch 4 works perfectly with all of those USB Cables and computers, so this is not a USB problem or a computer problem. It must be something with my IPod Touch 3. Every article I go to wants me to look at stuff on the computer but how could that make sense if other IPod Devices work fine? Please. Any information would be greatly appreciated.

    You need to provide more information about your network. What frequency does it use (2.4ghz or 5.0ghz), which wireless protocol (a, b, g, b/g compatibility, n), and what security are you using (WEP, WPA2, etc.)?
    Please also provide more information about your iPod Touch. Which model is it, and which version of the iOS are you running on it?

  • I need to add a new computer and take off a old one but can't find the site or place to turn it off i can only have two computers but i got three please help let me know where to go to shut one off to put the new one on?

    i need to add a new computer and take off a old one but can't find the site or place to turn it off i can only have two computers but i got three please help let me know where to go to shut one off to put the new one on?

    Hello,
    the way is written there Activation & deactivation help >>> (see there only to understand the procedure) Common activation problems >>> "Activation limit reached for [product]. This serial number has already been activated on 2 computers." "Maximum activations exceeded."
    >>> How to deactivate or sign out >>> A single license for Adobe software lets you install the applications on two computers—for example, at home and at the office. However, you can use the software on only one computer at any given time.
    If you want to install the software on a third computer, deactivate the software on the computer on which you will no longer use the software. Then, activate the software on the new computer.
    Hans-Günter

  • Ok so I got my iPod back from the Walmart care plan. My iPod broke so Walmart fixed it. But now I any sign into iMessage or FaceTime! And I really want to text and FaceTime.  So please help!! Thank you!!

    Ok so I got my iPod back from the Walmart care plan. My iPod broke so Walmart fixed it. But now I any sign into iMessage or FaceTime! And I really want to text and FaceTime.  So please help!! Thank you!! ☺

    Maybe:
    iOS: Troubleshooting FaceTime and iMessage activation
    iOS: Troubleshooting FaceTime
    iOS: Troubleshooting Messages
    It is not clear what "But now I any sign into iMessage or FaceTime! " means

  • HT1477 When i disconnect my iPod 2nd Gen from my laptop, its display turns off and working freezes. Please help me.

    When i disconnect my iPod 2nd Gen from my laptop, its display goes off and working freezes. Please help me.

    The computer freezes?  There may be something wrong with the USB port.  If the laptop has more than one port, does this happen on any port?  If you are disconnecting the shuffle cable from the computer, does it make any difference if you disconnect the shuffle at the other end of the cable first, then disconnect the cable from computer?  Or if you currently disconnect the shuffle from cable first, try it the other way.
    You may be able to work around this problem, if you get a self-powered USB hub.  Something like this one
    http://eshop.macsales.com/item/NewerTech/USB2HB7PRO/
    There are many choices, but be sure to get one that has its own power supply.  You can leave the shuffle cable connected to the hub, and connect the shuffle to the hub, instead of directly to the computer.  This may provide a "buffer" for whatever is causing your laptop to shut off when the shuffle is disconnected.  Since the hub has its own power supply, it will not rely on the computer for power to re-charge the battery.

  • My Itunes is no longer allowing me to manage my music on my phone i can no longer select on my iphone to make playlists and delete music. Please help fix my problem.

    My Itunes is no longer allowing me to manage my music on my phone i can no longer select on my iphone to make playlists and delete music. Please help fix my problem. Iphone4s, 32gigs, IOS 7.1.2
    I don't know why it stopped working but it happened a month or two ago but the option on this phone that's usually all the way to the left when you select your device but now its not and I don't know what caused it. ive already tried troubleshooting my problem but have found no help.

    Hello Salmomma,
    Thank you for the details of the issue you are experiencing when trying to connect your iPhone to your Mac.  I recommend following the steps in the tutorial below for an issue like this:
    iPhone not appearing in iTunes
    http://www.apple.com/support/iphone/assistant/itunes/
    Additionally, you can delete music directly from the iPhone by swiping the song:
    Delete a song from iPhone: In Songs, swipe the song, then tap Delete.
    iPhone User Guide
    http://manuals.info.apple.com/MANUALS/1000/MA1658/en_US/iphone_ios6_user_guide.p df
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • My apps wont open and i keep downloading new apps, hard resetting, syncing and nothing works! PLEASE HELP

    My apps wont open and i keep downloading new apps, hard resetting, syncing and nothing works! PLEASE HELP  

    Then restore the iPod.  First from backup and if problem persists, restore to factory defaults/new iPod.

  • I spend a long time to try to sync my itunes music on my ipod 160 GB Classic, but after waiting so long get a pop up message that itunes stop syncing because of error 46, some times giving me 58, 1469, and many other numbers, please help macbook pro

    i spend a long time to try to sync my itunes music on my ipod 160 GB Classic, but after waiting so long get a pop up message that itunes stop syncing because of error 46, some times giving me 58, 1469, and many other numbers, please help am using macbook pro

    That is precisely what my mid-2010 MacBoook Pro 13 was doing before the drive finally died after an Apple Genius rebooted it a dozen or so times. I have since read about the exact same thing happening to others, including a writer for The Atlantic magazine who had never had an issue with a Mac before. Do a back-up ASAP to make sure you don't lose anything and see about replacing the HDD. It is only about $140 for a new drive. The real issue is if you lose your data, too. So, make sure you do that back-up!

  • I can't use indesign since upgrade, it keeps asking me to upgrade java which I have done and still wont open please help me i have a deadline

    i can't use indesign since upgrade, it keeps asking me to upgrade java which I have done and still wont open please help me i have a deadline

    DL the SE 6 JRE from http://support.apple.com/kb/DL1572.
    27" i7 iMac (Mid 2011) refurb, OS X Yo (10.10.1), Mavs, ML & SL, G4 450 MP w/10.5 & 9.2.2

  • Lightroom 4.4 keeps crashing saying "Lightroom encountered an error when reading from its preview cache and needs to quit" please help. I've tried reinstalling it and everything  Windows 8.1

    Lightroom 4.4 keeps crashing saying "Lightroom encountered an error when reading from its preview cache and needs to quit" please help. I've tried reinstalling it and everything  Windows 8.1

    I assume you know where your catalogue file (the lrcat file) is located. In the same folder is a previews lrdata folder which you should delete or rename in Explorer, then start LR again.
    If I've made incorrect assumptions above, sorry, and we'll go back over it from the start.
    John

  • I have a seagate 1tb hard drive and a 16gb memory stick, how do i transfer avi files from one to another as the click drag and drop wont work, please help?

    i have a seagate 1tb hard drive and a 16gb memory stick, how do i transfer avi files from one to another as the click drag and drop wont work, please help?

    Greetings,
    What happens when you drag it?
    Make sure the drive you are moving the files to has enough available space to receive the file:
    Click on the movie file and go to File >  Get Info and note the "size"
    Check the drive to which you are moving the file to make sure it has enough available space: https://idisk.me.com/madisonfile-Public/web/finder-drive-available-space-and-for mat.html
    Also note the format of the drive you are copying too.  If it is not Mac OS Extended or FAT (not recommended unless you are taking it to a windows computer) then that may be the issue.
    Hope that helps.

  • I have Windows 8 and Itunes 11.1.2. When I click on the Itunes desktop shortcut, Itunes won't open. I just the icon go to the taskbar and nothing more. Please help.

    I have Windows 8 and Itunes 11.1.2. When I click on the Itunes desktop shortcut, Itunes won't open. I just the icon go to the taskbar and nothing more. Please help.

    Delete the shortcut and make a new one. The 'real' application will probably be fine if you launch it from the Start/Programs menu.

  • Trouble opening the free photoshop and illustrator trial downloads, please help!

    Trouble opening the free photoshop and illustrator trial downloads, please help!

    Dear Michael,
    In response to your questions, please see below;
    What OS? OS X 10.8.2
    What happens? When i click on the ''AdobePatchInstaller'' i get this message, ''Update Failed, Updates could not be applied. This patch is not applicable for you. Please check for updates from the Help menu in your product to see a list of latest updates available. If the problem persists, contact customer support for further assistance.
    Any error messages? No
    Did you have previous versions of the software on your system? No
    Is the trouble with the download or the installation of the software? I am not sure but i think it may be the download. It shows that the download was complete and icon appears on the desktop.                                                                                I plan to buy the ''Adobe Creative Suite 6 Design & Web Premium'' but i wanted to try it first via the free trials, especially Photoshop and Illustrator. So please let me know what i need to do.
    Kind regards,
    Nancy Gonda-Nesbeth
    Freelance Garment Technologist
    <Removed by Moderator>

  • I had no idea that I needed to use a CD to download my Adobe Photoshop Elements 12 onto my MAC and have already registered the product; how can I now download it? I have tried loping on the web and no luck! Please help me!

    I had no idea that I needed to use a CD to download my Adobe Photoshop Elements 12 onto my MAC desktop and have already registered the product; how can I now download it? I have tried looking on the web and no luck. Please help me!

    You don't need a CD to download anything; just download & install the trial from http://www.adobe.com/cfusion/tdrc/index.cfm?product=photoshop_elements, then activate it with your serial number.

  • My mac starts up in a white screen with a loading bar and a loading circle please help

    My mac starts up in a white screen with a loading bar and a loading circle please help

    I do hope you have recent backup, because it look like your hard disk is failing. You can start up in Recovery Mode, and run Disk Utility to see if the disk can be fixed:  OS X: About OS X Recovery - Apple Support

Maybe you are looking for

  • Get Node Value in XSLT

    Hi all. Maybe a simple question but, I haven't done yet. In BPEL, when I need to get a node, I use getVariableData XPath function, for example: count(bpws:getVariableData('MtlSystemItemsBESB_OutputVariable','MtlSystemItemsBCollection','/ns7:MtlSystem

  • How do I AUTOMATICALLY generate Transport request for a Z table data?

    Hello friends, I would like to automatically create/generate a transport request for a Z table every time I change, add or delete data in that table. Currently, every time I modify data in the Z table, I need to go and manually create a transport req

  • Render a uix page

    hi, I am just beginning to use uix pages migrating from jsp's and am woundering how to render a uix page. I 've read the developers guide but am not certain how it works as a whole. Are there any examples out there that i can look at?? apart from the

  • DML Statements audit

    Hi Experts, how to audit DML statement through trace files. Thanks Shashikala Shashikala

  • MT doesn't recognize my AppleID for installed applications through AppStore (i own just one AppleID)

    Dear Apple, i own just one AppleID! And it sounds like i'm not the only one who is facing this issue.