Jump to content

Search the Community

Showing results for tags 'spotify'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum FAQ
  • AutoIt

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 3 results

  1. Thanks to LarsJ's excellent UIASpy application I was able to grab the now playing and track elapsed / duration from Spotify in about 15 minutes https://www.autoitscript.com/forum/topic/196833-uiaspy-ui-automation-spy-tool/ You will need junkew's CUIAutomation2.au3 from the above UDF
  2. ;****************************************************************** ;Spotify Automation: Start spotify and play a playlist ;v1.01 27/04/2018 ;------------------------------------------------------------------ ;by Daniel Barnes ;------------------------------------------------------------------ ;v1.01 27/04/2018 ;restarts spotify if it fails the first time ;works on computers that minimize Spotify to tray ;instead of closing it, and have a different ui element selected ;such as the Devices available option when spotify is started ;------------------------------------------------------------------ ;v1.00 25/04/2018 ;initial version ;------------------------------------------------------------------ ;Replace the below with the Spotify URI ;If you right click the playlist> share> copy spotify uri ;you can find the uri $spotifyURI = "spotify:user:12177300374:playlist:0iaTAvHRSaIkD23ofl2tck" ;****************************************************************** ;if this script breaks in the future, figure this out using the AutoIt Window Info Tool Const $SpotifyWindowIdentifier = "[Title:Spotify;Class:Chrome_WidgetWin_0]" ;NOTE ABOUT SHUFFLE: ;I couldn't automate turning shuffling on or off ;I can toggle it, but I cannot figure out the current state ;If you want to shuffle, turn on shuffle in Spotify prior ;to running this script PlaySpotifyPlaylist($spotifyURI) Func PlaySpotifyPlaylist($spotifyURI,$retry = 0) ;terminate spotify process on subsequent attempts If $retry Then echo ("Closing existing Spotify process") ProcessClose("Spotify.exe") endif echo ("Launching Spotify URI") ShellExecute($spotifyURI) ;Pause any existing song playing (if there is any) ;this is because Spotify's window title is only 'Spotify' when it is not playing any songs If Not WinExists($SpotifyWindowIdentifier) Then echo ("Pausing existing song (To find spotify window)") $timer = TimerInit() While Not WinExists($SpotifyWindowIdentifier) Send("{MEDIA_PLAY_PAUSE}") Sleep(500) If TimerDiff($timer) > 5 * 1000 Then ErrorMsg ("Timed out trying pause existing song") WEnd endif ;Get Spotify Window Handle $hwndSpotify = WinGetHandle($SpotifyWindowIdentifier) echo ("Attempting to play playlist") $timer = TimerInit() While WinGetTitle($hwndSpotify) = "Spotify" ;once it is playing the song, the title changes to the name of the song WinActivate($hwndSpotify) ControlSend($hwndSpotify,"","","{ENTER}") ;space will play what was previously playing (even another playlist or song), enter will play the playlist ;) Sleep(1000) If TimerDiff($timer) > 5 * 1000 Then If $retry Then ErrorMsg ("Timed out trying to play playlist") else Return PlaySpotifyPlaylist($spotifyURI,$retry+1) endif endif WEnd EndFunc Func echo($text) ConsoleWrite ($text&@CRLF) EndFunc Func ErrorMsg($text) MsgBox(16,StringTrimRight(@ScriptName,4),$text) Exit EndFunc
  3. Hello guys I would like to be able to change songs on spotify using shourtcuts on my keyboard due to the fact i don't own a keyboard with extra keys providing this feature. Therefor I've made a script binding my keys to make this possible, but i have a few issues and I think there is a easier or better way of creating this script. I hope someone can have a look and tell me what i could improve. Some of the issues are: I have to wait a little time before i will be able to change song right after i just changed. (I can't spam ALT + Right) Doesn't work when im inside a game. This is actually a big issue for me. My current code which works: HotKeySet("!{left}", "Previous") HotKeySet("!{right}","naeste") HotKeySet("!{down}","current") HotKeySet("{DEL}","quit") While 1 Sleep(100) WEnd Func naeste() Sleep(400) ControlSend("Spotify", "", "", "^{right}") EndFunc Func Previous() Sleep(400) ControlSend("Spotify", "", "", "^{left}") EndFunc Func Current() Local $song = WinGetTitle("Spotify", "") TrayTip("", $song, 1) EndFunc Func quit() Exit 0 EndFunc - AliOzturk
×
×
  • Create New...