Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

HighTime

macrumors regular
Original poster
Sep 20, 2014
131
5
Hello folks,

I currently have some videos which I need to translate on the fly and transcribe. I play them in IINA and sometimes some of them even in Youtube itself and can stop and pause using the play/pause button on the keyboard while I am still in Word typing everything out. Pausing and playing is fine since I can do that while I am still in Word so it doesn't mess the flow up.

Problem is if I need to go back a few seconds to repeat what was said in case I never caught it properly I have to click out of Word and into IINA/Youtube and then press the back arrow to hear it again and then switch back over to Word. So my question is, is there any way I can control all aspects of the audio without having to leave Word or the program I am typing in? The main function I need really is just to be able to go back [don't really need to jump forward for example] a few seconds with a keyboard click like the pause/play button without having to leave Word. The best option would be to be able to use the 'rewind' key on the left of the play key on the keyboard, that would be perfect.

Any ideas?

Thank you.
 
Last edited:

bogdanw

macrumors 603
Mar 10, 2009
6,102
3,017
You can create a QuickAction in Automator, with AppleScript to press left arrow, and set a shortcut for it.
https://support.apple.com/guide/automator/aut73234890a/mac
https://support.apple.com/guide/mac-help/use-services-in-apps-mchlp1012/mac
AppleScript:

Code:
tell application "IINA" to activate
tell application "System Events" to key code 123
tell application "Microsoft Word" to activate

IINA can also play YouTube videos.
iina.jpg
 

HighTime

macrumors regular
Original poster
Sep 20, 2014
131
5
You can create a QuickAction in Automator, with AppleScript to press left arrow, and set a shortcut for it.
https://support.apple.com/guide/automator/aut73234890a/mac
https://support.apple.com/guide/mac-help/use-services-in-apps-mchlp1012/mac
AppleScript:

Code:
tell application "IINA" to activate
tell application "System Events" to key code 123
tell application "Microsoft Word" to activate

IINA can also play YouTube videos.
View attachment 2045127

Many thanks for your reply @bogdanw, but that is not doing anything for me? I think i got it set up right as you have it above but then if I run click run from the automator all all it does is bring Word to the forefront, but the rewind key (F7) still doesn't skip the audio back. I see you have it set for the left arrow key. I am pretty sure I am missing some steps or something since I've never used automator before.
 

HighTime

macrumors regular
Original poster
Sep 20, 2014
131
5
I actually googled and came across the codes on that page and did try key code 98 but I still can't get it to work.

I think my problem is how do I actually activate that script? How do I run it when I am typing? At the moment all it does if I press F7 is jump back a whole track and not skip backwards 5s?

This script you have written above, what does it do actually, skip back or just bring Word to the fore? Sorry about my lack of skills in this man.
 

bogdanw

macrumors 603
Mar 10, 2009
6,102
3,017
I’ll try to describe the whole process in more detail:
1. Open Automator (/Applications/Automator.app), New – QuickAction
- For “Workflow receives current” select “no input”, for in select Microsoft Word, or the app you are using for writing.
- From the left menu, search for AppleScript and drag it into the right side
- copy paste the AppleScript into to window as in the image above
- save the QuickAction with a name, let’s say IINA
2. Open System Preferences, Keyboard, Shortcuts, Services and look for the newly created IINA service. It should be at the end of the list.
- click on the right side to add a shortcut, press a combination of keys you want to use while in Word to skip IINA back 5 seconds.
3. Open a video/audio file in IINA, open Word and press the stortcut defined above. MacOS will ask you to give Word permission to control “System Events“. Give the permission in System Preferences, Security & Privacy, Privacy – Accessibility by checking Word.

After that, when you are in Word and press the defined shorcut, the QuickAction will activate IINA, press the key for back 5 seconds (or whatever time you define in IINA preferences) and return to Word so that you can continue writing. This should happen instantly.
 
  • Like
Reactions: HighTime

HighTime

macrumors regular
Original poster
Sep 20, 2014
131
5
I’ll try to describe the whole process in more detail:
1. Open Automator (/Applications/Automator.app), New – QuickAction
- For “Workflow receives current” select “no input”, for in select Microsoft Word, or the app you are using for writing.
- From the left menu, search for AppleScript and drag it into the right side
- copy paste the AppleScript into to window as in the image above
- save the QuickAction with a name, let’s say IINA
2. Open System Preferences, Keyboard, Shortcuts, Services and look for the newly created IINA service. It should be at the end of the list.
- click on the right side to add a shortcut, press a combination of keys you want to use while in Word to skip IINA back 5 seconds.
3. Open a video/audio file in IINA, open Word and press the stortcut defined above. MacOS will ask you to give Word permission to control “System Events“. Give the permission in System Preferences, Security & Privacy, Privacy – Accessibility by checking Word.

After that, when you are in Word and press the defined shorcut, the QuickAction will activate IINA, press the key for back 5 seconds (or whatever time you define in IINA preferences) and return to Word so that you can continue writing. This should happen instantly.

You are the man. Sorted. Many thanks for taking all that time out to help.
 

HighTime

macrumors regular
Original poster
Sep 20, 2014
131
5
One more question, how do I add another program to that Quick Action in Automator? Like Word and Pages for example? Do I have to create another Quick action or can I combine them in that initial one?

Thanks again.
 

bogdanw

macrumors 603
Mar 10, 2009
6,102
3,017
If the combination of keys you used for the shortcut is not in use in other apps, you can select “any application” instead of Microsoft Word. Open Automator, File – Open Recent – and edit the QuickAction.
 
  • Like
Reactions: HighTime

HighTime

macrumors regular
Original poster
Sep 20, 2014
131
5
If the combination of keys you used for the shortcut is not in use in other apps, you can select “any application” instead of Microsoft Word. Open Automator, File – Open Recent – and edit the QuickAction.
Perfect. Thanks man.
 

bogdanw

macrumors 603
Mar 10, 2009
6,102
3,017
This AppleScript should work for any application:
Code:
set ActiveApp to short name of (info for (path to frontmost application))
tell application "IINA" to activate
tell application "System Events" to key code 123
tell application ActiveApp to activate
You have to give permission to control “System Events” for every app in which you use it.
 
  • Like
Reactions: HighTime

HighTime

macrumors regular
Original poster
Sep 20, 2014
131
5
This AppleScript should work for any application:
Code:
set ActiveApp to short name of (info for (path to frontmost application))
tell application "IINA" to activate
tell application "System Events" to key code 123
tell application ActiveApp to activate
You have to give permission to control “System Events” for every app in which you use it.
Just tried it, works great. Many thanks for all your help!
 
  • Like
Reactions: bogdanw

nazim.canada

macrumors newbie
Aug 21, 2022
2
0
British Columbia, Canada
Hello folks,

I currently have some videos which I need to translate on the fly and transcribe. I play them in IINA and sometimes some of them even in Youtube itself and can stop and pause using the play/pause button on the keyboard while I am still in Word typing everything out. Pausing and playing is fine since I can do that while I am still in Word so it doesn't mess the flow up.

Problem is if I need to go back a few seconds to repeat what was said in case I never caught it properly I have to click out of Word and into IINA/Youtube and then press the back arrow to hear it again and then switch back over to Word. So my question is, is there any way I can control all aspects of the audio without having to leave Word or the program I am typing in? The main function I need really is just to be able to go back [don't really need to jump forward for example] a few seconds with a keyboard click like the pause/play button without having to leave Word. The best option would be to be able to use the 'rewind' key on the left of the play key on the keyboard, that would be perfect.

Any ideas?

Thank you.
hey, we are currently developing a tool which will allow to transcribe audio or video and translate it to different languages. seems like it's close to what you are trying to do. would you like to be a beta tester?
 

HighTime

macrumors regular
Original poster
Sep 20, 2014
131
5
hey, we are currently developing a tool which will allow to transcribe audio or video and translate it to different languages. seems like it's close to what you are trying to do. would you like to be a beta tester?
Hello, sounds interesting, not sure how much time I will have but I'm willing to give it a go.
 

HighTime

macrumors regular
Original poster
Sep 20, 2014
131
5
Hey @bogdanw, sorry to hassle you again but I seem to have messed some setting up or something. What's happening is the Applescript shortcut is working with everything except the one program I need it for most, Scrivener, more than Word, and which was the reason I posted here. So all other programs have no issue with implementing the rewind shortcut, except for Scrivener, which is just implementing the actual keyboard shortcut for what it is already assigned as a default in Scrivener. It was working before and I think I must've messed some setting up.

I just deleted Scrivener preferences from the Library and rebooted to see if that would work but no luck.

Any ideas?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.