Jump to content

Danilo

Member
  • Posts

    17
  • Joined

  • Last visited

Everything posted by Danilo

  1. Just got it to work. Thank you again @vitor and sorry for asking again and again, I'm a newby to coding and just started using Alfred. Here's the Workflow if it interest to anyone. https://www.dropbox.com/s/nkq0ini27slp5o7/Apple Music Lyrics.alfredworkflow?dl=0
  2. Yep, here's the current code: on workflow() --display dialog "workflow()" tell application "Safari" set myurl to URL of current tab of first window set the clipboard to myurl end tell --display dialog myurl tell application "Downie" to activate tell application "System Events" to tell application process "Downie" click menu item "Open URLs..." of menu "File" of menu bar item "File" of menu bar 1 click menu item "Paste" of menu "Edit" of menu bar item "Edit" of menu bar 1 key code 76 using {command down} end tell end workflow on init(appName) if appIsRunning(appName) then --display dialog "running" workflow() else --display dialog "starting" set appNameAsText to appName as text tell application appNameAsText to activate delay 0.1 init(appName) end if end init on appIsRunning(appName) tell application "System Events" to (name of processes) contains appName end appIsRunning init("Downie")
  3. It was the first thing I tried here. I don't know why, but it didn't work. I tried using Webkit instead of Safari but it didn't work too.
  4. Take a look ate these two shortcuts: https://www.icloud.com/shortcuts/20a3dd5a728041ea85ba93de399d9f04 https://www.icloud.com/shortcuts/05e5d4172cbe47c586de77c5b2c14a46 Since Alfred runs AppleScripts much master than Shortcuts.app, I just wanted to "convert" these shortcuts into workflows. I tried to create the Workflow using Keyword as Input than I used the Run Script action. https://www.dropbox.com/s/tnue4ex4zmx6rxo/Apple Music.alfredworkflow?dl=0
  5. @vitor can you help to modify this workflow to work with Safari? I tried changing the code but it's not working. I know that Downie has a Safari Extension but I don't want to clutter the toolbar with various icons. Thank you in advance!
  6. Hi @vitor. Please could you help with this one?
  7. I have two Shortcuts that I frequently use to see the lyrics of the current playing track. The first one toggles the Music miniplayer showing the lyrics and the other one shows up the lyrics on the main Music window. I'm trying to convert these shortcuts to alfred workflows but I don't know what am I missing. The workflow structure is Keyword as Input and then Run Script. The codes I'm using are: 1) Show Lyrics on Music miniplayer on run {input, parameters} tell application "System Events" delay 0.5 keystroke "m" using {command down, shift down} end tell return input end run 2) Show Lyrics on main Music window on run {input, parameters} tell application "System Events" delay 0.5 keystroke "u" using {command down, control down} end tell return input end run As Shortcuts these codes are working fine, but not as workflows. What am I missing? Can anyone help?
  8. Vitor what code should I add if instead of wait then resize I wanted to just open the video in PiP mode? I found that script in the link below but i dont know how to add it to my code. https://gist.github.com/danielrotaermel/201f549d5755ea886eb78bb660133722
  9. Now it worked, but that "Open File" window is being shown again when QT start to run.
  10. My code didn't work when the language was set to /bin/bash, but then I changed the it to /usr/bin/osascript (JavaScript) and replaced Application ("QuickTime Player") with just QuickTime. Now it is working. The only problem is that the coordinates are not right as I thought it was and also after resizing and moving the window QT resizes the window again to the video resolution size. Here's one copy of the Workflow with the full code and a real URL. https://www.dropbox.com/s/2obcl2am9i0u4fy/Next TV test.alfredworkflow?dl=0
  11. Wow!!! Now it is working like I wanted. The last thing I was trying here was setting the screen position that QT would open, so I added a new line of code: Application("QuickTime Player").windows[0].bounds = {"x":739, "y":262, "width":1498, "height":689} However it didn't work. I'd like to resize and centralize QT window. What am I doing wrong?
  12. This one worked, but now when I run the workflow for the first time, QuickTime run and show that "Open File" window and then it open the player window: Is it possible to prevent QT opening the "Open File" window?
  13. Hi Vitor. I just set the Workflow and everything is working seamlessly. The only thing I'd like to change is QuickTime's behavior when it is already playing a URL and I send a new one to it. Instead of closing the current window, it opens a second QT window with the new URL. Is it possible to add something to the Workflow that would close the current QT window and then open the new http URL?
  14. Now it is working!!! I mistyped the script line. I'll complete the workflow with all URL as argument and check it all again to see if it works seamlessly. If it does, then I'll let you know here. Thank you so much Vitor!! šŸ™šŸ¼
  15. I deleted the unnecessary lines and fixed the code: šŸ˜” but it still not working: The List Filter argument is just a http url.
  16. Hi Vitor, thanks for answering! So I let just the URL as argument: Then I set the Run Script language to /bin/bash and added the Script open -a "QuickTime Player' "${1}". Did I added the Script line in the wrong place? Do I have to delete query=$1 echo -n $query?
  17. Hi all. I have a workflow that lists tv channels (http links) and then opens the chosen one on OPlayer using the Open URL action. The workflow works seamlessly when I use OPlayer url scheme (oplayer://http://example.com.m3u8) as an argument in List Filter action. However, OPlayer for Mac has a few glitches, so Iā€™d like to start using QuickTime Player in its place. The problem is that I didnā€™t find the QuickTimeā€™s URL scheme and the only way I found out to send the link to QT is through a script. The script looks like: open -a "quicktime player" http://example.com.m3u8. I tried to use it as an argument but it didnā€™t work. So I replaced the Open URL action with the Run Script action and it still not working. This is the first time Iā€™m trying to make a workflow and also I donā€™t know a lot about scripting, thatā€™s why I need your help. I know I could do it all with one script, but since my scripting knowledge is limited, I think the structure of actions Iā€™m using (List Filter -> Open URL) is easier for me to understand. Can anyone help me with this? Can I use a script line as an argument? What action should I use to replace Open URL when the argument is a script line? Thank you all in advance!
×
×
  • Create New...