[OS X TeX] Save Source As

Michael Sharpe msharpe at ucsd.edu
Thu Jan 5 23:24:24 CET 2012


On Jan 4, 2012, at 11:04 PM, M. Tamer Özsu wrote:

> This is very helpful. Is there a way to modify it so that one chooses the folder into which a new (not previously existing) file would go in? The current script sets filefolder to a specific directory and then "counts" the versions in that directory. Of course I can figure out how to ask the user for the filefolder and set it accordingly if the file does not exist, but I don't know how to select the folder using the usual Apple pop-up navigation panel. Is that possible?

You could add a couple of lines to the script to do this for a new file, but it's always useful to have a starting folder like Documents or Desktop. In addition to that, there would always be an extra folder selection you would have to make. So, you could change the line

set filefolder to (POSIX path of (((path to home folder) as string) & "Documents:texfiles")) --the default 
 
to

set filefolder to (POSIX path of (((path to home folder) as string) & "Documents")) --the default 

Then replace the lines

if filepath is equal to "" then -- there is no file
	set file_exists to false

with

if filepath is equal to "" then -- there is no file
	set file_exists to false
	try
		set filefolder to (choose folder with prompt "Select destination folder" default location alias POSIX file filefolder as alias)
	on error number -128
		return
	end try

Michael


More information about the macostex-archives mailing list