Re: saving front window using osascript...
Re: saving front window using osascript...
- Subject: Re: saving front window using osascript...
- From: Rick Ballard <email@hidden>
- Date: Thu, 8 Nov 2007 10:52:14 -0800
The problem with your current script is that the output of an Xcode
user script is buffered until the end of the script, as is appropriate
in most cases. In your case, since you want to execute more actions
(an applescript save command) after the output goes to the document,
I'd suggest using another applescript command to dump your output to
the document instead of doing so with the user script's output
destination. You can manipulate text documents in Xcode with
applescript similarly to how you can in other applications.
- Rick
On Nov 8, 2007, at 1:51 AM, Fons Rademakers wrote:
Hi Rick,
many thanks that help, to use "document". However, what I try to
achieve is to have a user script that:
- strips all trailing blanks and tabs from a file
- saves the file
I tried:
- Input: "Entire Document"
- Directory: "Home Directory"
- Script:
#!/bin/sh
#
# Removes trailing blanks (spaces and tabs) from the file + save.
#
perl -pe 's/[\t ]+$//g' <&0
osascript << ENDOFSCRIPT
tell application "Xcode"
save the front document
end tell
ENDOFSCRIPT
but this does not work as the save is of the document before the
perl modified text is pasted in. How can I make such a two step
script?
Cheers, Fons.
Rick Ballard wrote:
On Nov 7, 2007, at 5:02 PM, Fons Rademakers wrote:
Hi,
something very trivial. I want to save the Xcode front window via
osascript:
tell application "Xcode"
save front window
close front window
end tell
only closes but does not save the window. What script command
should I use? write to file? If so how do I get the type?
tell application "Xcode"
close front document saving <yes/no/ask>
end tell
- Rick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden