FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

Help with an strange problem with a simple script! ...

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


Joined: 01 Feb 2007
Posts: 27

PostPosted: Fri Mar 09, 2007 3:49 am    Post subject: Help with an strange problem with a simple script! ... Reply with quote

hello,

well, down here it is the script i have done (modifiying other finded in this wonderfull forum) for to send with my phone the numbers 1,2,3,...

I use it to control some funccions with ableton live... but there are some problems. some times (almost 30% of the times) the number I press appears on the screen, but the program does not recibe it.

why can it be happening?

is there something wrong in the script?

I do really need it for to work on stage, please give me some advice...

thankyou from spain.


property modifieroption : false
property modifierShift : false
property modifierList : {}

using terms from application "SEC Helper"

on process invoke term
tell term
set player to make new keypad screen with properties {title:"Wireless Keyboard & Mouse", sends pen events:true}
tell player
make new text row with properties {horizontal alignment:left, overflow:wrap, font size:small, textual content:
"Green Button: Left Click " & return &
"Red Button: Right Click " & return &
"Center Button: Toggle Command" & return &
"Mail Button: Toggle Control" & return &
"Option + Mail Button: Toggle Option " & return &
"Option + Green Button: Escape " & return &
"Option + Red Button: Tab " & return
}
end tell
push player
end tell
end process invoke

on process key down keyCode sent from pad
tell application "SEC Helper"

if keyCode = "*" then
-- Mail Key -- Shift Modifier
if modifierShift then
set modifierShift to false
show screen message "Shift OFF"
else
set modifierShift to true
show screen message "Shift ON"
end if
else if keyCode = "#" then
-- option + mail -- option
if modifieroption then
set modifieroption to false
show screen message "option modifier OFF"
else
set modifieroption to true
show screen message "option modifier ON"
end if
else
set modifierList to {}

if modifieroption then
set modifierList to {} & {"option"}
end if

if modifierShift then
set modifierList to {} & {"shift"}
end if

if keyCode = "^" then
-- Up Arrow
simulate keyboard virtual keycode 126 modifiers modifierList
show screen message "up"

else if keyCode = "v" then
-- Down Arrow
simulate keyboard virtual keycode 125 modifiers modifierList
show screen message "down"
else if keyCode = "<" then
-- Left Arrow
simulate keyboard virtual keycode 123 modifiers modifierList
show screen message "lefa"
else if keyCode = ">" then
-- Right Arrow
simulate keyboard virtual keycode 124 modifiers modifierList
show screen message "right"
else if keyCode starts with "'" then
else if keyCode = "1" then
simulate keyboard virtual keycode 18 modifiers modifierList
show screen message "1"
else if keyCode = "2" then
simulate keyboard virtual keycode 19 modifiers modifierList
show screen message "2"
else if keyCode = "3" then
simulate keyboard virtual keycode 20 modifiers modifierList
show screen message "3"
else if keyCode = "4" then
simulate keyboard virtual keycode 21 modifiers modifierList
show screen message "4"
else if keyCode = "5" then
simulate keyboard virtual keycode 23 modifiers modifierList
show screen message "5"
else if keyCode = "6" then
simulate keyboard virtual keycode 22 modifiers modifierList
show screen message "6"
else if keyCode = "7" then
simulate keyboard virtual keycode 26 modifiers modifierList
show screen message "7"
else if keyCode = "8" then
simulate keyboard virtual keycode 28 modifiers modifierList
show screen message "8"
else if keyCode = "9" then
simulate keyboard virtual keycode 25 modifiers modifierList
show screen message "9"
else if keyCode = "0" then
simulate keyboard virtual keycode 49 modifiers modifierList
show screen message "ESPACE!"
else if keyCode = "s" then
simulate keyboard virtual keycode 36 modifiers modifierList
show screen message "Enter"



end if

set modifieroption to false
set modifierShift to false
end if
end tell
return (true)
end process key down

end using terms from
Back to top
View user's profile Send private message
salling
Site Admin


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

PostPosted: Fri Mar 09, 2007 3:56 am    Post subject: Reply with quote

In what particular instances are the keystrokes not received by the application?

This is an important question, because if you're seeing on the (debugging) messages on your screen, and the correct keycode is used to simulate the keystroke, the problem is not with the script.

Note: the target application must be front-most for your script to work.

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


Joined: 01 Feb 2007
Posts: 27

PostPosted: Fri Mar 09, 2007 10:38 am    Post subject: it happens aleatorelly (my english is not the best!) Reply with quote

Hello, thankyou so for answering so soon.

As i said it happens sometimes, with no reason... so, sometimes it work, but other times you can see the number on the screen, but it makes no action at all.


What do you exactly mean with this?:
"Note: the target application must be front-most for your script to work."

...If you mean that ableton live should be on the front of my screen... of course it is.

I have tryed to work with a diferent script (one particular that jason kramer has made, and that sells for 2) this one does always work, always... but mine... where can be the problem...? so, is the script right?.

thank you, as you see i am a very first beginner with these stuff.
Back to top
View user's profile Send private message
gamuso
Junior Member


Joined: 01 Feb 2007
Posts: 27

PostPosted: Sat Mar 10, 2007 12:56 pm    Post subject: Please, i really need some help! Reply with quote

...there is have to be something wrong in my script

...can anybody tell me what??


thankyou.
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