Go Back   The macosxhints Forums > OS X Help Requests > AppleScript



Reply
 
Thread Tools Rate Thread Display Modes
Old 06-10-2010, 02:05 PM   #1
jahbini
Prospect
 
Join Date: Jun 2010
Posts: 2
Question Setting the settings set for terminal app

How do the "settings sets" work. Its got me stumped. The terminal title seems to work fine, but how do I set the style to the "Ocean" setting?





-- activate application "Terminal" */
tell application "Terminal"
set ss to settings set named "Ocean"
--set default settings to settings set ss
open "new window"
tell window 1
set current settings to ss
--tell tab 1 to set current settings to 1
set custom title to "This title works"
end tell

delay 10
end tell
tell application "Terminal" to quit
jahbini is offline   Reply With Quote
Old 06-10-2010, 04:41 PM   #2
renaultssoftware
MVP
 
Join Date: Dec 2009
Location: Pembroke, Ontario
Posts: 2,051
I've tried this script:
Code:
tell application "Terminal"
	set theTab to the first window's first tab
	set ss to settings set "Ocean"
	set the default settings to ss
end tell
Returning error:
Code:
error "Terminal got an error: Can’t set settings set id 4.300373344E+9 to settings set id 4.300373344E+9." number -10006 from settings set id 4.300373344E+9
Using macerror command line app, it returns:
Code:
Mac OS error -10006 (telCAUnavail): a CA is not available
I'm honestly not sure what the problem is.
__________________
Get Icon Creator and support me.
renaultssoftware is offline   Reply With Quote
Old 06-10-2010, 05:33 PM   #3
tw
Hall of Famer
 
Join Date: Apr 2007
Posts: 4,262
well, this seems to be an odd scope issue (i.e., an applescript bug in terminal). This works:

Code:
set current settings of window 1 to settings set "Ocean"
If you want to do it in a tell block, you have to make sure that you're referring to setting sets in the application context, like so:
Code:
tell window 1
	set current settings to (settings set "Ocean" of current application)
end tell
I suspect the problem with setting a variable for the task is that terminal tries to interpret the variable in terms of the current tell block (talking to 'Window') but the window doesn't know to look to the application for the definition and so throws an error. might be worth filing a bug report at apple over it.
__________________
Philosophy is a battle against the bewitchment of our intelligence by means of language. -LW-
tw is offline   Reply With Quote
Old 06-11-2010, 12:01 AM   #4
jahbini
Prospect
 
Join Date: Jun 2010
Posts: 2
Thumbs up Thanks for the insight

So it could be a "negative feature." eh?

Thanks for the work arounds.

That's a load off my mind, my mac usually doesn't hate on me: I thought it might be my breath.
jahbini is offline   Reply With Quote
Old 06-11-2010, 12:28 AM   #5
tw
Hall of Famer
 
Join Date: Apr 2007
Posts: 4,262
Quote:
Originally Posted by jahbini
So it could be a "negative feature." eh?

Thanks for the work arounds.

That's a load off my mind, my mac usually doesn't hate on me: I thought it might be my breath.

well, I don't know about your breath, but I do know that terminal's applescript support is shoddy (always has been for some reason). You might look into iTerm - free third party CLI app that does a bit better job than terminal.app
__________________
Philosophy is a battle against the bewitchment of our intelligence by means of language. -LW-
tw is offline   Reply With Quote
Reply

Tags
applescript, terminal app, terminal title

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 02:09 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.