FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

Two- or three-digit numbers?

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


Joined: 12 Oct 2005
Posts: 42
Location: Berlin, Germany

PostPosted: Thu Dec 29, 2005 1:57 pm    Post subject: Two- or three-digit numbers? Reply with quote

How can I get SC to activate two- or three-digit numbers (as e.g. 12, 99, 105), when I enter these numbers on my phone? I want to dial 1-2-3 on the phone so that SC activates 1-2-3 on the Mac, but I don't know how to define two- or more-digit numbers in SC. Asking »if the_key is "123" then...« does not work.

Any help or hints appreciated :)

TIA, Marcus
Back to top
View user's profile Send private message Visit poster's website AIM Address
salling
Site Admin


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

PostPosted: Thu Dec 29, 2005 6:06 pm    Post subject: Reply with quote

Marcus,

Can't you just send 1-2-3 to the phone, in sequence? If you want to track the whole sequence, Clicker can't know if you're waiting for 1-2, 1-2-3, or 1-2-3-1 (you get the idea).

Not sure what you're working on here, but there are several ways to build something depending on your needs.

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


Joined: 12 Oct 2005
Posts: 42
Location: Berlin, Germany

PostPosted: Thu Dec 29, 2005 6:24 pm    Post subject: Reply with quote

Jonas, I just hacked a little script for my Formac Watchandgo-PCMCIA-Card together. I just want to control the FormacDVB software via Salling Clicker. It works okay right now, but I also want to activate the channels over the numeric keypad. So if I press »1« and »2« I skip directly to channel 12.

Meanwhile it works with some strange hacks. If I press »1«, it waits a short time like a second; if there's no further input it jumps to channel 1. If I press »1« again directly, it jumps to channel 11. But right now this doesn't work with 12, 13 or other numbers.

Really strange: No matter if I press 12, 22, 32, 42... it always skips to 12. The same with 13, 23, 33, 43, 53 etc. skipping always to 13. And so on, the same with 14, 15...

I attach the script; here's an excerpt:[code:1]set the_offset_in_seconds to (current date) - time_checkpoint
set time_checkpoint to current date

if the_key is "1" and the_offset_in_seconds is greater than 1 then
tell application "FormacDVB"
set aDoc to first document
set aChan to first formacDVBTuner of aDoc
set aChannelIdx to -1
set aChannelIdx to aChannelIdx + 1
set channel Index of aChan to aChannelIdx
end tell
else if the_key is "1" and the_key is "1" then
tell application "FormacDVB"
set aDoc to first document
set aChan to first formacDVBTuner of aDoc
set aChannelIdx to -1
set aChannelIdx to aChannelIdx + 11
set channel Index of aChan to aChannelIdx
end tell[/code:1]
Any idea?
Back to top
View user's profile Send private message Visit poster's website AIM Address
salling
Site Admin


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

PostPosted: Thu Dec 29, 2005 7:29 pm    Post subject: Reply with quote

Did you see how I did this in the EyeTV script? It will jump to channels inbetween, but works rather well.

Another option is to make use of non-digit keys as an end-of-input marker.

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


Joined: 12 Oct 2005
Posts: 42
Location: Berlin, Germany

PostPosted: Thu Dec 29, 2005 7:43 pm    Post subject: Reply with quote

Unfortunately I don't have EyeTV (what do you mean with »jump to channels inbetween«?), but of course I know your script. The thing is, I can directly jump to e.g. channel 15 - but not only by pressing 1 and 5, also by pressing 25, 35, 45... (so I can't skip to channel 25 as this would bring me to ch. 15).

I will post here when I've hopefully found a satisfying solution. Also, I'm glad & thankful about any further help.
Back to top
View user's profile Send private message Visit poster's website AIM Address
salling
Site Admin


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

PostPosted: Fri Dec 30, 2005 12:41 am    Post subject: Reply with quote

What I mean is that my script, when you press 1-2, will visit channel "1" before going to channel "12".

Best.
--
Jonas

[quote="MarcusVoelkel"]Unfortunately I don't have EyeTV (what do you mean with »jump to channels inbetween«?), but of course I know your script. The thing is, I can directly jump to e.g. channel 15 - but not only by pressing 1 and 5, also by pressing 25, 35, 45... (so I can't skip to channel 25 as this would bring me to ch. 15).

I will post here when I've hopefully found a satisfying solution. Also, I'm glad & thankful about any further help.[/quote]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MarcusVoelkel
Junior Member


Joined: 12 Oct 2005
Posts: 42
Location: Berlin, Germany

PostPosted: Fri Dec 30, 2005 6:19 pm    Post subject: Reply with quote

[quote="salling"]What I mean is that my script, when you press 1-2, will visit channel "1" before going to channel "12".[/quote] Thank you so much, Jonas – now it works great :)
Back to top
View user's profile Send private message Visit poster's website AIM Address
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