Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text Field Troubles



Not sure but you have said the error message is

A “ can't go after this identifier

That would suggest you have a curly double quote (“) in there somewhere, not the straight quote - inch mark - you want ("). text field “whatever” won't compile, text field "whatever" will. That said, your sample code doesn't appear to have curly quotes in it so, as I say, I am not sure. I suggest as a first step just double-checking that you haven't got any curly quotes anywhere (they might have come in if you have copied and pasted via a word-processor, for instance?).

As an aside, it is generally recommended that when you want to put a value into a text field you say "set content of text field" rather than "set contents of text field". (most of the time either will work, but there are some circumstances when "contents" doesn't so I always use "content" for that to be on the safe side).

Philip



On 28 Sep 2006, at 06:17, Emory Dunn wrote:

I am new to Applscript studio and am writing a basic iTunes controller. I have got most of it working but I can not set the track name and artist info. I  have looked at several places for help- the XCode documentation and other websites and as far as I can tell am doing everything correctly but whenever I try and save the .scpt file it says A “ can't go after this identifier. the script I have written is as follows: the problem areas in red.

using terms from application "iTunes"

tell application "iTunes"

if exists (database ID of current track) then

set cur_song to the name of the current track

set cur_artist to the artist of the current track

else

set cur_song to ""

set cur_artist to "No song currently playing."

end if

end tell
end using terms from

tell window "tunecommand"

set the contents of text field "title" to cur_song

set the contents of text field "artist" to cur_artist
end tell




Emory C. Dunn

email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden

References: 
 >Text Field Troubles (From: Emory Dunn <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.