AppMachine Help Center

How can we help you?

Follow

Logic script examples

Logic Script examples

 (Logic tab --> Script action)

 

-- App --

PlayMusic / PlayAudio

Description: Play music

Methods:

- playmusic(string url)

- playmusic(string title, string url)

- playmusic(string title, string url, string artists, string artworkUrl)

- playmusic(string title, string url, string artists, string artworkUrl, string purchaseUrl)

Example: app.playmusic("Sample Track", "http://url.to.track", "Artist", "http://artwork.url");

Example: app.playmusic(screen.currentitem.title, screen.currentitem.enclosure.url, "", screen.currentitem.media_content.url)

 

This will use the fields from your Excel or Web Service.

 

title

title

enclosure_url

url to the stream

media_content_url

cover art image

 

StopMusic

Description: Stop the currently playing track

Method: stopmusic()

Example: app.stopmusic();

 

Save Event to your Calendar App.

Description: Save event to calendar upon click of a button.

Method: start.start => app.addevent(name, startDate, endDate, location, url)

Example:

start.start => app.addevent("Dance Event 2016", "08/25/2016 18:00", "08/25/2016 23:30", "Amsterdam, the Netherlands", "http://www.danceevent.com") 

fields from Web Service or Excel

start.start => app.addevent(screen.currentitem.eventTitle,  screen.currentitem.eventStartTime,  screen.currentitem.eventEndTime, screen.currentitem.location, screen.currentitem.website)

 

-- WebService --

 

Execute:

Description: Call this method to execute the webservice. When a previous result is available that will be the result of this method.

Method: execute()

Example: webservice.execute();

 


 

 

Was this article helpful?
1 out of 4 found this helpful
Have more questions? Submit a request

Comments

  • Avatar
    Patrick van Gogh

    Can you give an example of the intended use of the properties? Are they meant to be used in a Script-action in the OnClick-repsonse of a button, for example?

    Edited by Patrick van Gogh
  • Avatar
    Johnny Boersma
    Hello Patrick, Yes they can be used in the Logic tab with a script block. You can use the {device:fieldname} (id/currentdate etc.) in web services as parameters in combination with a button for example.
  • Avatar
    Scott30134

    Is there a full list of these methods? Where do we find the options and variables???

  • Avatar
    Chris

    I would like to have this documentation either.
    There are so many different variables used in so many different cases.

  • Avatar
    Joost de Graaf

    I would like to call a block from a script. Not with the default goto function. But from a script so that I can pass a variable. So one variable goto block A and another variable goto block B