• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is there a way to send a keystroke to a background app without an AppleScript dictionary?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there a way to send a keystroke to a background app without an AppleScript dictionary?


  • Subject: Re: Is there a way to send a keystroke to a background app without an AppleScript dictionary?
  • From: Jim Krenz via AppleScript-Users <email@hidden>
  • Date: Mon, 27 Apr 2020 18:30:00 -0700

Hello Yvan,

Thank you for the script. Unfortunately, it activates the Podcasts app, which
is something I don’t want to do. It even activates if I remove the tell
application "Podcasts" to activate line.

As I mentioned in my request, I want to send the command to the Podcasts app
without activating it.

Sincerely,

Jim

> On Apr 27, 2020, at 1:28 am, Yvan KOENIG via AppleScript-Users
> <email@hidden> wrote:
>
>
>> Le 27 avr. 2020 à 01:46, Jim Krenz via AppleScript-Users
>> <email@hidden
>> <mailto:email@hidden>> a écrit :
>>
>> Hello all,
>>
>> Is there a way to send a keystroke to a background app without an
>> AppleScript dictionary?
>>
>> From what I can tell, the Podcasts app does not have a AppleScript
>> dictionary.
>>
>> What I want to do, is to send a keystroke (⌘ ⇧ →) to the Podcasts app,
>> without activating it.
>>
>> Here is what I have thus far (but it does not work):
>>
>> tell application "System Events"
>>      tell process "Podcasts"
>>              key code 124 using {shift down, command down}
>>      end tell
>> end tell
>>
>> Thanks for any ideas or suggestion on how to do the above.
>>
>> Sincerely,
>>
>> Jim
>
> As far as I know GUI Scripting requires the target process to be active.
>
> This code is supposed to work but I can't test as Podcasts is unavailable on
> my system running 10.13.6.
>
> tell application "Podcasts" to activate
> tell application "System Events"
>       tell process "Podcasts"
>               set frontmost to true -- old habit used because some OS were
> slow to put the process to front after 'activate'
>               key code 124 using {shift down, command down}
>       end tell
> end tell
>
> Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) lundi
> 27 avril 2020 10:27:58
>
>
> _______________________________________________
> 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

 _______________________________________________
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

  • Follow-Ups:
    • Re: Is there a way to send a keystroke to a background app without an AppleScript dictionary?
      • From: David Gregg via AppleScript-Users <email@hidden>
References: 
 >Is there a way to send a keystroke to a background app without an AppleScript dictionary? (From: Jim Krenz via AppleScript-Users <email@hidden>)
 >Re: Is there a way to send a keystroke to a background app without an AppleScript dictionary? (From: Yvan KOENIG via AppleScript-Users <email@hidden>)

  • Prev by Date: Re: Is there a way to send a keystroke to a background app without an AppleScript dictionary?
  • Next by Date: Re: Is there a way to send a keystroke to a background app without an AppleScript dictionary?
  • Previous by thread: Re: Is there a way to send a keystroke to a background app without an AppleScript dictionary?
  • Next by thread: Re: Is there a way to send a keystroke to a background app without an AppleScript dictionary?
  • Index(es):
    • Date
    • Thread