[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Re: MacPerl applescript command: Save Window



> Hi,
>
> I have a question about MacPerl's applescript command 'Save Window'
>
> > Save: Save Window
> > 	Save  Window  -- Window to save
> > 		[in  alias]  -- Where to save the file.
> > 		[as  Text/Droplet/Runtime]  -- How to save the file.
> >
>
>
> What about saving the Window as CGI Script or BBEdit Extension? What
>would be the correct parameters?
>
> Stef


Hi,

To answer my own questions, here's the applescript I came up with to save a
perl script as a cgi applet directly from BBEdit:

It works but, if anyone has suggestions to make it work better, do not
hesitate ;-)



-- Beginning of applescript --

tell application "MacPerl.PPC"
	activate
	get the contents of Window 1 of Application "BBEdit 4.0"
	set myScript to the result

	make new document
	set the contents of Window 1 to myScript

	Save document 1 in file ((path to desktop as string) &Â
          (the Name of Window 1 of Application "BBEdit 4.0") & ".cgi")Â
          as Çconstant svasWWW½È

          -- this is the type for CGI Script extension

	close document 1
end tell

-- End of applescript --



P.S. Çconstant svasR*chÈ is the type for MacPerl's BBEdit extensions

Stef


        	_____S__t__Ž__p__h__a__n__e_____J__o__s__e_____

		         mailto:jose.stephane@uqam.ca
	              http://www.er.uqam.ca/nobel/m206474/


                  - Hiroshima 45, Tchernobyl 86, Windows 95 -



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch