Firstly, thanks for my previous feedback, it was very helpful.
In an applescript app I’ve written using script editor (I’m on 10.2.8 so I can’t run applescript studio), it ‘stays open’ permenantly. It bothers me, however, that if clicked-and-held in the dock it reports ‘Application not responding’.
is this bad? I want to distribute the script, and I know this would worry your average end user.
Also, is there a UI development ‘kit’ that I can use on 10.2.8? like face-span - what is that like?
Usually, if you see the “app not responding” message is because your app is busy, maybe in a repeat loop or in the middle of a long operation? → so a coding problem
In Jaguar you can install Developer Tools. Sign-up for free at http://connect.apple.com/ and download (in downloads > mac os x) “December 2002 Mac OS X Developer Tools” (it includes Interface Builder and Project Builder, old name of Xcode, the first release of AppleScript Studio). I think all projects you create using PB are updateable and re-openable in Xcode when you need it in a future.
For example, if this is your code:
on idle
delay 5
return 5
end idle
Your app “is not responding” while it is executing the “delay 5” statement, and it “is responding” when it is idle (for 5 seconds, as stated in the “return” statement).
thanks for the advice. I previously downloaded xcode but must have got the wrong version because it wouldn’t run on my mac. OK then, I’ve looked at my script and I still don’t know why its reporting “application not responding” on the dock - since the only time it has its intended effect is ‘on run’ (when I start the app) or ‘on re-open’ (when I click the dock icon when it’s already running).
here’s the script… (it formats the text on the clipboard)…
on run
clean_clip()
end run
on reopen
clean_clip()
end reopen
on clean_clip()
set the message_text to the clipboard
-- next line checks where there is a double return, so I can come back and turn it into a single return in a minute
set the message_text to replace_chars(message_text, (return & return), " *breakhere-clipcleaner* ")
-- next line turns returns into spaces
set the message_text to replace_chars(message_text, return, space)
-- the repeat loop removes all repeated spaces and makes them into a single space
set the doub_space to (space & space)
repeat while (doub_space) is in the message_text
set the message_text to replace_chars(message_text, (doub_space), space)
end repeat
-- these do a bunch more text formatting, removing unnessesary spaces around commas, full stops and brackets.
set the message_text to replace_chars(message_text, space & ",", ",")
set the message_text to replace_chars(message_text, space & ".", ".")
set the message_text to replace_chars(message_text, "(" & space, "(")
set the message_text to replace_chars(message_text, space & ")", ")")
-- finally goes back and takes out the string I inserted and replaces it with a single return
set the message_text to replace_chars(message_text, " *breakhere-clipcleaner* ", return)
-- makes sure the message_text is a string
set the message_text to (the message_text as string)
-- puts it back on the clipboard
set the clipboard to the message_text
--removes all the text formatting with this shell script
do shell script "pbpaste | pbcopy"
end clean_clip
-- replace_chars is cut and pasted from the apple website
on replace_chars(this_text, search_string, replacement_string)
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
return this_text
end replace_chars