Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Force Preview to reload a document' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Force Preview to reload a document
Authored by: stochasticus on Jan 05, '06 08:16:59AM

Please excuse my stupidity but where do you need to put scripts like this so that they can be run from anywhere from the terminal? I found that the script worked, and is just what I need, but only when the script was in the same directory as I was in when running it.



[ Reply to This | # ]
Force Preview to reload a document
Authored by: vocaro on Jan 05, '06 06:52:33PM

Please excuse my stupidity but where do you need to put scripts like this so that they can be run from anywhere from the terminal?

You should be able to put them anywhere as long as you reference them correctly (e.g., quoting the directory if it contains spaces). For instance, here's what I do on the command line:

osascript "/Users/trevor/Development/AppleScript/Reload Preview Document.scpt" document.pdf

[ Reply to This | # ]
Force Preview to reload a document
Authored by: Christoph on Jan 06, '06 12:11:58AM
The environment variable PATH consists of a colon seperated list of directories that are searched for commands. Hence you can proceed as follows: 1) create a directory ~/bin with
mkdir $HOME/bin
2) put your private scripts therein 3) add this directory to your search path with

PATH="$PATH:$HOME/bin"
export PATH
The commands under 3) should go into a file that is loaded whenever the Terminal is started. I think $HOME/.profile should work (at least on my system it works because I do not use Terminal.app but "xterm -l"). As I have noticed getting the profile actually read can be a bit tricky and it will be ignored when you start applications from the Aqua GUI.

[ Reply to This | # ]
Force Preview to reload a document
Authored by: stochasticus on Jan 06, '06 02:16:45AM

Thanks but I know about *nix paths already. I don't think osascript does though so you need to put the full path. I've done something similar to Doc Drang below and written a shell script to make it easier.



[ Reply to This | # ]