【问题标题】:Can't make into type integer error 1700 AppleScript无法输入整数类型错误 1700 AppleScript
【发布时间】:2020-12-23 13:42:32
【问题描述】:

尝试在 Reminder App 中选择 List,以添加提醒。 它给出了错误 错误“提醒出现错误:无法将 {"BillsTo Pay"} 转换为整数类型。”从 {"BillsTo Pay"} 到整数的数字 -1700 我尝试了各种解决方案,没有一个有效

请告知导致问题的原因,以及任何要解决的指针。提前发送

tell application "Reminders"
set listNames to {}
repeat with aList in lists
    copy name of aList to end of listNames
end repeat

--get listNames

(*
set oldDelimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to ", "
set listNames to listNames as text
set AppleScript's text item delimiters to oldDelimiters
get listNames
*)
(*
repeat with x from 1 to (count listNames)
    try -- skip errors
        set item x of listNames to (item x of listNames as integer)
    end try
end repeat
*)
(*
set oldDelimiters to AppleScript's text item delimiters
set AppleScript's text item delimiters to ","
set listNames to listNames as list
set AppleScript's text item delimiters to oldDelimiters
*)

set myList to choose from list listNames with prompt "Select the list to add Reminder"

set newremin to (make new reminder in list myList with priority) is 1

end tell

【问题讨论】:

    标签: list applescript


    【解决方案1】:

    改变

    in list myList
    

    in list named myList
    

    顺便说一句,你的前四行很愚蠢。直接说:

    set listNames to (get name of every list)
    

    这是一个很好的表述:

    tell application "Reminders"
        set listNames to (get name of every list)
        set myList to choose from list listNames with prompt "Select the list to add Reminder"
        make new reminder in list named myList
        set name of result to "My Cool Reminder"
    end tell
    

    【讨论】:

    • 谢谢你,马特,这行得通。前 4 行!!,花了我几个小时来写 :)
    • 嗨,马特,我很高兴得到答案,忘记了问题本身。我错过了“命名”,请告诉我为什么它必须在那里,也就是它的意义。请进
    • 因为它是一个名称(不是索引)。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-26
    • 1970-01-01
    • 2021-10-08
    • 2014-07-17
    • 2012-12-21
    相关资源
    最近更新 更多