触发器处理程序中的AppleScript两次导致错误 [英] Trigger Handler twice in Applescript results in error

查看:241
本文介绍了触发器处理程序中的AppleScript两次导致错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我至今写了这code,它工作得很好,唯一的问题是,调用code有错误«脚本»两次结果不理解雷米消息。 (-1708)

so i written this code so far, it works very well, the only issue is, calling the code twice results with an error «script» doesn’t understand the Remi message. (-1708)

请告诉我在这里指出,我怎么可以不设置处理程序它被触发后?

Whats to point here and how can i unset the handler after it was triggered?

在code:

my Remi()

on Remi()
    set cD to (current date)

    tell application "Reminders"
        --set output to name of reminders
        if (count of (reminders whose completed is false)) > 0 then
            set output to ""
            set todoList to name of reminders whose completed is false
            repeat with itemNum from 1 to ((count of (reminders whose completed is false)))
                try
                    set Remi to item itemNum of reminders
                    set remiT to due date of Remi
                    set tim to time string of remiT
                    set dD to date string of remiT
                    set nN to name of Remi
                    if remiT ≤ cD then
                        set val to (tim & " - " & nN & " $$" & dD & "/ENDE")
                        set output to (output & val & return)
                    end if
                end try
            end repeat
        else
            set output to "No reminders available"
        end if
    end tell
    return output
end Remi

THX的帮助

推荐答案

我看看是什么原因造成的问题。你有雷米()处理程序中的变量雷米。我猜你不能这样做!因此,要么改变变量的名称或处理程序的名称,你应该是不错的。

I see what is causing the problem. You have a variable "Remi" inside the "Remi()" handler. I guess you can't do that! So either change the name of the variable or the name of the handler and you should be good.

这篇关于触发器处理程序中的AppleScript两次导致错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆