Change 14075: Doc updates
[email protected] (Chris Nandor) Fri, 4 Jan 2002 16:53:46 -0500
| Newsgroups | perl.perl5.changes.mac |
|---|---|
| Message-ID | <p05100303b85bd4a8c38a@[10.0.1.177]> |
Change 14075 by pudge@pudge-mobile on 2002/01/04 20:42:06 Doc updates Affected files ... .... //depot/maint-5.6/macperl/macos/ext/MacPerl/MacPerl.pm#3 edit .... //depot/maint-5.6/macperl/macos/ext/MacPerl/OSA.xs#3 edit Differences ... ==== //depot/maint-5.6/macperl/macos/ext/MacPerl/MacPerl.pm#3 (text) ==== Index: perl/macos/ext/MacPerl/MacPerl.pm --- perl/macos/ext/MacPerl/MacPerl.pm.~1~ Fri Jan 4 13:45:08 2002 +++ perl/macos/ext/MacPerl/MacPerl.pm Fri Jan 4 13:45:08 2002 @@ -141,16 +141,24 @@ =item MacPerl::DoAppleScript(SCRIPT) -Execute an AppleScript script. +Execute an AppleScript script. Returns the text of the script result. +Script error strings are returned in C<$@>. Example: - MacPerl::DoAppleScript(<<END_SCRIPT); - tell application "MacPerl" - make new Window - copy "Inserting text the hard way." to character 1 of front Window - end tell - END_SCRIPT + my $text = MacPerl::DoAppleScript(<<END_SCRIPT) or die $@; + tell application "BBEdit" + make new Window + copy "Inserting text the hard way." to character 1 of front Window + get (characters 1 through 9 of front Window) as text + end tell + END_SCRIPT + +B<Note>: calling DoAppleScript to tell MacPerl to do something via +AppleScript may yield unpredictable results, especially when waiting +on MacPerl to reply, such as when stringing multiple events together, +or expecting data to be returned. Try wrapping the "tell" block in +"ignoring application responses" / "end ignoring" if necessary. =item MacPerl::Reply(ANSWER) ==== //depot/maint-5.6/macperl/macos/ext/MacPerl/OSA.xs#3 (text) ==== Index: perl/macos/ext/MacPerl/OSA.xs --- perl/macos/ext/MacPerl/OSA.xs.~1~ Fri Jan 4 13:45:08 2002 +++ perl/macos/ext/MacPerl/OSA.xs Fri Jan 4 13:45:08 2002 @@ -1,4 +1,4 @@ -/* $Header: /cvsroot/macperl/perl/macos/ext/MacPerl/OSA.xs,v 1.2 2001/04/16 04:45:15 neeri Exp $ +/* $Header: /cvsroot/macperl/perl/macos/ext/MacPerl/OSA.xs,v 1.3 2001/12/19 22:54:15 pudge Exp $ * * Copyright (c) 1995 Matthias Neeracher * @@ -6,6 +6,9 @@ * as specified in the README file. * * $Log: OSA.xs,v $ + * Revision 1.3 2001/12/19 22:54:15 pudge + * Make DoAppleScript return errors in $@ + * * Revision 1.2 2001/04/16 04:45:15 neeri * Switch from atexit() to Perl_call_atexit (MacPerl bug #232158) * End of Patch.