New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy URL to clipboard for current track, artist and album #221

leegenes opened this Issue Jan 5, 2018 · 2 comments


2 participants

leegenes commented Jan 5, 2018

Would be great to add functionality to copy a URL/URI to the clipboard from track info for track/artist/album.

  • another item in the track menu
  • change option and command key modifiers on album and artist, respectively, in the current track results from current redundancy to a copy URL/URI to clipboard functionality
  • utilize currently unused modifiers in the share with osx sharing

Use case:

  • I'm always sharing songs in slack, and currently I'm going to the desktop app to copy links [citing reliability/crashing issues with osx sharing]

If interested, I'm happy to try to take this on. Haven't had a chance to dig into to see where this happens.

@vdesabou vdesabou self-assigned this Jan 8, 2018


This comment has been minimized.


vdesabou commented Jan 8, 2018

There's actually a way for Alfred to copy some text by invoking CTRL-C on an item.

Right now, I've only implemented it in Current Track:

screenshot 2018-01-08 at 09 57 41

Here if I execute CTRL-C on first row, then I get in clipboard: "#NowPlaying S.A.Y. - Original Mix by Compact Grey"

You can see how this is done in firstDelimiter.php, line 782:

                $w->result(null, serialize(array(
                            $results[4] /*track_uri*/,
                            '' /* album_uri */,
                            '' /* artist_uri */,
                            '' /* playlist_uri */,
                            '' /* spotify_command */,
                            '' /* query */,
                            '' /* other_settings*/,
                            'pause' /* other_action */,
                            escapeQuery($results[1]) /* artist_name */,
                            escapeQuery($results[0]) /* track_name */,
                            escapeQuery($results[2]) /* album_name */,
                            '' /* track_artwork_path */,
                            '' /* artist_artwork_path */,
                            '' /* album_artwork_path */,
                            '' /* playlist_name */,
                            '', /* playlist_artwork_path */
                        )), $added.escapeQuery($results[0]).' ● '.escapeQuery($results[1]).' ● '.escapeQuery($results[2]).' ● '.floatToStars(($results[6] / 100) ? $is_display_rating : 0).' '.beautifyTime($results[5] / 1000), array(
                        'alt' => 'Play album '.escapeQuery($results[2]).' in Spotify',
                        'cmd' => 'Play artist '.escapeQuery($results[1]).' in Spotify',
                        'fn' => 'Add track '.escapeQuery($results[0]).' to ...',
                        'shift' => 'Add album '.escapeQuery($results[2]).' to ...',
                        'ctrl' => 'Search artist '.escapeQuery($results[1]).' online',
                    ), ($results[3] == 'playing') ? './images/pause.png' : './images/play.png', 'yes', array(
                            'copy' => '#NowPlaying ' . escapeQuery($results[0]).' by '.escapeQuery($results[1]) . $shared_url,
                            'largetype' => escapeQuery($results[0]).' by '.escapeQuery($results[1]),
                        ), '');

So it should be possible to do what you want by adding an array with copy and large type (CTRL-L) on every item


This comment has been minimized.

leegenes commented Jan 8, 2018

thanks, @vdesabou. this is exactly what i was looking for. would be a nice-to-have, even if not a big win, to have similar functionality on album and artist. though personally i'm many times more likely to share one track than a spotify artist page. so knowing this will make my days better already.

vdesabou added a commit that referenced this issue Jan 26, 2018

@vdesabou vdesabou added this to the 7.7 milestone Jan 26, 2018

@vdesabou vdesabou changed the title from Copy current URL/URI to clipboard for track [and artist, album?] to Copy URL to clipboard for current track, artist and album Jan 26, 2018

@vdesabou vdesabou closed this Jan 26, 2018

vdesabou added a commit that referenced this issue Feb 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment