Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

thriftinkid

macrumors regular
Original poster
Mar 24, 2008
119
0
I need the actions of the program my applescript is running not to appear on screen.

Such as:

1. Open Text Edit
2. Create New Text Doc
3. Add Text
4. Save Document as "Doc Name"
5. Quit Text Edit

I know not using the command "Activate" will run the program in the backround, and I have the script to make Text Edit's Icon not show up in my toolbar when it is running, but the text document still appears on screen while the applescript is completing the actions.

Thanks again as usual in advance guys.
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
Does the file need to be rich text? Could it just be plain text? If you just need to create a plain text file with some particular contents, you could just do this with a command like:
Code:
echo "Some text for my file" > /Users/yourname/Desktop/newfile.txt

Otherwise I don't know if you could tell textedit to hide as soon as you open the document, etc. I'm not too familiar with applescript, but that would be the direction i would take if you need a rich text document saved.

-Lee
 

thriftinkid

macrumors regular
Original poster
Mar 24, 2008
119
0
Here is a quick basic applescript idea of what I want to do on a very small scale. I just don't know where to insert your echo command.


Code:
set theText to "I Hate Cold Weather."
tell application "TextEdit"
	if (front document exists) = true then
		if (text of the front document) ≠ "" then
			make new document
		end if
	else
		make new document
	end if
	set the text of the front document to theText
	save the front document in "MacintoshHD:Users:test:desktop:weather opinion.txt"
	quit without saving
end tell
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.