FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

Is it possible to....

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


Joined: 12 Apr 2005
Posts: 37

PostPosted: Fri Apr 22, 2005 8:19 am    Post subject: Is it possible to.... Reply with quote

Anyone know if its possible to pass a string; such as "hello world", to the finder, and convert it to key strokes?

Basically Im looking to take an input, and pass it back to the mac as keystrokes...

Any thoughts?
Back to top
View user's profile Send private message
salling
Site Admin


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

PostPosted: Fri Apr 22, 2005 8:30 am    Post subject: Re: Is it possible to.... Reply with quote

Check "SEC Helper"'s dictionary. There's a command to simulate keystrokes.

You can also use "System Events" to send keystrokes in a similar fashion.

All you need to do is repeat through the characters in the string.

Best.
--
Jonas

[quote="Ronnieronson"]Anyone know if its possible to pass a string; such as "hello world", to the finder, and convert it to key strokes?

Basically Im looking to take an input, and pass it back to the mac as keystrokes...

Any thoughts?[/quote]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Ronnieronson
Junior Member


Joined: 12 Apr 2005
Posts: 37

PostPosted: Fri Apr 22, 2005 8:49 am    Post subject: Reply with quote

Got a basic little script up and running - seems to be a few problems with it but at least it's started :D

property the_keys : ""
try
tell application "SEC Helper"
enter text field mode title "" prompt "Press The Key" value "" length 10
return = true
end tell
on error
beep
end try


on affirmative_textfield_response(the_stroke)
set the_keys to the_stroke
end affirmative_textfield_response

if the_keys = "A" then
tell application "System Events"
keystroke "A"
end tell

end if
Back to top
View user's profile Send private message
salling
Site Admin


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

PostPosted: Fri Apr 22, 2005 8:59 am    Post subject: Reply with quote

Use this for inspiration:

set the_text to "abc"
repeat with a_char in the_text
tell application "System Events"
keystroke a_char
end tell
end repeat

It's less frustrating not having to enter one character at a time.

Best.
--
Jonas

[quote="Ronnieronson"]Got a basic little script up and running - seems to be a few problems with it but at least it's started :D

property the_keys : ""
try
tell application "SEC Helper"
enter text field mode title "" prompt "Press The Key" value "" length 10
return = true
end tell
on error
beep
end try


on affirmative_textfield_response(the_stroke)
set the_keys to the_stroke
end affirmative_textfield_response

if the_keys = "A" then
tell application "System Events"
keystroke "A"
end tell

end if[/quote]
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Ronnieronson
Junior Member


Joined: 12 Apr 2005
Posts: 37

PostPosted: Fri Apr 22, 2005 2:24 pm    Post subject: Reply with quote

Well Ive finished the data input part of the script.... can you guess what im gonna do with the rest? ;)

[url]http://www.clickerscripts.com/viewtopic.php?t=108&highlight=[/url]

TY once again for the help Jonas :D
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