Menambahkan alarm ke entri kalender menggunakan AppleScript di Mavericks menyebabkan kesalahan

0

Saya memiliki skrip berikut (lihat bawah) yang dimaksudkan untuk membuka semua entri kalender dan membuat alarm untuk masing-masing. Hal ini bekerja dengan baik pada 10.8.x . Saya telah menguji skrip yang sama pada Mavericks dan saya mendapatkan kesalahan ini.

masukkan deskripsi gambar di sini

Kesalahan terjadi pada baris yang mengatakan "buat alarm file baru terbuka ...". Jika saya berkomentar 2 baris ini, hasilnya baik-baik saja.

Ada ide apa yang bisa salah? Saya melihat panduan referensi Applescript yang tersedia online tetapi saya tidak dapat menemukan bagian yang berbicara tentang make dan agak sulit untuk mencari di internet untuk kata "make" karena ini cukup generik.

Ini kode saya:

set startFile to "/Users/" & UName & "/Desktop/my-app1-here.app"
set endFile to "/users/" & UName & "/Desktop/my-app2-here.app"

    tell application "Calendar"
        tell calendar "Home"
            delay 1
            set allEvents to every event

            repeat with rEvent in allEvents
                tell rEvent
                            set theDate to start date - 1 * minutes
                    set endDate to end date

                    if (minutes of (endDate) is 0) then
                        set endDate to endDate - 5 * minutes
                    end if

                    make new open file alarm at end with properties {trigger date:theDate, filepath:startFile}
                    make new open file alarm at end with properties {trigger date:endDate, filepath:endFile}

                end tell
            end repeat

        end tell

inilah pesan kesalahan konsol:

7/05/2014 10:19:52.698 am Calendar[646]: [com.apple.calendar.ui.log] [Save failed with error Error Domain=NSCocoaErrorDomain Code=1560 "Multiple validation errors occurred." UserInfo=0x608000866600 {NSDetailedErrors=(
    "Error Domain=CalCalendarStorePersistenceErrorDomain Code=1550 \"Alerts that open files or scripts must include a file path.\" UserInfo={\n    CalAlarmUID = \"2B8B98F1-0E23-45A7-AFDA-5AB692A36647\";\n    CalCalendarItemUID = \"79E93DF6-2073-40DF-BAB1-1642493B5B18\";\n    CalCalendarUID = \"DD5D4A36-F3E9-4BA7-A15B-A843D9381564\";\n    CalManagedObjectType = CalManagedAlarm;\n    NSLocalizedDescription = \"Alerts that open files or scripts must include a file path.\";\n}",
    "Error Domain=CalCalendarStorePersistenceErrorDomain Code=1550 \"Alerts that open files or scripts must include a file path.\" UserInfo={\n    CalAlarmUID = \"7729163B-0C99-4F21-AA2D-4A96E41D5045\";\n    CalCalendarItemUID = \"79E93DF6-2073-40DF-BAB1-1642493B5B18\";\n    CalCalendarUID = \"DD5D4A36-F3E9-4BA7-A15B-A843D9381564\";\n    CalManagedObjectType = CalManagedAlarm;\n    NSLocalizedDescription = \"Alerts that open files or scripts must include a file path.\";\n}"
)}]
7/05/2014 10:19:52.699 am Calendar[646]: Detailed error: Error Domain=CalCalendarStorePersistenceErrorDomain Code=1550 "Alerts that open files or scripts must include a file path." UserInfo={
    CalAlarmUID = "2B8B98F1-0E23-45A7-AFDA-5AB692A36647";
    CalCalendarItemUID = "79E93DF6-2073-40DF-BAB1-1642493B5B18";
    CalCalendarUID = "DD5D4A36-F3E9-4BA7-A15B-A843D9381564";
    CalManagedObjectType = CalManagedAlarm;
    NSLocalizedDescription = "Alerts that open files or scripts must include a file path.";
}
7/05/2014 10:19:52.699 am Calendar[646]: Detailed error: Error Domain=CalCalendarStorePersistenceErrorDomain Code=1550 "Alerts that open files or scripts must include a file path." UserInfo={
    CalAlarmUID = "7729163B-0C99-4F21-AA2D-4A96E41D5045";
    CalCalendarItemUID = "79E93DF6-2073-40DF-BAB1-1642493B5B18";
    CalCalendarUID = "DD5D4A36-F3E9-4BA7-A15B-A843D9381564";
    CalManagedObjectType = CalManagedAlarm;
    NSLocalizedDescription = "Alerts that open files or scripts must include a file path.";
}
mrjayviper
sumber
1
Per pesan kesalahan, apa isinya di konsol?
grg
siapa yang "membuat file baru"?
Ruskes
Saya mengedit posting saya untuk menampilkan pesan konsol. terima kasih lagi
mrjayviper