Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: How to open a .pdf outside Stata with a Stata command


From   Eric Booth <eric.a.booth@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: How to open a .pdf outside Stata with a Stata command
Date   Tue, 18 Dec 2012 10:02:50 -0600

<>

On a mac, just write a program that sends the 'open' command to the terminal , so :

cap program drop openmypdf
program define openmypdf
syntax anything
	!open -a Preview.app "`anything'"
end


openmypdf myfile.pdf


would work.  Or make the program more general to any file (which utilizes the default program in the OS to open the file) with something like:


cap program drop openmacfile
program define openmacfile
syntax anything
	!open  "`anything'"
end

openmacfile myfile.docx


or just put the command in your do-file:   !open  "myfile.ext"

P.S. the toy commands you mention to use iTunes, etc. on a mac from Stata are here:  http://www.eric-a-booth.com/Home/software

- Eric
__
eric.a.booth@gmail.com



On Dec 18, 2012, at 9:53 AM, Richard Svensson <richard.svensson@gu.se> wrote:

> I read about a user-written program that enable the Stata-user to control iTunes on a Mac computer, and another program that makes it possible to Google-search inside Stata. So it seems that it's possible (at least on Mac) to control other softwares from Stata.
> 
> What I am looking for, or trying to write, is a Stata-command that open a file (.pdf) outside Stata.
> 
> Do you know of any way to solve this? Or do you know where I might find information about this in my 
> struggle with this problem? Any important key words that might help me?
> 
> Richard Svensson
> The QoG Institute
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index