Applescript and interface won't run together

I am creating a Cocoa Applescript application, and I have an applescript to make speech recognition server listen for commands to use as input.  I also have a small window that should appear at the top.  When I run the application, the speech recognition window appears and works like it is supposed to.  Sometimes the window I created doesn't show up until I quit the applescript part of the program, or it is gray and unusable until I quit the applescript part.  I want them to run side-by-side.  I am aiming for the speech recognition window appearing like normal, and the other window appearing at the same time (or close to the same time) and both working.

whoops.  Sorry.  that is the wrong code.  The code I just posted was some startup code.  It's also in this script. This is the right code. Its a bit long.
try
          set startvol to do shell script "cat ~/alphaassistantdata/startvol.txt "
  set volume output volume startvol
end try
set shouldseyi to "Yes"
set mc1 to "false"
set mcexists to get "Minecraft.app"
try
          do shell script "ping -o www.apple.com"
          set isonline to "true"
on error
          set isonline to "false"
end try
set sysinfo to system info
set osver to system version of sysinfo
set ver to "1.2.1"
set shouldwearing to "0"
--get web's version
if isonline is "true" then
          set webver to do shell script "curl http://alphateam2.weebly.com/uploads/1/2/2/1/12215941/version.txt"
          tell application "Finder"
                    if ver is greater than webver then
                    else
                              set shouldupdate to the button returned of (display dialog "You are running an outdated version of Alpha Assistant. Version " & webver & " is available.  Would you like to download the update? " buttons {"Yes", "No"})
                              if shouldupdate is "Yes" then
                                        tell application "Finder" to set the clipboard to "http://alphateam2.weebly.com/uploads/1/2/2/1/12215941/alpha_assistant.zip"
                                        tell application "System Events"
                                                  tell application "Safari" to activate
  keystroke "l" using {command down, option down}
  keystroke "v" using command down
                                                  move file "AlphaAssistant.zip" of "Downloads" to desktop
                                        end tell
                              end if
                    end if
          end tell
end if
repeat
          try
                    do shell script "ping -o www.apple.com"
                    set isonline to "true"
          on error
                    set isonline to "false"
          end try
          if isonline is "true" then
                    set CityCode to 2424766
  --temperature format
                    set t_format to "F"
  --voiceover format
                    set v_format to "S"
  --say present condition
                    set a_format to "Y"
                    set IURL to "http://weather.yahooapis.com/forecastrss?w=" & CityCode
                    set file_content to (do shell script "curl " & IURL)
  --looking for the line with actual condition
                    set theText to text ((offset of "yweather:condition" in file_content) + 1) thru -1 of file_content
                    set sub_1 to text ((offset of "\"" in theText) + 1) thru -1 of theText
  --today conditions found
                    set actual_condition to text 1 thru ((offset of "\"" in sub_1) - 1) of sub_1
  --looking for actual temperature temperature
                    set sub_1a to text ((offset of "temp=" in sub_1)) thru -1 of sub_1
                    set sub_1b to text ((offset of "\"" in sub_1a) + 1) thru -1 of sub_1a
                    set actual_temp to text 1 thru ((offset of "\"" in sub_1b) - 1) of sub_1b
                    if t_format is equal to "C" then
                              set actual_temp to (5 / 9) * (actual_temp - 32) as integer
                    end if
  --looking for today forecast
                    set theText to text ((offset of "yweather:forecast" in file_content) + 1) thru -1 of file_content
                    set sub_2 to text ((offset of "\"" in theText) + 1) thru -1 of theText
  --looking for today forecast condition (a bit tricky)
                    set sub_3 to text ((offset of "text" in sub_2) + 1) thru -1 of sub_2
                    set sub_4 to text ((offset of "\"" in sub_3) + 1) thru -1 of sub_3
                    set today_forecast to text 1 thru ((offset of "\"" in sub_4) - 1) of sub_4
          end if
          set doesexist to "true"
          set alphausername to do shell script "cat ~/alphaassistantdata/name.txt "
          tell application "SpeechRecognitionServer"
  activate
          end tell
          try
                    if shouldseyi is "yes" then
                              say "Hello!  What could I do for you, " & alphausername & "? "
                              set shouldseyi to "no"
                    end if
          on error
                    say "Hello! What could I do for you?"
          end try
          tell application "SpeechRecognitionServer" to set theResponse to listen for {"Leave", "Hi", "Show me mr.Krol's website", "Report a bug", "Leave", "Open Mr.Krol's website", "Edmodo", "Open Edmodo", "You're Awesome", "IXL", "I found a bug", "What is your name", "What is the weather like", "thankyou", "Am I making good grades", "How are my grades", " Leave now", "Go to MMS website", "MMS", "SBISD", "Go to SBISD website", "Open IXL", "Show me the math textbook", "Math textbook", "Hello", "Thanks", "What's the weather like", "What is the weather like", "AlphaAssistant", "Good", "Thats Good", "Open iMovie", "Edit a video", "You're Evil", "You are evil", "Open Awesomeware", "Open AlphaTeam", "Open Minecraft", "goodbye", "Safari", "Open Safari", "You're Ugly", "You are ugly", "Where do you live", "Shutup", "Listen", "Listen to me", "What is my name", "Who am I", "Call me something else", "You're nice", "You are nice", "Okay", "Hows you're day", "Who are you", "Do you know Siri", "Testing 1234", "What is your favorite team", "SkyDoesMinecraft", "I love you", "Iron hand", "Do you know iron hand", "Should I wear shorts", "Test for connection", "What is the Temprature", "What version am I running", "Resset my volume", "You can talk now"} displaying "Version 1.0" with prompt ""
  --Bug Report
          if theResponse is "Report a bug" or theResponse is "I found a bug" then
                    say "You can send bug reports to us through our contact page.  Would you like to go there?"
                    tell application "SpeechRecognitionServer" to set theResponse to listen for {"yes", "No"}
                    set openbugsite to "1"
                    if openbugsite is "1" and theResponse is "Yes" then
                              tell application "Safari"
                                        say "Okay.  I'll open up our contact page."
                                        open location "http://alphateam2.weebly.com/contact.html"
                                        set openbugsite to "0"
                              end tell
                    end if
          end if
          if theResponse is "No" then
                    say "Okay.  I won't open the contact page."
          end if
  --Show Mr.Krol's Site
          if theResponse is "Show me mr.Krol's website" or theResponse is "Open Mr.krol's website" then
                    say "i will show you Mister krol's website"
                    tell application "Safari"
                              open location "http://mms.springbranchisd.com/Staff/Teachers/Mathematics/JackKrol6thGrade/tabid /29065/Default.aspx"
                    end tell
          end if
  --Respond to "hello"
          if theResponse is "Hi" or theResponse is "Hello" then
                    say "Alpha Assistant says hi"
          end if
  --Leave command
          if theResponse is "Leave" or theResponse is "Leave now" or theResponse is "kill" or theResponse is "goodbye" then
                    say "okay.  Bye"
                    tell application "SpeakableItems"
  quit
                    end tell
                    exit repeat
                    tell me to quit
          end if
  --Edmodo
          if theResponse is "Edmodo" then
                    tell application "Safari"
                              say "I'll open Edmodo."
                              open location "http://www.edmodo.com"
                    end tell
          end if
  --Respond to "You're Awesome" command
          if theResponse is "You're awesome" then
                    say "Thanks!  You're pretty cool yourself!"
          end if
  --Open Edmodo
          if theResponse is "Open Edmodo" then
                    say "I'll open Edmodo"
                    tell application "Safari"
                              open location "http://www.edmodo.com"
                    end tell
          end if
  --Response to "what is your name command"
          if theResponse is "What is your name" or theResponse is "Who are you" then
                    say "My name is Alpha Assistant."
          end if
  --Response to "what is the weather like command"
          if theResponse is "What is the weather like" or theResponse is "What's the weather like" then
  --this is the city code. Search the code for your city on http://weather.yahoo.com/
                    set CityCode to 2424766
  --temperature format
                    set t_format to "F"
  --voiceover format
                    set v_format to "S"
  --say present condition
                    set a_format to "Y"
                    set IURL to "http://weather.yahooapis.com/forecastrss?w=" & CityCode
  --downloading the file using curl
                    set file_content to (do shell script "curl " & IURL)
  --looking for the line with actual condition
                    set theText to text ((offset of "yweather:condition" in file_content) + 1) thru -1 of file_content
                    set sub_1 to text ((offset of "\"" in theText) + 1) thru -1 of theText
  --today conditions found
                    set actual_condition to text 1 thru ((offset of "\"" in sub_1) - 1) of sub_1
  --looking for actual temperature temperature
                    set sub_1a to text ((offset of "temp=" in sub_1)) thru -1 of sub_1
                    set sub_1b to text ((offset of "\"" in sub_1a) + 1) thru -1 of sub_1a
                    set actual_temp to text 1 thru ((offset of "\"" in sub_1b) - 1) of sub_1b
                    if t_format is equal to "C" then
                              set actual_temp to (5 / 9) * (actual_temp - 32) as integer
                    end if
  --looking for today forecast
                    set theText to text ((offset of "yweather:forecast" in file_content) + 1) thru -1 of file_content
                    set sub_2 to text ((offset of "\"" in theText) + 1) thru -1 of theText
  --maximum and minimum temperatures found
                    set today_min_temp to word 9 of sub_2
                    set today_max_temp to word 12 of sub_2
                    if t_format is equal to "C" then
                              set today_min_temp to (5 / 9) * (today_min_temp - 32) as integer
                              set today_max_temp to (5 / 9) * (today_max_temp - 32) as integer
                    end if
  --looking for today forecast condition (a bit tricky)
                    set sub_3 to text ((offset of "text" in sub_2) + 1) thru -1 of sub_2
                    set sub_4 to text ((offset of "\"" in sub_3) + 1) thru -1 of sub_3
                    set today_forecast to text 1 thru ((offset of "\"" in sub_4) - 1) of sub_4
  --looking for tomorrow forecast
                    set sub_5 to text ((offset of "yweather:forecast" in sub_4) + 1) thru -1 of sub_4
                    set sub_6 to text ((offset of "\"" in sub_5) + 1) thru -1 of sub_5
  --maximum and minimum temperatures found
                    set tomorrow_min_temp to word 9 of sub_6
                    set tomorrow_max_temp to word 12 of sub_6
                    if t_format is equal to "C" then
                              set tomorrow_min_temp to (5 / 9) * (tomorrow_min_temp - 32) as integer
                              set tomorrow_max_temp to (5 / 9) * (tomorrow_max_temp - 32) as integer
                    end if
  --looking for tomorrow forecast condition (a bit tricky)
                    set sub_7 to text ((offset of "text" in sub_6) + 1) thru -1 of sub_6
                    set sub_8 to text ((offset of "\"" in sub_7) + 1) thru -1 of sub_7
                    set tomorrow_forecast to text 1 thru ((offset of "\"" in sub_8) - 1) of sub_8
  --VoiceOver Section
                    set myTime to time string of (current date)
                    set myParts to words of myTime
                    set mySpeak to (item 1 of myParts) & " " & (item 2 of myParts) & " "
                    if a_format is equal to "Y" then
                              say "Outside it is, " & actual_condition & ", and " & actual_temp & " degrees "
                    end if
                    if v_format is equal to "L" then
                              say "Today: " & today_forecast & ". Temperature: between " & today_min_temp & " and " & today_max_temp & " degrees.
          Tomorrow: " & tomorrow_forecast & ". Temperature: between " & today_min_temp & " and " & today_max_temp & " degrees"
                    else
                              say "Today: " & today_forecast & ", between " & today_min_temp & " , and " & today_max_temp & " degrees.
           Tomorrow: " & tomorrow_forecast & ", between " & tomorrow_min_temp & " ,and " & tomorrow_max_temp & " degrees"
                    end if
          end if

Similar Messages

  • I have a Mac Book Pro and run Ver 10.5.8.  I bought iLife today and it won't run on less than 10.6.3.  How do I upgrade?

    I have a Mac Book Pro and run Ver 10.5.8.  I bought iLife today and it won't run on less than 10.6.3.  How do I upgrade?

    If you do, it will be shipped to you on DVD unless someone from Apple tells you otherwise.
    (58671)

  • I have Mac0s x10.4.11 with itune 9, I have purchased apple tv and it won't run because i need itunes 10.2 can anyone suggest a solution

    I have Mac0s x10.4.11 with itune 9, I have purchased apple tv and it won't run because i need itunes 10.2 can anyone suggest a solution

    Upgrade to Leopard.  Better yet, Snow Leopard if your Mac is an Intel model (you don't say much about the computer which makes this hard to make suggestions).

  • Java JDK 7 u17 won't install and Eclipse won't run past boot logo.

    Java JDK 7 u17 won't install and Eclipse won't run past boot logo. Eclipse Classic used to work fine for awhile. I haven't used it for a month or two and tried to boot it, Eclipse won't run past boot logo. It looks like JDK is not even there anymore. JDK won't install successfully. I have Mac OS X 10.8.3.
    I tried removing Java, re-download JDK multiple times.. same results.
    MyComputer-MacBook-Air:~ MyComputer$ java -version
    java version "1.7.0_17"
    Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
    Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

    Paul Adare is correct in saying that you cannot "upgrade" from 32-bit to 64-bit. You can, however, backup your files and reload them onto your PC.
    Given that you are able to boot Windows 7 after the failure to install Windows 10 Technical Preview, it is apparent that you are not formatting the drive during your clean installation. There are a number of potential issues an existing configuration can
    cause, such as preventing Windows Setup from registering boot files, modifying partitions, or moving an existing installation and data to the windows.old folder. I would recommend removing the partitions from your drive (note: this will erase any data remaining
    on the hard disk) during installation to ensure that Windows Setup has a fresh hard drive to install to. If you continue to experience errors, two other factors to take into consideration are:
    Does your system use a storage controller that requires loading a driver during Windows Setup?
    Is the hardware malfunctioning? Do the hard disk and memory pass testing software like Windows Memory Diagnostic or chkdsk?
    Reference
    this article for more information.
    Hessam
    Windows Outreach Team- IT Pro
    Windows for IT Pros on TechNet

  • I have repeatedly installed and uninstalled Microsoft Silverlight, I have followed every thing out there and uninstalled from various folders.  It still states the program is there and it won't run.  This is also happening with my coupon printer that word

    I have repeatedly installed and uninstalled Microsoft Silverlight, I have followed every thing out there and uninstalled from various folders.  It still states the program is there and it won't run.  This is also happening with my coupon printer that word

    Copied from a page that helped me:
    I followed someone else's advice and found all the silverlight files in "INVISIBLE FILES".
    In the Finder, choose File > Find or press Command (⌘)-F.
    From the far-left pop-up menu (labeled “Kind”), choose Other.
    In the list of search attributes, select the “File invisible” checkbox, and then click OK.
    In the related menu, choose Invisible Items.
    once loaded go to folder Private
    then to folder VAR
    then folder db
    then folder Receipts
    scroll to any com.microsoft.silverlight item and delete. there are a bunch of them.
    close, restart and install silverlight.

  • Just got a new iPhone and now the phone and iPad won't sync together

    I just got a new iPhone bc of switching to AT&T. Now the phone and iPad won't sync together. Ie. start a text on one and continue with the other

    Do you mean tether?
    iOS: Understanding Personal Hotspot
    http://support.apple.com/kb/HT4517
    Use Bluetooth to tether your iPhone, iPod touch, or iPad
    http://www.macworld.com/article/1159258/bluetooth_tethering.html
    How to Connect an iPad to an iPhone Via Bluetooth Tethering
    http://techtips.salon.com/connect-ipad-iphone-via-bluetooth-tethering-25472.html
     Cheers, Tom

  • Video images are garbled and colors are all run together

    Just got a new computer and downloaded newest version of quicktime. I can't watch any videos/webcasts etc. The sound is fine and the video plays but the screen is "garbled" and the colors are all off/run together?
    I can play a dvd fine
    Dont know much about computers and Dell would not help me....any ideas?

    I am having a similar problem and tried the same fix and it did not work for me either. In my case the video plays for a few seconds then get choppy but the audio is fine. Someone on this site suggested that my machine does not have enough to play the H.264 codec. I do have an older machine a compaq 1.20 GHz , 512 MB Ram running XP home sp2. It should be able to run a video. After all I am not on a 486 machine. I finally had to back out of the QT 7.1.6 and currently running QT 6.5.2. It works fine for me at least at this point. But of course now that means I cannot look at videos using the latest format.

  • I paid for limbo and it won't run. Can I get a refund?

    Didn't realize limbo won't run on my 2008 macbook.
    It's still a speedy machine, I don't understand why it's not supported.
    Anyway, I've spent the money now, can I get a refund do you think?
    Thanks,
    Jesse

    Sorry Jesee, but Apple's policy states that, "all sales are final" >  iTUNES STORE - MAC APP STORE -TERMS AND CONDITIONS

  • Dreamweaver and Fireworks won't run at the same time

    Recently, I've run into a problem where I cannot run Dreamweaver and Fireworks at the same time.
    I have Dreamweaver CS4 & Fireworks CS4, which I can still run at the same time.
    However when I run Dreamweaver CS5.5 and try to launch Fireworks CS5.1 I get a C++ Runtime error in FW CS5.1.
    And when I run Dreamweaver CS6 and try to launch Fireworks CS6, Fireworks CS6 freezes before fully loading.
    If I run DW CS6 and launch FW CS4, I can get them both to run together, but when I close FW4, DW CS6 crashes.
    Any suggestions would most appreciated.
    David

    Historically, I've always kept prior versions installed because sometimes, albeit infrequently, I need to access extensions that aren't compatible with the newer versions of CS. Since I can run DW & Fireworks CS4 together, I'm inclined to leave them installed.
    I've thought about uninstalling CS 5, but I don't think that would resolved my issue. I've already tried most of what's in the Adobe troubleshooting suggestions save for creating a new administrator account.
    I think I'll hobble along with my current workarounds since I'll be migrating to a new computer very soon, which should acomplish what creating a new administrator account would. I'll probably limit the reinstall to CS 6 to eliminate any issues that might be related to having multiple versions installed, which in reality shouldn't be an issue because again, I've always done that successfully in the past.
    Thanks for the suggestion just the same.

  • Firefox 24 and 25 won't run on server identities?

    I downloaded the last update, 24, which worked fine on local identities. When I try to open it in a server/network identity, it never opens, just hangs - I tried opening in safe mode (opt key + open, choose safe mode) and it acts like it will open, but never loads, and I can't click any buttons on the toolbar (or I can click one, but nothing ever loads). Resetting doesn't work either. It does the same thing on all computers, only server identities.
    I've tried creating a new profile, deleting old profiles, changing places suffixes to ".old", deleting prefs file - nothing worked. Firefox never opens, so I can't do any of the support related to the toolbar.
    I think it's related to an add-on, because it first crashed when trying to find compatibility with add-ons. It won't run in safe mode, though, so I can't tell.
    My next step is going to be trying to find where all the add-ons are located, and delete them manually, but I'm not sure where to start.
    If anyone has any other advice, that would be great!

    Hi,
    Thanks, but it didn't work~~
    I tried to delete the extensions from the folder first, but when I tried to open firefox, it had the same problem.
    I actually removed both the Mozilla folder and the Firefox folder as a last resort, and it's still not working.
    The window pops up, with the "bookmarks and history system will not be functional... Some security software can cause this problem" error message. The "Learn More" button is not clickable.
    I've disabled all security software and even my firewall, and it's still happening. My extensions/addons are deleted.

  • Why did you quit supporting Mac OSX 10.4 ? I downloaded you update and it won't run.

    I accepted your last online upgrade request and it worked for basic browsing, but the Comcast mail page stopped working correctly (the buttons: Save as Draft, Delete, Add attachment, etc. are inactive).
    Thinking it was corrupted, I deleted the current version on my machine and installed the latest download and it tells me it won't run on this version of Mac OS.

    Firefox 3.6.23 is still supported secure and will work with OSX 10.4
    * see [[installing a previous version of firefox]]
    * download from http://www.mozilla.org/firefox/all-older.html
    Note do NOT use any options that say delete user settings, you will loose all profile information for all normally installed versions of firefox, so that is pass words and bookmarks etc disappear.
    You mention Comcast
    Note IDvault sometimes provided by Comcast has been associated with Firefox crashes (bug 684748) consider
    * ensuring you have the latest version of that software if you use it <br/> (the problem may be solved in the latest versions)
    * disabling or uninstalling the software if it is a problem

  • The update didn't update; I downloaded the whole instead as instructed and it won't run. Now what?

    I am looking for advice: I wanted to update firefox - the updates (it described itself as 'security') failed. I looked on this website for advice. It said to download the whole version. I did this and the file won't run. I cannot update the browser or load on a new version.
    This is raising red flags in my brain (wrongly or rightly). I know of all sorts of things I could try but having had security issues recently, I would appreciate guidance / wisdom on the matter. I may be paranoid but it looks like there is something wrong.
    The old version of my browser is running ok for now.
    Please help.

    Try this:
    *Download the full Firefox installer and save the file to the desktop<br>https://www.mozilla.org/en-US/firefox/all.html
    *Start the installation with a double-click on the desktop icon
    If you keep having problems then disable your anti-virus temporarily.

  • ITunes updated to 7.6 and now won't run....

    it said that the older version of iTunes could not be removed and now won't let me open the one that's on my computer.
    it says that "This action is only valid for products that are currently installed.".
    i tried reinstalling it from the site and it says the same thing, it couldn't remove the older version.
    Message was edited by: tator-tot

    I did a system restore under the accessiblity option under accesories in the start menu.
    It took a very long time but it at least let me get my itunes back with no errors.
    I'm not sure what the problem was but now it's working so i'm not complaining.
    I'm not updating to 7.6 until I absolutelly have to. Hopefully, they will work out all the kinks before I have to update to it.

  • HT1926 Tried to install latest iTunes update but get "A program is trying to illegally access C+Runtime..." and iTunes won't run

    Tried to install latest iTunes update, but got "A program is trying to illegally
    access C+ Runtime file.." and iTunes won't launch. Tried latest Windows update
    Service Pack and no joy.

    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • Paid for limbo and it won't run

    any sugg
    estions

    are you sure your MacBook Air has a sufficient graphics card? I know the MacBook with Intel GMA X3100 won't run the game...
    The oldest version of the MacBook Air (2008) also uses the Intel GMA X3100, so if you have that model, you can't run the game.

Maybe you are looking for

  • Error in opening idm screen

    HI I have this problem while trying to login to the IDM screen , java.lang.IllegalStateException: Error attempting to decrypt: Cannot find any provider supporting DESede/ECB/NoPadding I have no clue what this is can any one please help me with this .

  • How do i check if my iPhone insurance plan

    can some one help here pls

  • Recommended Upgrade path for Apex 3.1.1

    Hi Everyone, just wondering what the recommended upgrade path from Apex 3.1 to 3.1.1 is. Is it just installing the Patch or is there an upgrade option for the full-3.1.1-version? The reason i'm asking is not everyone has access to metalink and can th

  • How can I permanently disable Color Correction & Premultiplying of Alphas?

    How can I disable these destructive and needless features in Quartz Composer's (using an image splitter to combine it with automator, so that little checkbox is not there) & Preview? I cannot have these features with the images I'm manipulating, and

  • Won't open my user name

    when I turn on my computer it goes to the opening screen and when I click on my name a small windown pops up that has the "Applications" icon and says that it can't open my user name. it doesn't say why or how to fix it, just that it doesn't work. I