image
image

Go Back   macosx.com > Design, Media, Programming & Scripting > Software Programming & Web Scripting

Reply
 
Thread Tools
  #1  
Old August 25th, 2007, 05:16 PM
Registered User
 
Join Date: Feb 2007
Posts: 15
kyiosus is on a distinguished road
AppleScript cocoa app freezes when running shell script

Hello,

I'm trying to make an AppleScript based cocoa application with Xcode, which runs shell scripts. The problem is, I have a progress bar which is meant to run while performing the shell script, but the whole app freezes while the script runs, and then unfreezes when the script is done executing. Here is a code snippet:

Code:
on clicked theObject
   if title of theObject is "Start" then
      do shell script "cp -r ~/Sites ~/Desktop/Sites"
      start progress indicator "bar" of window "Main"
      set title of theObject to "Stop"
   else if title of theObject is "Stop" then
      set title of theObject to "Start"
      stop progress indicator "bar" of window "Main"
   end if
end clicked
The above shell script is used for testing, but I will still be doing the cp command when completing the app. Is there anyway to fix this? Thanks for the help!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 05:12 PM.


Mac Support® Version 3.7.0 Beta 5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.