Hi,
I just thought about a tiny improvement regarding to display plots in Preview.
If I want to plot something, Preview opens it. Fine. After doing that I want to change the plot for instance. The new plot will be calculated but Preview still displays the old one. I have to 'Revert' it or close it before running the R script.
To make a quasi-update automatically here's a suggestion:
________________ defaults write /Applications/Preview.app/Contents/Info NSAppleScriptEnabled -bool YES
P=$(osascript -e 'tell application "System Events" to (name of processes) contains "Preview"')
if [ "$P" == "true" ]; then osascript <<-AS2 &>/dev/null tell application "Preview" close every window end tell AS2 fi
"$TM_BUNDLE_SUPPORT/tmR.rb" ________________ Explanation: 'default write' has to execute only once to enable AppleScript in Preview. So you can comment it out if set.
The next line checks whether Preview runs or not.
If Preview is running I close every window in Preview. This is a kind of a small hack because AppleScript returns a warning 'missing value', so I send it to the nirvana.
Both AppleScripts could be replaced by changing tmR.rb directly. I.e., if tmp_dir is not empty and Preview is running (system(ps -aux | grep Preview)) then call an AppleScript to close every window.
On the other hand it would be nice to have an easy way to set pdf()'s 'onefile' argument in order to be able to print all plots in one pdf. Maybe solvable by using a TM variable?
Any comments?
All the best,
Hans
If I want to plot something, Preview opens it. Fine. After doing that I want to change the plot for instance. The new plot will be calculated but Preview still displays the old one. I have to 'Revert' it or close it before running the R script.
Why not use pdfview instead? It'll do that automatically.
On the other hand it would be nice to have an easy way to set pdf()'s 'onefile' argument in order to be able to print all plots in one pdf. Maybe solvable by using a TM variable?
The problem is the need to call dev.off once you have finished.
Hadley