Applescript create event in calendar, how do I remove the default alert?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







3















Running 10.8 Mountain Lion, I'm trying to create a new event with Applescript like this:



set theDate to (current date)
tell application "Calendar"
tell calendar "Calendar"
set timeString to time string of theDate
set newEvent to make new event at end with properties {description:"Last Backup", summary:"Last Backup " & timeString, location:"To a local unix system", start date:theDate, end date:theDate + 15 * minutes, allday event:false, status:confirmed}
tell newEvent
delete every display alarm
delete every sound alarm
delete every mail alarm
delete every open file alarm
end tell
end tell
end tell


However, this does not remove the default Calendar alert which one can set through Calendar preferences (30 minutes prior in my case).



How do I create an event with no alarms at all through Applescript?










share|improve this question





























    3















    Running 10.8 Mountain Lion, I'm trying to create a new event with Applescript like this:



    set theDate to (current date)
    tell application "Calendar"
    tell calendar "Calendar"
    set timeString to time string of theDate
    set newEvent to make new event at end with properties {description:"Last Backup", summary:"Last Backup " & timeString, location:"To a local unix system", start date:theDate, end date:theDate + 15 * minutes, allday event:false, status:confirmed}
    tell newEvent
    delete every display alarm
    delete every sound alarm
    delete every mail alarm
    delete every open file alarm
    end tell
    end tell
    end tell


    However, this does not remove the default Calendar alert which one can set through Calendar preferences (30 minutes prior in my case).



    How do I create an event with no alarms at all through Applescript?










    share|improve this question

























      3












      3








      3








      Running 10.8 Mountain Lion, I'm trying to create a new event with Applescript like this:



      set theDate to (current date)
      tell application "Calendar"
      tell calendar "Calendar"
      set timeString to time string of theDate
      set newEvent to make new event at end with properties {description:"Last Backup", summary:"Last Backup " & timeString, location:"To a local unix system", start date:theDate, end date:theDate + 15 * minutes, allday event:false, status:confirmed}
      tell newEvent
      delete every display alarm
      delete every sound alarm
      delete every mail alarm
      delete every open file alarm
      end tell
      end tell
      end tell


      However, this does not remove the default Calendar alert which one can set through Calendar preferences (30 minutes prior in my case).



      How do I create an event with no alarms at all through Applescript?










      share|improve this question














      Running 10.8 Mountain Lion, I'm trying to create a new event with Applescript like this:



      set theDate to (current date)
      tell application "Calendar"
      tell calendar "Calendar"
      set timeString to time string of theDate
      set newEvent to make new event at end with properties {description:"Last Backup", summary:"Last Backup " & timeString, location:"To a local unix system", start date:theDate, end date:theDate + 15 * minutes, allday event:false, status:confirmed}
      tell newEvent
      delete every display alarm
      delete every sound alarm
      delete every mail alarm
      delete every open file alarm
      end tell
      end tell
      end tell


      However, this does not remove the default Calendar alert which one can set through Calendar preferences (30 minutes prior in my case).



      How do I create an event with no alarms at all through Applescript?







      calendar applescript calendar.app osx-mountain-lion






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 30 '12 at 5:44









      zero0coolzero0cool

      11415




      11415






















          1 Answer
          1






          active

          oldest

          votes


















          0














          It looks like another case of AppleScript getting the unwanted-stepchild treatment.
          I suggest filing a bug with Apple.



          Specifically, the buggy behavior is as follows, as of OS X 10.8.2:



          -- Trying to set ANY properties on the *default* sound alarm fails silently.
          -- Programmatically added alarms: only the trigger interval or date can be set.
          repeat with al in every sound alarm of newEvent
          tell al
          -- Works only on *programmatically added* sound alarms:
          set trigger interval to -770 # The alternative option, `set trigger date to ...`, works as well.
          -- Fails silently on *all* sound alarms, whether it is the default one or a programmatically created one.
          set sound name to "Pop" # `set sound file to ...` fails equally.
          end tell
          end repeat

          -- This only deletes the programmatically added alarms, but never the default one.
          delete sound alarms of newEvent


          Thus, sadly, silencing the default alarm by manipulating its properties is not an option.






          share|improve this answer
























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f455199%2fapplescript-create-event-in-calendar-how-do-i-remove-the-default-alert%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            It looks like another case of AppleScript getting the unwanted-stepchild treatment.
            I suggest filing a bug with Apple.



            Specifically, the buggy behavior is as follows, as of OS X 10.8.2:



            -- Trying to set ANY properties on the *default* sound alarm fails silently.
            -- Programmatically added alarms: only the trigger interval or date can be set.
            repeat with al in every sound alarm of newEvent
            tell al
            -- Works only on *programmatically added* sound alarms:
            set trigger interval to -770 # The alternative option, `set trigger date to ...`, works as well.
            -- Fails silently on *all* sound alarms, whether it is the default one or a programmatically created one.
            set sound name to "Pop" # `set sound file to ...` fails equally.
            end tell
            end repeat

            -- This only deletes the programmatically added alarms, but never the default one.
            delete sound alarms of newEvent


            Thus, sadly, silencing the default alarm by manipulating its properties is not an option.






            share|improve this answer




























              0














              It looks like another case of AppleScript getting the unwanted-stepchild treatment.
              I suggest filing a bug with Apple.



              Specifically, the buggy behavior is as follows, as of OS X 10.8.2:



              -- Trying to set ANY properties on the *default* sound alarm fails silently.
              -- Programmatically added alarms: only the trigger interval or date can be set.
              repeat with al in every sound alarm of newEvent
              tell al
              -- Works only on *programmatically added* sound alarms:
              set trigger interval to -770 # The alternative option, `set trigger date to ...`, works as well.
              -- Fails silently on *all* sound alarms, whether it is the default one or a programmatically created one.
              set sound name to "Pop" # `set sound file to ...` fails equally.
              end tell
              end repeat

              -- This only deletes the programmatically added alarms, but never the default one.
              delete sound alarms of newEvent


              Thus, sadly, silencing the default alarm by manipulating its properties is not an option.






              share|improve this answer


























                0












                0








                0







                It looks like another case of AppleScript getting the unwanted-stepchild treatment.
                I suggest filing a bug with Apple.



                Specifically, the buggy behavior is as follows, as of OS X 10.8.2:



                -- Trying to set ANY properties on the *default* sound alarm fails silently.
                -- Programmatically added alarms: only the trigger interval or date can be set.
                repeat with al in every sound alarm of newEvent
                tell al
                -- Works only on *programmatically added* sound alarms:
                set trigger interval to -770 # The alternative option, `set trigger date to ...`, works as well.
                -- Fails silently on *all* sound alarms, whether it is the default one or a programmatically created one.
                set sound name to "Pop" # `set sound file to ...` fails equally.
                end tell
                end repeat

                -- This only deletes the programmatically added alarms, but never the default one.
                delete sound alarms of newEvent


                Thus, sadly, silencing the default alarm by manipulating its properties is not an option.






                share|improve this answer













                It looks like another case of AppleScript getting the unwanted-stepchild treatment.
                I suggest filing a bug with Apple.



                Specifically, the buggy behavior is as follows, as of OS X 10.8.2:



                -- Trying to set ANY properties on the *default* sound alarm fails silently.
                -- Programmatically added alarms: only the trigger interval or date can be set.
                repeat with al in every sound alarm of newEvent
                tell al
                -- Works only on *programmatically added* sound alarms:
                set trigger interval to -770 # The alternative option, `set trigger date to ...`, works as well.
                -- Fails silently on *all* sound alarms, whether it is the default one or a programmatically created one.
                set sound name to "Pop" # `set sound file to ...` fails equally.
                end tell
                end repeat

                -- This only deletes the programmatically added alarms, but never the default one.
                delete sound alarms of newEvent


                Thus, sadly, silencing the default alarm by manipulating its properties is not an option.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Oct 16 '12 at 22:55









                mklement0mklement0

                1,3651915




                1,3651915






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f455199%2fapplescript-create-event-in-calendar-how-do-i-remove-the-default-alert%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Plaza Victoria

                    In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

                    How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...