Re: Help please
Re: Help please
- Subject: Re: Help please
- From: "Stockly, Ed" <email@hidden>
- Date: Fri, 20 Nov 2015 20:45:37 +0000
- Thread-topic: Help please
This is how I would do it:
—————
set myVariableString to "xyz"— — change as needed
tell application "Safari" — — or whatever app you're sending the
keystrokes to
activate
tell application "System Events"
delay 1
keystroke "f" using control down
keystroke ":exec " & myVariableString
keystroke return
end tell
end tell
------
The delay is optional (and may cause problems in some OS versions). If the
app is already frontmost when you run the script you don't need it.
In your script you had a \ before the quotes in your tell application.
That could be causing problems, depending on how you're using the script.
On 11/20/15, 12:34 PM,
"applescript-users-bounces+ed.stockly=email@hidden on
behalf of -"
<applescript-users-bounces+ed.stockly=email@hidden on
behalf of email@hidden> wrote:
>
>I'm new to apple script. In a previous thhread I was given this to send
>a keystroke combination for control+f:
>
>tell application \"System Events\" to keystroke "f" using control down
>
>This gives the error message:
>
>4:4: syntax error: Expected expression but found end of script. (-2741)
>
>What is the problem? Perhaps I'm missing something the original poster
>suggested?
>
>Also, as long as I'm here, how would one send this character string
>following the completion of the "tell" above:
>
>:exec xyz
>
>The "xyz" can vary but the end of the string must end with a return.
>
>Thanks for any help.
>
>XB
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden