Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > What is wrong with this AppleScript?

What is wrong with this AppleScript?
Thread Tools
Dedicated MacNNer
Join Date: Apr 2002
Location: Boston, MA
Status: Offline
Reply With Quote
Aug 31, 2002, 04:02 PM
 
I am just starting to learn AppleScript Studio, and I ask what is wrong with this simple little script written in ProjectBuilder:

-- Applescript Studio App.applescript
-- Applescript Studio App

on clicked theObject
tell window of theObject
try
set theFirst to contents of text field "txtfield1" as text
set contents of text field "txtfield2" to theFirst
on error set contents of text field "txtfield2" to 0
end try
end tell
end clicked

on should quit after last window closed theObject
return true
end should quit after last window closed

I made a small thing with Interface builder, with two text fields both names as written above. When I try to build this, it says "Build failed (see build log for details) Could somebody help me out here?
Revenge is a meal best served cold.
     
Mac Enthusiast
Join Date: Nov 2001
Status: Offline
Reply With Quote
Aug 31, 2002, 08:24 PM
 
The error "Build failed (see build log for details)" sounds like it isn't to do with your AppleScript. A common cause of this error is missing files in your project. Check for any red-coloured titles; this indicates that it's missing. It would be helpful if you could post the build log (it's underneath the error pane).
     
Vash  (op)
Dedicated MacNNer
Join Date: Apr 2002
Location: Boston, MA
Status: Offline
Reply With Quote
Aug 31, 2002, 09:12 PM
 
here is the full error log:

/usr/bin/jam -d1 JAMBASE=/Developer/Makefiles/pbx_jamfiles/ProjectBuilderJambase JAMFILE=- build ACTION=build _DEFAULT_GCC_VERSION=3.1 BUILD_STYLE=Development "CPP_HEADERMAP_FILE=/Users/kps/Intermediate Builds/Applescript Studio App.build/Applescript Studio App.build/Applescript Studio App.hmap" "SRCROOT=/Users/kps/Applescript Studio App" "OBJROOT=/Users/kps/Intermediate Builds" "SYMROOT=/Users/kps/Applescript Studio App/build" "DSTROOT=/tmp/Applescript Studio App.dst"
...updating 23 target(s)...
OSACompile /Users/kps/Applescript Studio App/build/Applescript Studio App.app/Contents/Resources/Scripts/Applescript Studio App.scpt

/usr/bin/osacompile -d -i /System/Library/Frameworks/AppleScriptKit.framework -U "Applescript Studio App.applescript" -o "/Users/kps/Applescript Studio App/build/Applescript Studio App.app/Contents/Resources/Scripts/Applescript Studio App.scpt" "Applescript Studio App.applescript"

...failed OSACompile /Users/kps/Applescript Studio App/build/Applescript Studio App.app/Contents/Resources/Scripts/Applescript Studio App.scpt ...
Revenge is a meal best served cold.
     
Mac Enthusiast
Join Date: Nov 2001
Status: Offline
Reply With Quote
Sep 1, 2002, 12:22 AM
 
So it is a problem with the AppleScript. I have to say this isn't my area of expertise, sorry .
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:43 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2