Тёмный

AppleScript Tutorial : Open and play movie in QuickTime Player 

ClickingKeys
Подписаться 1,2 тыс.
Просмотров 2,1 тыс.
50% 1

Learn how to AppleScript, Apple's built in automation platform. In this video I tackle another viewer request. Thanks Nabila Quincy for the request! I'll show you how to open a movie file from your computer in QuickTime Player and tell QuickTime to start playing the video. This is a very simple process and even if you're a complete noob you'll be able to learn how to write your own script to do the same thing.
-- -- -- -- -- -- -- START EXAMPLE SCRIPT CODE -- -- -- -- -- -- --
on run
set theFile to "/Users/clickingkeys/Desktop/BeatSaber.mov"
set hfsPath to POSIX file theFile as string
tell application "QuickTime Player"
activate # BRINGS QUICKTIME TO THE FRONT, SO YOU CAN SEE THE VIDEO
set myMovie to open hfsPath
delay 4 # OPTIONAL, TELLS QUICKTIME TO WAIT 4 SECONDS BEFORE STARTING TO PLAY THE VIDEO
tell myMovie to play
end tell
end run
-- -- -- -- -- -- -- END EXAMPLE SCRIPT CODE -- -- -- -- -- -- --
Sample video clip in this tutorial is of Naysy, check out her channel for some wonderful VR content! / naysy
For more AppleScript tutorial videos, check out this play list.
• Learn to AppleScript (...
If you're interested in watching full scripts being written, have a look at this play list.
• AppleScript Project Ex...

Хобби

Опубликовано:

 

27 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 32   
@kjvisual7
@kjvisual7 2 года назад
Cool thanks. This tutorial is my first AppleScript.
@helenkirwan6050
@helenkirwan6050 7 месяцев назад
Thank you so much! Saved my life! Could you advice how to make it to open in a full screen and to play on a loop please?
@nabilaquincy3923
@nabilaquincy3923 2 года назад
Omg it's working! Thank you so much for making this tutorial, i really appreciate it
@ClickingKeys
@ClickingKeys 2 года назад
My pleasure, so glad you’ve gotten it working! ☺️
@Nico_salazarr
@Nico_salazarr Год назад
Hello! Works perfect! Thanks a lot. Can you help me with open the video in fullscreen?
@kindacool9708
@kindacool9708 2 года назад
Thanks so much for your videos there very well made and helpful. Is there anyway for apple script to delete a discord message? Thanks :D
@ClickingKeys
@ClickingKeys 2 года назад
Thank you for the support. ☺️ Would it be possible for AppleScript to delete a Discord message, possibly yes. There are a few things that would need to be considered and determined though. For example, you would need to determine how you would tell the AppleScript which specific message should be deleted so you don’t accidentally delete a message you didn’t intend to delete. As well, if you couldn’t delete the message manually from within your account, AppleScript wouldn’t be able to delete it either. With all that said, technically it should be capable of deleting the message but you would likely need to GUI script the browser interface.
@gooddog47
@gooddog47 2 месяца назад
Thanks for this. The DELAY option you mention is related to waiting for the controller to disappear before the video plays. Is there any way to program it so the controller does not appear at all? Thanks!!
@MindDrip
@MindDrip Месяц назад
Probably not, but you could program quicktime to hide itself after opening and commencing the reproduction of the file, i.e. immediately after it starts playing
@user-yb6fd2ie9o
@user-yb6fd2ie9o Год назад
bro how we can quit application after play video
@ramalakshmanan2934
@ramalakshmanan2934 2 года назад
Hi, this would be extremely helpful to me if you could explain how to pass the filename as an argument to the script. I tried on run argv but I do not know enough AppleScript to figure out how to convert CLI input, strings and filenames to get it to work. My attempt resulted in openfile mn MY script is below. Sorry very newbie to AppleScript though programmed in other languages.
@heathermaurer6807
@heathermaurer6807 Год назад
I am a way begginer to this and am having a similar problem getting the message that the document could not be opened because it isn't compatible in QuickTime player despite it being open in QT. any advice (prefferibly worded for dummies, I have never done any sort of scripting before)
@ClickingKeys
@ClickingKeys Год назад
Hey Heather, so glad you’re interested in learning AppleScript! It’s hard to say for sure without seeing your code, but my guess is the issue is with the format of the file path you’re sending to QuickTime. There are different types of paths (I have another video that talks about this in more detail). HFS paths which, which show with a colon between each folder. POSIX paths, which use a forward slash between each folder. There are also “file references”, like an alias. If you are using one of these that QuickTime isn’t expecting, it could be why you are seeing the error you are. Another possible reason could be in the way you are getting the file path, maybe you accidentally made a typo in the path and therefore the file you’re trying to open doesn’t really exist. Double and triple check the path to the file for any mistakes if you’ve hand typed it.
@loot6
@loot6 4 месяца назад
@@ClickingKeys I get the same error. If there's some problem with the file path it would say file not found, it wouldn't say file not compatible.
@D33Arts
@D33Arts 2 года назад
So I have been following your channel and thanks for all of the useful information. When I run this I get an QT error indicating the mov file isn't compatible with QuickTime - yet it opens fine when I navigate to the folder from QT to run it - puzzled I am.
@ClickingKeys
@ClickingKeys 2 года назад
Hey Dan! Thanks for following me, much appreciated. As for your problem, my guess is that the path you’re supplying to the open command is not the correct format that QT is expecting. I would recommend adding a “log” of your variable and ensuring that it is the correct path to your file and that it is formatted as HFS path. (colon delimited)
@D33Arts
@D33Arts 2 года назад
So after a little more testing I found that if the mov file was in the recent list of QT then it plays fine. Errors out if I clear the "Recent" menu.
@D33Arts
@D33Arts 2 года назад
@@ClickingKeys So after defining the path in the script as you did I had to use this convention to get it to work: 'open file hfsPath' THEN below it 'set myMovie to open hfsPath'
@ClickingKeys
@ClickingKeys 2 года назад
@@D33Arts I think if you take out that first line, it will work as expected. If you look closely at the two lines, you’ll notice that the first line you wrote has the word “file” before the variable hfsPath. I believe that’s what’s causing the issue. QT is expecting just the path without the “file” indicator before it.
@OzGreatPowerful
@OzGreatPowerful 2 года назад
This was a handy tutorial - however - when I attempted to use this on some .m4v files I received an error stating the format was invalid for QuickTime Player ... yet ... once I manually opened the file[s] in QuickTime Player I was able to run them via the AppleScript. Seems a little odd to me. Any thoughts?
@ClickingKeys
@ClickingKeys 2 года назад
Hey Robert, thanks for taking the time to message me. That does sound very odd. Between it failing to open and then manually opening it and then running the script again, you didn’t make any code changes?
@OzGreatPowerful
@OzGreatPowerful 2 года назад
@@ClickingKeys that's correct, didn't change a thing. I found that once I cleared QTs "open recent" the problem was back. Ultimately, I gave up and just pointed everything to the TV app - and it worked perfectly. It seems that Monterey wants you to think you can't use QuickTime Player to play .m4v - you can (at least I can) ... but not in an easily scripted fashion.
@ramalakshmanan2934
@ramalakshmanan2934 2 года назад
Ah looks like a lot of what I copied wasn't pasted in sorry.
@yagoa
@yagoa 2 года назад
Hi, nice video can I support you in more ways than liking and subscribing? I was wondering if you can help me to get the "open image sequence..." automated when another 100 files are downloaded from a camera?
@ClickingKeys
@ClickingKeys 2 года назад
Hey yagoa, thanks so much for the comment and for offering to support me in some way. Currently, I don't have any options for supporting me other than with a "Like", "Share" and "Subscribe". As for your question, I'm not sure I totally follow your question. Are you asking how to automatically copy images off of your camera card or are you wanting to have the files automatically open once you've copied them to your computer?
@yagoa
@yagoa 2 года назад
@@ClickingKeys Second option :) Open into the time-lapse functionality: open image sequence and hopefully even select the options automatically, create the filename based on the files and then start the encode, surely an advanced video :)
@yagoa
@yagoa 2 года назад
@@ClickingKeys I can make a video if you want
@ClickingKeys
@ClickingKeys 2 года назад
Hey yagoa, yeah, that would help me to understand what you're after. BTW, sorry for the late reply for some reason I'm not getting notifications on your replies.
@yagoa
@yagoa 2 года назад
@@ClickingKeys I want to automatically create time-lapses every 100 photos that are added to a folder using applescript and quicktime, DSC00101.ARW - DSC00200.ARW, DSC00201.ARW-DSC00300.ARW etc.
Далее
AppleScript Tutorial : Data Types
11:34
Просмотров 3,9 тыс.
2DROTS vs RISENHAHA! КУБОК ФИФЕРОВ 2 ТУР
11:31
Secret Experiment Toothpaste Pt.4 😱 #shorts
00:35
AppleScript Tutorial : Error Handling
6:56
Просмотров 1,7 тыс.
25 Things You Can Do With QuickTime Player
10:01
Просмотров 50 тыс.
The Most Legendary Programmers Of All Time
11:49
Просмотров 539 тыс.
The moment we stopped understanding AI [AlexNet]
17:38
Просмотров 784 тыс.
The cloud is over-engineered and overpriced (no music)
14:39
AppleScript Tutorial : Alias, HFS & POSIX - OH MY!
4:23
Самые крутые игрушки
0:48
Просмотров 1,9 млн
Nika loves to eat chicken #cat #cats
0:17
Просмотров 45 млн
PRADO 250 - классная машина!
0:28
Просмотров 3,6 млн
🍁 Ты остался незамеченным
0:26
Самогон из маракуйи
0:59
Просмотров 1,8 млн