Currently I am using this applescript to start a slideshow:
set theAlbumName to "Test"
tell application "Photos"
start slideshow using media items of album theAlbumName
end tell
However, no matter what I do, there is always music when the slide show starts.
There are videos in my slide show and I do not want music playing over them.
Is there any way to NOT have music, or change the music to something different (an empty sound file?) when you call it from the applescript?
I have tried deleting the project's music, but when I call the slideshow from applescript, there is still music.
Thanks in advance.
Related
I would like to control VLC Media Player using hotkeys while typing in Word or Pages (without having to have VLC Media Player be the active window).
Can I use AppleScript to do this? I am editing video transcripts and, at the moment, have to toggle between programs to control the active window. I would love to be able to press hotkeys to:
rewind
jump back 5 seconds
play/pause
fast forward
jump forward 5 seconds
Thank you so much for any help you can offer. I've never used AppleScript and appreciate any help.
I used a free hotkey assigner called Spark and inserted Applescript for these functions, following a tutorial on how to do this for transcription, but it didn't work. (I did it for Quicktime but would actually prefer to use VLC Media Player. Either would be great, though).
https://www.engadget.com/2008-06-26-simplify-media-transcription-with-hotkeys-and-applescript.html
Jump back:
tell document 1 of application "QuickTime Player" to set current time to (current time - 2500)
Play/pause:
tell document 1 of application "QuickTime Player"
if playing is true then
pause
else
start
end if
end tell
Jump forward:
tell document 1 of application "QuickTime Player" to set current time to (current time + 2500)
By default, VLC will keep the songs that were played in the last session as part of the playlist. I have an AppleScript that plays music that is stored as MP3 files in a folder.
tell application "VLC"
set thePlaylist to "file:////Users/[username]/Music/Playlist"
OpenURL thePlaylist
end tell
Since VLC stores the last songs, it will start playing from wherever the song was last and then play from this playlist afterwards.
I've tried a couple of commands, but I haven't been able to clear the playlist from my AppleScript.
Short answer: you can't do this through AppleScript. VLC's scripting dictionary is only a list of verbs — actions that can be performed on the current playing item — it has no nouns or object references that would let you specify things like 'playlists', 'videos', 'tracks', etc. There is no way to 'talk' to VLC about anything other than the currently queued item.
That might be something to report to VLC's developer. It's a weak AppleScript dictionary.
You might be able to fix this in VLC's Preferences. Looking at the full settings in VLC (click the "Show All" button at the bottom left) the two I highlighted seem like the might give you some control. There might be other setting that I didn't see; you should look through the options.
There is currently no keyboard shortcut to play videos in the new Mac Photos application.https://discussions.apple.com/thread/6996731?start=0&tstart=0
Rather than be frustrated in manually clicking the "play" button hundreds of times, I would like to run an Applescript to play/pause with a keyboard shortcut. I tried with no success:
tell application "photos"
"play" video
end tell
Any help advice on this would be appreciated.
Thanks
Just to update Paul's response, in Photos 2.0 (3150.4.120), you need to hit TAB twice, then spacebar will start playback. Similarly you need to hit TAB twice once you are done playing it, and then (and only then) spacebar will take you back to the grid view of your thumbnails.
If you do not mind a slightly time-consuming workaround, you can enslave Automator to create a Service that will subsequently respond to a keyboard shortcut. You can find the instructions here.
Since your goal is to use the keyboard, there's a better option for you. After selecting a video with cursor keys or mouse, press space to maximize the video, and then press TAB. Then space will start the video playing, left and right arrows will move frame-by-frame. Hitting TAB again will allow the space bar to return the video to its normal size.
Apparently this changes the focus to the pane with the movie so that space can start it, or perhaps it changes focus to the movie controls? IMHO, whatever it does, it's not very intuitive and badly needs to documented and preferably fixed.
More info at:
https://discussions.apple.com/thread/6996731?start=0&
2020 / Photos 6.0:
You can now toggle playback with Option + Space
or do it manually via "Image" -> "Start Playback".
Autoplay Script
repeat while application "Photos" is running
delay 1
try
tell application "System Events"
tell process "Photos"
click menu item "Start Playback" of menu "Image" of menu bar 1
end tell
end tell
end try
end repeat
Save it as autoplay.scpt and run it with osascript autoplay.scpt.
The script exits when you close the Photos application.
Not sure if I'm missing something, but my old go to in AppleScript for getting a selection of tracks seems to specifically NOT work on the new Movies > Home Videos view in iTunes 11.
tell application "iTunes"
get selection from browser window 1
end tell
Also tried below as implied here https://discussions.apple.com/thread/4576448?start=0&tstart=0
tell application "iTunes"
get selection
end tell
If I'm viewing the Home Videos collection, this returns {} regardless of what I have selected. If I switch to Movies > Movies and select some entries, this works as expected. Same if I'm viewing a playlist under Music.
I'm trying to write some AppleScript that checks if PowerPoint 2011 is currently playing a presentation.
Previously, I wrote the following code for Keynote.
on isKeynotePlaying()
tell application "Keynote"
get properties
return (not frozen) and playing
end tell
end isKeynotePlaying
After searching through PowerPoint's AppleScript library, properties and attributes of classes, and Google search results, I still haven't been able to generate an equivalent solution. Any ideas?
After delving even deeper into PowerPoint's AppleScript library, I stumbled upon the slide show view class. Here's my solution.
on isPowerPointPlaying()
tell application "Microsoft PowerPoint"
return slide state of slide show view of slide show window of active presentation is slide show state running
end tell
end isPowerPointPlaying