1 | F-Script Anywhere 2.0d2 [24 February 2008] |
---|
2 | ======================= |
---|
3 | |
---|
4 | Add a F-Script interpreter to Cocoa applications dynamically. |
---|
5 | |
---|
6 | Written by Nicholas Riley <mailto:fsa@sabi.net> and Robert Chin. |
---|
7 | Obtain updates from <http://web.sabi.net/nriley/software/>. |
---|
8 | |
---|
9 | |
---|
10 | WHAT IS IT? |
---|
11 | ----------- |
---|
12 | |
---|
13 | Ever wanted to inspect a Cocoa applicationÕs objects from the inside? |
---|
14 | Frustrated with using GDB to debug Objective-C? |
---|
15 | |
---|
16 | You need F-Script Anywhere! (with apologies to Guido van Rossum) |
---|
17 | |
---|
18 | |
---|
19 | INSTALLATION |
---|
20 | ------------ |
---|
21 | |
---|
22 | Install F-Script; you can download it at <http://www.fscript.org/>. |
---|
23 | In particular, make sure the framework is installed in a Frameworks |
---|
24 | directory, such as /Library/Frameworks or ~/Library/Frameworks. |
---|
25 | |
---|
26 | F-Script Anywhere 2.0d2 was tested with FScript.framework 2.0a2 and |
---|
27 | Mac OS X 10.5.2 (9C31). If you are using an earlier F-Script version, |
---|
28 | please upgrade. F-Script Anywhere 2.0 requires Mac OS X 10.5 or |
---|
29 | later; if you're using Mac OS X 10.4, download F-Script 1.3.5 |
---|
30 | (20070421) which includes F-Script Anywhere 1.3. |
---|
31 | |
---|
32 | USAGE |
---|
33 | ----- |
---|
34 | |
---|
35 | Open the F-Script Anywhere application. Pick a Cocoa application from |
---|
36 | the list and click Install or press return. F-Script Anywhere will |
---|
37 | either install itself in that application, give you an error message, |
---|
38 | or crash. (Hopefully not the latter!) |
---|
39 | |
---|
40 | Switch to the application, and you should find a ÒFSAÓ menu there. |
---|
41 | Select ÒNew F-Script WorkspaceÓ to display a F-Script workspace. |
---|
42 | This behaves like any other workspace, except it's executing within |
---|
43 | the context of the application. |
---|
44 | |
---|
45 | You can also install F-Script Anywhere by using its dock menu. If |
---|
46 | the frontmost application is a Cocoa application, just pick ÒInstallÉÓ |
---|
47 | from the menu and F-Script Anywhere will install in that application. |
---|
48 | If F-Script Anywhere canÕt install, the menu item will tell you so, |
---|
49 | or F-Script AnywhereÕs icon will bounce to indicate a pending sheet |
---|
50 | explaining the problem. |
---|
51 | |
---|
52 | To remove F-Script Anywhere from an application, quit the application. |
---|
53 | Because of limitations in Apple's Objective-C runtime, it is |
---|
54 | impossible to remove F-Script Anywhere while the application is |
---|
55 | running. |
---|
56 | |
---|
57 | |
---|
58 | BUILDING |
---|
59 | -------- |
---|
60 | |
---|
61 | The source to F-Script Anywhere is included. It has a number of |
---|
62 | dependencies. |
---|
63 | |
---|
64 | 1. Install FScript.framework (see above). |
---|
65 | |
---|
66 | 2. In the "Darwin source" directory, check out Darwin's cctools from |
---|
67 | <http://www.opensource.apple.com/>, untar it and rename the |
---|
68 | directory to "cctools". cd to the libstuff directory and type |
---|
69 | 'make RC_CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" RC_XBS=YES dynamic'. |
---|
70 | |
---|
71 | 3. Put a version of FScript.framework into the Source folder. This |
---|
72 | is used for the F-Script framework auto installer. |
---|
73 | |
---|
74 | 4. Open 'F-Script Anywhere.xcodeproj' in Xcode and build the Application |
---|
75 | target. This target depends on the Bundle and Bundle Loader |
---|
76 | targets, so you don't need to build them separately. You |
---|
77 | shouldnÕt see any errors or warnings, and the F-Script Anywhere |
---|
78 | application (as well as two bundles, which you can ignore because |
---|
79 | they are copied into the application bundle) will appear in the |
---|
80 | build product directory. |
---|
81 | |
---|
82 | If you have any problems building F-Script Anywhere, please let me |
---|
83 | know. |
---|
84 | |
---|
85 | |
---|
86 | FREQUENTLY ASKED QUESTIONS |
---|
87 | -------------------------- |
---|
88 | |
---|
89 | Q. What is F-Script? |
---|
90 | |
---|
91 | A. F-Script is a dialect of Smalltalk which includes a bridge to |
---|
92 | the Objective-C runtime on Mac OS X. It's open-source, and |
---|
93 | very nice. Its author, Philippe Mougin, has written several |
---|
94 | articles on it, and documentation is available from the |
---|
95 | F-Script Web site: |
---|
96 | |
---|
97 | <http://www.fscript.org/> |
---|
98 | |
---|
99 | |
---|
100 | Q. How do you access user interface elements? |
---|
101 | |
---|
102 | A. One way is to access a window and its views programmatically: |
---|
103 | |
---|
104 | > app := NSApplication sharedApplication |
---|
105 | |
---|
106 | > windows := app windows |
---|
107 | |
---|
108 | > windows |
---|
109 | NSCFArray {<NSWindow: 0x186770>, <NSWindow: 0x1ba4a0>, <NSWindow: |
---|
110 | 0x1f0cea0>} |
---|
111 | |
---|
112 | > windows collect: [:each | each title] |
---|
113 | |
---|
114 | error: an instance of NSWindow does not respond to "collect:" |
---|
115 | |
---|
116 | (...a gentle reminder that this is not Smalltalk...) |
---|
117 | |
---|
118 | > windows title |
---|
119 | {'F-Script', '', ''} |
---|
120 | |
---|
121 | (...but F-Script has some tricks of its own...) |
---|
122 | |
---|
123 | > fsw := windows at: 0 |
---|
124 | |
---|
125 | > fswView := fsw contentView |
---|
126 | |
---|
127 | To open an F-Script object browser on fswView, type: |
---|
128 | |
---|
129 | > sys browse: fswView |
---|
130 | |
---|
131 | Or, click ÒNew Browser: Object...Ó, then click on fswView. |
---|
132 | Click 'subviews' in the message list. You can use 'subviews' |
---|
133 | repeatedly on container views if needed. |
---|
134 | |
---|
135 | |
---|
136 | Q. ThatÕs too hard, especially all that scrolling. |
---|
137 | |
---|
138 | A. If you need to access a view (such as a button or text field), menu or |
---|
139 | window, youÕre in luck. Click in an F-Script workspace window, then |
---|
140 | click or choose ÒBrowser for TargetÉÓ from the ÒFSAÓ menu. |
---|
141 | Follow the instructions in the window to select a user interface |
---|
142 | element, view it in an object browser or assign it to a variable. |
---|
143 | |
---|
144 | The F-Script object browser now provides a similar feature: click the |
---|
145 | ÒSelect ViewÓ button. |
---|
146 | |
---|
147 | |
---|
148 | Q. I donÕt like F-ScriptÕs syntax. I don't like the object browser. |
---|
149 | I donÕt like you either. |
---|
150 | |
---|
151 | A. I didnÕt write F-Script. Please address your questions to |
---|
152 | F-ScriptÕs author or the F-Script mailing list. |
---|
153 | |
---|
154 | <http://www.fscript.org/contacts.htm> |
---|
155 | |
---|
156 | Oh, and get lost. |
---|
157 | |
---|
158 | |
---|
159 | Q. My question isn't answered here. |
---|
160 | |
---|
161 | A. That's not a question. But if you have a question about F-Script |
---|
162 | Anywhere, a suggestion or a bug to report, please email it to me at |
---|
163 | <fsa@sabi.net>. I'll get back to you as soon as my schedule will |
---|
164 | allow. Thanks! |
---|
165 | |
---|
166 | |
---|
167 | VERSION HISTORY |
---|
168 | --------------- |
---|
169 | 2.0 - unreleased - Injectable into Cocoa garbage collected apps |
---|
170 | - Requires F-Script 2.0 and Mac OS X 10.5 |
---|
171 | 1.3.1 - 17 October 2007 - Compatible with Mac OS X 10.5 |
---|
172 | 1.3 - 5 May 2006 - Fixed leaking of file handles |
---|
173 | - Removed deprecated F-Script functions |
---|
174 | - New associate option that automatically |
---|
175 | brings up a new browser without an |
---|
176 | interpreter window |
---|
177 | - Auto-inject feature |
---|
178 | 1.2 - 5 January 2004 - fixed window behavior on startup, delaying |
---|
179 | display until launch is complete |
---|
180 | - replaced libPatch with mach_inject and |
---|
181 | SCPatch: provides improved compatibility |
---|
182 | with Mac OS X 10.3 (doesn't crash randomly |
---|
183 | any more!) |
---|
184 | - no longer requires F-Script Anywhere |
---|
185 | application to be running while installed |
---|
186 | in applications |
---|
187 | - F-Script Anywhere can now be installed in |
---|
188 | itself |
---|
189 | - check for F-Script version on startup |
---|
190 | - use new, documented F-Script API for |
---|
191 | identifier validation in associate window |
---|
192 | - prepared for localization |
---|
193 | - enable "Install" button when appropriate at |
---|
194 | application startup |
---|
195 | - fixed focus ring "flicker" on Mac OS X 10.3 |
---|
196 | 1.1.5 - 1 October 2002 - better identify Cocoa vs. Carbon applications |
---|
197 | on Jaguar; added hierarchical window list to |
---|
198 | FSA menu; fixed startup crash on Puma with |
---|
199 | certain Carbon CFM applications |
---|
200 | 1.1.4 - 25 August 2002 - fixed miscellaneous Jaguar issues; worked |
---|
201 | around broken application quit notifications; |
---|
202 | added unique interpreter/associate window titles |
---|
203 | 1.1.3 - 24 July 2002 - added bullseye-menu targeting cursor; added menu |
---|
204 | association; work around bug by stopping capture |
---|
205 | on suspend; added delegate, data source, target, |
---|
206 | cell selection for views; window controller for |
---|
207 | windows |
---|
208 | 1.1.2 - 18 July 2002 - fixed more startup issues with list management; |
---|
209 | properly scale icons of apps which have no |
---|
210 | small icons; added user interface association |
---|
211 | 1.1.1 - 3 July 2002 - fixed inefficiencies responsible for long |
---|
212 | startup time; reorganized Window menu; support |
---|
213 | paths to applications which contain non-ASCII |
---|
214 | characters [Martin Hcker]; added sample code |
---|
215 | to grab UI elements [Philippe Mougin]; cleaned |
---|
216 | up code and distribution layout |
---|
217 | 1.1 - 25 April 2002 - revised terminology; updated for F-Script 1.2; |
---|
218 | zoom to fit in application list; added help |
---|
219 | tags for workspace; focus workspace initially |
---|
220 | 1.0.2 - (unreleased) - minor cleanups, added error messages, updated |
---|
221 | scroll view component for faster UI response, |
---|
222 | removed help menu item because it's useless |
---|
223 | 1.0.1 - 1 March 2002 - corrected message for error 5; libPatch 1.2; |
---|
224 | fixed endless confirmation on window close |
---|
225 | 1.0.1d1 1 February 2002 - added error messages |
---|
226 | 1.0 - 3 February 2002 - added dock menu, URL launching, check for |
---|
227 | F-Script framework, floating window, |
---|
228 | application name in interpreter window title, |
---|
229 | fixed bugs, cleaned up error handling, |
---|
230 | licensed under the GPL (because of ASM code), |
---|
231 | packaged, added Read Me file and license |
---|
232 | 1.0d1 - 1 February 2002 - proof of feasibility, private test version |
---|
233 | |
---|
234 | |
---|
235 | CREDITS |
---|
236 | ------- |
---|
237 | |
---|
238 | Thanks to the following people for their software and generous |
---|
239 | donations of source code: |
---|
240 | |
---|
241 | Philippe Mougin, for F-Script |
---|
242 | Robert Chin, for maintenance and Intel/Leopard porting |
---|
243 | Jonathan 'Wolf' Rentsch and Bertrand Guihneuf, for mach_inject |
---|
244 | Jon Gotow, for SCPatch and lots of advice |
---|
245 | Mike Ferris, for TextExtras |
---|
246 | Apple, for Darwin |
---|
247 | Frank Vercruesse, for ASM |
---|