FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

trouble with making a simple slider for screen brightness

 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Mac
View previous topic :: View next topic  
Author Message
villanova329
Newbie


Joined: 13 Jul 2005
Posts: 1

PostPosted: Wed Jul 13, 2005 4:36 pm    Post subject: trouble with making a simple slider for screen brightness Reply with quote

I'm having trouble making a slider to toggle the screen's brightness. I basically copied the same script from system volume and balance, but whenever I try to save I get this syntax error:

Expected end of line but found identifier


I'm guessing the troubled identifier or whatever is this: brightness (because thats what is highlighted after the error message)


This is the script that is written so far, please help me edit or include anything I'm missing. Your help is greatly appreciated.


property old_brightness : 0.5
property new_brightness : 0.5

tell application "SEC Helper"
try
set old_brightness to screen brightness
enter slider mode title "Screen Brightness" steps 10 value screen brightness * 10
end tell

on value_was_changed(passed_value)
tell application "SEC Helper"
set new_brightness to passed_value / 100
set screen brightness to new_brightness
show screen message "Screen Brightness" percentage value passed_value / 100
end tell
end value_was_changed

on affirmative_slider_response()
end affirmative_slider_response

on negative_slider_response()
tell application "SEC Helper"
set screen brightness to old_brightness
end tell
end negative_slider_response
Back to top
View user's profile Send private message
salling
Site Admin


Joined: 27 Jul 2004
Posts: 7498
Location: Stockholm, Sweden

PostPosted: Wed Jul 13, 2005 4:42 pm    Post subject: Reply with quote

Hello!

The "SEC Helper" application object doesn't expose any "screen brightness" property, which is why I think your code doesn't work.

You will need to find another scriptable means of changing the brightness.

Best.
--
Jonas
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dfredh
Newbie


Joined: 11 Oct 2005
Posts: 4

PostPosted: Sat Oct 15, 2005 5:21 pm    Post subject: Reply with quote

Try this!
It works for me!

/David

_______________

property keymap_info : {{key_code:"s", key_title:"Nothing", key_description:"This is just a place holder"}, {key_code:"<", key_title:"Nothing", key_description:"This is just a place holder"}}

try
tell application "SEC Helper"
enter keypad mode text "Sample" & return & "Keypad" keypad idle "keypad_is_idle" key depressed "key_was_depressed" key repeated "key_is_repeating" key released "key_was_released"
end tell
on error
beep
end try

on key_was_depressed(keyCode)
try
tell application "SEC Helper"
if keyCode is ">" then
tell application "SEC Helper"
simulate keyboard special key brightness up
end tell
end if
if keyCode is "<" then
tell application "SEC Helper"
simulate keyboard special key brightness down
end tell
end if
if keyCode is "^" then
tell application "SEC Helper"
repeat 16 times
simulate keyboard special key brightness up
end repeat

end tell
end if
if keyCode is "v" then
tell application "SEC Helper"
repeat 16 times
simulate keyboard special key brightness down
end repeat
end tell

end if
end tell
on error
beep
end try
return true
end key_was_depressed
Back to top
View user's profile Send private message
Almaas
Newbie


Joined: 31 Jul 2006
Posts: 2

PostPosted: Fri Aug 11, 2006 12:25 pm    Post subject: Display 'On/Off' function Reply with quote

is there a way to switch the display on or off from the mobile using Salling Clicker for Mac? If anyone could point me towards a post that deals with this, that would be helpful as well, as I can't find one.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Mac All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group