theawesomecoder61
  • Home
  • Projects
    • 010 Editor Templates
    • Chrome Web Store
    • Games >
      • Unrealistic Bowling
    • Javascript Bookmarklets
    • Mobile Apps
    • Software >
      • Cider
      • Earlier Works >
        • OS X
        • Windows
      • GPM Client
      • Ippy
      • Punify >
        • API docs
        • Help
        • Windows
      • SilentSpotify
      • Steam Menubar
    • TI Calculator Programs
    • Web Apps >
      • htmleditr
      • InstaDL
      • JSMeme
      • WriteUp
  • GitHub
  • Stack Overflow
  • Contact Me
© 2013-2017 Andrew M. (theawesomecoder61)

Punify API

Table of Contents

Applescript
Objective-C/Cocoa
URL schemes

Picture

Applescript

Applescript is an programming language created by Apple. Applescript is only available on Mac OS X and can be written and debugged with Script Editor.

How to use
  1. Open Script Editor
  2. In Script Editor, File > Open Dictionary > Punify.app or look to the right
  3. Script and debug away!
NOTE! Punify will open itself if it wasn't already open!

Examples
Yes, you can copy and paste these into Script Editor and they will work.
Code Editor

    
Code Editor

    
Code Editor

    
Everything you can use
  • playpause - plays/pauses the selected source
  • previous - plays the previous track
  • next - plays the next track
  • get - not implemented yet
    • songName - string, returns the song name
    • artistName - string, returns the artist name
    • albumName - string, returns the album name
    • lyrics - string, returns lyrics, if there are any
    • artwork - TIFF data as a string, returns the artwork in TIFF or nothing if there isn't any
    • playingState - Boolean, returns a Boolean stating if the selected source is playing
    • volume - integer, returns the current source's volume between 0-100
  • set
    • source - string (iTunes, Radium, Spotify, VOX), sets the current source
    • volume - integer (between 0-100), sets the volume for the current source

Picture

Objective-C/Cocoa

Since Punify has Applescript support, I have generated a header file for use in Objective-C/Cocoa. This means that you can control Punify from your Mac application.
Swift developers: While it is possible to tie this into your application, I have no idea how to do it because I don't write in Swift. You can look online for solutions?
Download the header file

URL schemes

Although URL schemes cannot return values (unlike Applescript), URL schemes only perform actions.

How to use
  1. Fire up a web browser and put in the desired URL scheme
  2. Push Enter/Return
or
  1. Use NSWorkspace (Obj-C, Swift), window.open (Javascript), or however you open a URL in the programming language you are writing in
  2. Put in the desired URL scheme
  3. The end
NOTE! Punify will open itself if it wasn't open!

Examples
Yes, you can copy and paste these into your code and they will work.
Code Editor

    
Run!
Code Editor

    
Run!
Everything you can use
  • action=show - shows Punify
  • action=hide - hides Punify
  • action=playpause - plays/pauses the selected source
  • action=previous - plays the previous track
  • action=next - plays the next track
  • source=<application name (iTunes, Spotify, VOX)> - sets the selected source
  • volume=<integer (between 0-100)> - set the current source's volume
Powered by Create your own unique website with customizable templates.
  • Home
  • Projects
    • 010 Editor Templates
    • Chrome Web Store
    • Games >
      • Unrealistic Bowling
    • Javascript Bookmarklets
    • Mobile Apps
    • Software >
      • Cider
      • Earlier Works >
        • OS X
        • Windows
      • GPM Client
      • Ippy
      • Punify >
        • API docs
        • Help
        • Windows
      • SilentSpotify
      • Steam Menubar
    • TI Calculator Programs
    • Web Apps >
      • htmleditr
      • InstaDL
      • JSMeme
      • WriteUp
  • GitHub
  • Stack Overflow
  • Contact Me