Results 1 to 2 of 2
  1. #1
    applescript syntax help

    Member Since
    Apr 10, 2007
    Posts
    313
    applescript syntax help
    Hello, I am working on a script for myself and I am stuck on a couple of things.
    I have it greet me and announce the time on boot but I want it to exclude the seconds from the time when it says it aloud.

    The second problem is that I have it start my favorite apps on boot, which works fine but I want them to start minimized. I am posting the entire script, thanks in advance.


    --say time commands
    -- need to exclude seconds
    set theDate to current date
    set theDay to weekday of theDate
    set theTime to time of theDate

    if the theTime > 0 and the theTime < 43200 then say
    "Good morning Jake! It's " & theDay & "."
    if the theTime > 43199 and the theTime < 57600 then say
    "Good afternoon Jake!"
    if the theTime > 57599 and the theTime < 64800 then say
    "Good evening Jake!"
    if the theTime > 64799 and the theTime < 86400 then say
    "It's " & theDay & " night."
    say "the time is"
    say (time string of (current date))


    tell application "Mail"
    check for new mail


    set unreadCount to unread count of inbox


    if unreadCount is equal to 0 then say
    "You have no new messages!"
    if unreadCount is equal to 1 then say
    "You have a new message!"
    if unreadCount is greater than 1 then say
    "You have " & unreadCount & " new messages!"
    delay 2





    -- app open commands

    tell application "Terminal" to activate
    --tell application "Terminal" to close window 0 I tried this line but it returns errors.




    tell application "Safari" to activate
    --tell application "Safari" to close window 0




    tell application "Firefox" to activate
    --tell application "Firefox" to close window 0



    --check mail commands




    -- lets me know it finished without errors
    say "script end"
    end tell

  2. #2
    applescript syntax help
    Brown Study's Avatar
    Member Since
    Mar 11, 2004
    Location
    Winnipeg
    Posts
    1,964
    Specs:
    G4 Tiger and OS 9
    If the answers depend on more than a few experienced scripters who might come across your post here, try a specialty site, such as macscripter.net, and its forums.

    There doesn't appear to be a search function other than for entire sections of the site, but you can use Google to search for more specific subjects. F'rinstance:

    "check mail" site:macscripter.net
    time site:macscripter.net
    time speak site:macscripter.net
    "close window" site:macscripter.net
    minimize site:macscripter.net

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. syntax error HELP
    By kimsi in forum OS X - Operating System
    Replies: 2
    Last Post: 12-12-2013, 09:32 AM
  2. Syntax help
    By mohibb in forum OS X - Operating System
    Replies: 3
    Last Post: 04-27-2012, 11:48 AM
  3. Automator syntax
    By ghalsk in forum OS X - Operating System
    Replies: 0
    Last Post: 12-03-2009, 09:09 AM
  4. Entourage Syntax error
    By fooddestroyer in forum OS X - Operating System
    Replies: 0
    Last Post: 11-16-2007, 04:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •