Help with Opening Spotify and start playlist
Moderators: Dorian (MJT support), JRL
Re: Help with Opening Spotify and start playlist
Ignore this reply!
Re: Help with Opening Spotify and start playlist
THAT MEANS THIS PART:
Code: Select all
//🠗IF I CLICKED NO, REACTIVATE SPOTIFY AGAIN AND MAXIMIZE SPOTIFY. NEEDS HELP WITH THIS LINES 31-54🠗
Else
// C:\Users\Miranda\AppData\Local\Temp\msrFBE6.scp
// Recorded on lördag, oktober 24, 2020, at 05:12 PM
//Recorded Events
Let>WW_TIMEOUT=5
CapsOn
MouseMove>485,749
Wait>1.613
//Clicking on:
//SnapShotFile>%BMP_DIR%snapshot_32.png
Wait>1.531
LClick
Wait>0.282
//Activating Window:
//SnapShotFile>%BMP_DIR%snapshot_33.png
WaitWindowOpen>Spotify Premium
MoveWindow>Spotify Premium,486,112
ResizeWindow>Spotify Premium,800,600
Wait>2.937
SetFocus>Niall Horan - On The Loose
MouseMoveRel>1219,127
Wait>8.959
LClick
- Dorian (MJT support)
- Automation Wizard
- Posts: 1358
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Help with Opening Spotify and start playlist
If you want to close Spotify I suggest trying either CloseWindow or KillProcess>spotify.exe
Yes, we have a Custom Scripting Service. Message me or go here
Re: Help with Opening Spotify and start playlist
I want that if I click the ”no” button when the macro asks me if I wanna continue what I did b4 the macro started, then the macro sets Spotify as active window and maximizing the Spotify window!
- Dorian (MJT support)
- Automation Wizard
- Posts: 1358
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Help with Opening Spotify and start playlist
I see. In that case between Else and Endif you need :
This does exactly as you ask.
Code: Select all
WindowAction>1,Spotify Premium
SetFocus>Spotify Premium
Yes, we have a Custom Scripting Service. Message me or go here
Re: Help with Opening Spotify and start playlist
Why does this part suddenly only clic on the playlist in the left sidebar but doesnt open the playlist and doesnt start the song? Havent changed anything in that part!
Code: Select all
run>Spotify.exe
WaitWindowOpen>Spotify Premium
Wait>10
UIFocus>{"Spotify Premium"},{"Niall Horan – Flicker (Deluxe)"}
Wait>1
UIClick>{"Spotify Premium"},{"Niall Horan – Flicker (Deluxe)"}
Wait>5
UIFocus>{"Spotify Premium"},{"Niall Horan – Flicker (Deluxe)"}
Wait>1
UIClick>{"Spotify Premium"},{"On The Loose"}
SetFocus>Spotify*
UIClick>{"Spotify Premium"},{"SPELA UPP"}
press ctrl
press left *20
release ctrl
- Dorian (MJT support)
- Automation Wizard
- Posts: 1358
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Help with Opening Spotify and start playlist
Could it be a timing issue? It may be too fast for Spotify. See if the reliability is improved with some waits.myran1178 wrote: ↑Mon Oct 26, 2020 10:25 amCode: Select all
UIClick>{"Spotify Premium"},{"On The Loose"} SetFocus>Spotify* UIClick>{"Spotify Premium"},{"SPELA UPP"} press ctrl press left *20 release ctrl
Maybe re-run the Find Object Wizard on those buttons and see if the code is the same. Maybe something has changed.
I'm not too sure why you focus>click>focus again, and only you will know from your experiments if that was intentional and necessary. I'm assuming it's intentional as you said it did what you wanted. Other than that, I think I am out of suggestions.
Yes, we have a Custom Scripting Service. Message me or go here
Re: Help with Opening Spotify and start playlist
how could that part work differently now than before without any changes?
- Dorian (MJT support)
- Automation Wizard
- Posts: 1358
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Help with Opening Spotify and start playlist
Sometimes there can be subtle underlying changes to an application that we may not notice. It's sometimes worth re-running the Wizard again to rule that out.
Yes, we have a Custom Scripting Service. Message me or go here
Re: Help with Opening Spotify and start playlist
solved it before I read your reply. Now I will finally test your idea for when clicking no in the message.
- Dorian (MJT support)
- Automation Wizard
- Posts: 1358
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Help with Opening Spotify and start playlist
Would you like to share your solution to help others?
It's good to see you becoming self sufficient. You'll be a pro before you know it.
It's good to see you becoming self sufficient. You'll be a pro before you know it.
Yes, we have a Custom Scripting Service. Message me or go here
Re: Help with Opening Spotify and start playlist
Now I runned the full code with your "windowsaction. set focus" idea at the end. This error displays.
https://imgur.com/a/avr7Rur
The "Line 27" that the error is talking about is this line:
https://imgur.com/a/avr7Rur
The "Line 27" that the error is talking about is this line:
Code: Select all
WindowAction>1,Spotify Premium
Re: Help with Opening Spotify and start playlist
I will post my final solution! When my full script is fully finished!Dorian (MJT support) wrote: ↑Mon Oct 26, 2020 6:34 pmWould you like to share your solution to help others?
It's good to see you becoming self sufficient. You'll be a pro before you know it.
Re: Help with Opening Spotify and start playlist
If you wrote this script, how would your full code be?
- Dorian (MJT support)
- Automation Wizard
- Posts: 1358
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Help with Opening Spotify and start playlist
Then edit it to reflect the actual name of the window. This worked perfectly when I used it on Spotify Free. You can use the built in tool to find system windows, or use GetActiveWindow to ensure your window title is correct.myran1178 wrote: ↑Mon Oct 26, 2020 6:40 pmNow I runned the full code with your "windowsaction. set focus" idea at the end. This error displays.
https://imgur.com/a/avr7Rur
The "Line 27" that the error is talking about is this line:Code: Select all
WindowAction>1,Spotify Premium
https://help.mjtnet.com/article/212-fin ... cannot-see
https://help.mjtnet.com/article/31-how- ... ect-window
Yes, we have a Custom Scripting Service. Message me or go here