The following seems to work:

1) Create the following script:
#!/bin/zsh
CLANG_OUTFILE=${BB_DOC_PATH%%\.m}.out
clang -x objective-c -o $CLANG_OUTFILE $BB_DOC_PATH
$CLANG_OUTFILE

2) Save it (with extension .sh, although this might not be necessary) in 
the Scripts Folder (typically ~/Library/Application Support/BBEdit/Scripts)

3) Write and save (somewhere on disk) the Objective-C source code  (I used 
'.m' suffix which the script will remove and replace with '.out')

4) With the saved source file as the active window in BBEdit, select the 
script from the script menu. The results should appear in the Unix Script 
Output.log window.



On Friday 12 April 2024 at 13:33:05 UTC+1 Derek Yates wrote:

> I am learning Objective-C and would like to be able to compile and run 
> code snippets using BBEdit. I presume I need to use the Run command and 
> somehow send the snippet to clang using a shell script. 
>
> I can run Python snippets, but can't figure out how to do the same for 
> Objective-C. For a start, all the shebang menu items are grey (presumably 
> because Objective-C is not an interpreted language).
>
> Can't find anything online or in the manual on how to do this. Can someone 
> point me in the right direction?
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or believe that the application isn't working correctly, please email 
"[email protected]" rather than posting here. Follow @bbedit on Mastodon: 
<https://mastodon.social/@bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/be908d34-e4c5-40b1-b081-2d7fcefc4b2fn%40googlegroups.com.

Reply via email to