Re: XCode Scripts Menu item examples
Re: XCode Scripts Menu item examples
- Subject: Re: XCode Scripts Menu item examples
- From: Matt Neuburg <email@hidden>
- Date: Mon, 23 Nov 2009 09:51:14 -0800
- Thread-topic: XCode Scripts Menu item examples
On Sun, 22 Nov 2009 09:34:12 -0500, Motti Shneor <email@hidden> said:
>Hello.
>
>Does anyone know where I can find example AppleScripts for XCode, such that I
can use within the XCode scripts menu?
>
>Apple provides only 3 such scripts (Delete Line, Move Line Up and Move Line
Down) that all implement one simple thing - manipulating text on the frontmost
open text window.
>
>However, I want to know what is available to the script when run, in terms of
XCode objects --- how can I know from within the script
>(there's no "Tell application "XCode" line there...
>
>how many projects are open? (set myCount to (count projects)) results in an
error, ---- some class cannot be cast to another cast...
>
>Any hints? Documentation links? User forums? Downloads? Help please.
You seem to be asking specifically about AppleScript. So... If your script
is running in the Xcode Scripts menu, you don't *need* a tell block, because
Xcode is the default target (and the terms block, which you can see in the
examples, makes certain that the terminology is resolved); nothing stops you
from using one, though. Alternatively, you can run your script form
elsewhere.
As for your specific example, this works fine on my machine:
tell application "Xcode" to count projects
It sounds as if the real problem is that you don't know AppleScript? But in
that case, the AppleScript-Users list might be a better place to ask
questions; of course, my solution would be, learn the language (i.e. read my
book, perhaps) and then just study the dictionary and experiment like crazy,
the usual heuristic.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden