• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Rudimentary MPW simulation with Xcode script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rudimentary MPW simulation with Xcode script


  • Subject: Rudimentary MPW simulation with Xcode script
  • From: Daniel Jalkut <email@hidden>
  • Date: Tue, 24 May 2005 13:48:22 -0700


I have been messing with Xcode today, and I got the idea that it wouldn't be hard to roughly approximate MPW's "inline execution" behavior by defining a script to simply execute the selection.


It's pretty rough, and doesn't handle anything like multiple lines of commands, but it's kind of fun to be able to run arbitrary commands from within a document again.

I thought I'd post it in case anybody is interested in it as a novelty or starting point for a more robust implementation:

#! /usr/bin/perl -w
#
# -- PB User Script Info --
# %%%{PBXName=Execute Selection}%%%
# %%%{PBXInput=Selection}%%%
# %%%{PBXOutput=InsertAfterSelection}%%%
# %%%{PBXKeyEquivalent=@}%%%
#
my $outputString = "";

my @selection = <STDIN>;       # read the selection from standard input

if (!@selection) { return; };  # no chars in selection, nothing to do
print "\r\n";
my $err = system(@selection);
if ($err != 0)
{
    print "error: " . $err . "\r\n";
}

_______________________________________________
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


  • Follow-Ups:
    • Re: Rudimentary MPW simulation with Xcode script
      • From: David Lázaro Saz <email@hidden>
  • Prev by Date: Re: How do I make Xcode SCM ignore the .xcode wrapper?
  • Next by Date: Re: Data Formatters - XCode 2.0
  • Previous by thread: Re: How do I make Xcode SCM ignore the .xcode wrapper?
  • Next by thread: Re: Rudimentary MPW simulation with Xcode script
  • Index(es):
    • Date
    • Thread