Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > iTunes access from another machine?

iTunes access from another machine?
Thread Tools
Jelle Monkmater
Dedicated MacNNer
Join Date: Apr 2001
Location: World capital of drugs and prostitution. Hmmm... SEXTC...
Status: Offline
Reply With Quote
Dec 14, 2001, 07:20 PM
 
Hi there,

I have a G4 and an iBook. The G4 is on 24/7, and most of the time is running iTunes. Also most of the time, I'm working on my iBook. Now I was wondering if it was possible to control the iTunes application on my G4 using my iBook. I've got an Ethernet connection between the two and can mount the partitions. Also, I can tunnel to the other machine using ssh.

Can I use AppleScript to just tell iTunes to change equalizer settings, the volume or skip to the next song? Are there command line possibilities? Does anyone know?

TIA.
The one you love and the one who loves you are never the same person.
     
gorgonzola
Admin Emeritus
Join Date: Nov 2000
Location: New Yawk
Status: Offline
Reply With Quote
Dec 14, 2001, 07:33 PM
 
Can I use AppleScript to just tell iTunes to change equalizer settings, the volume or skip to the next song?
I'm pretty sure you can. You can say something like:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>tell application <font color = red>"iTunes"</font> of computer <font color = red>"ip.ad.dr.es"</font></font>[/code]

and then use the iTunes AppleScript commands, which I don't recall, but I believe you can read by dragging iTunes onto Script Editor or some such thing.

AppleScript is probably your best bet; there's definitely no way through SSH. Synotic probably knows the AS commands for it.
"Do not be too positive about things. You may be in error." (C. F. Lawlor, The Mixicologist)
     
juanvaldes
Addicted to MacNN
Join Date: Mar 2001
Location: Seattle, WA
Status: Offline
Reply With Quote
Dec 14, 2001, 10:48 PM
 
Here are the complete apple script commands:
Standard Suite: Common terms for most applications

close: Close an object
close reference -- the object to close

count: Return the number of elements of a particular class within an object
count reference -- the object whose elements are to be counted
each type class -- the class of the elements to be counted. Keyword 'each' is optional in AppleScript
Result: integer -- the number of elements

delete: Delete an element from an object
delete reference -- the element to delete

duplicate: Duplicate one or more object(s)
duplicate reference -- the object(s) to duplicate
[to location reference] -- the new location for the object(s)
Result: reference -- to the duplicated object(s)

exists: Verify if an object exists
exists reference -- the object in question
Result: boolean -- true if it exists, false if not

make: Make a new element
make
new type class -- the class of the new element. Keyword 'new' is optional in AppleScript
[at location reference] -- the location at which to insert the element
[with properties record] -- the initial values for the properties of the element
Result: reference -- to the new object(s)

open: open the specified object(s)
open reference -- list of objects to open

run: run iTunes
run

quit: quit iTunes
quit

set:
set reference
to anything
iTunes Suite: The event suite specific to iTunes

add: add one or more files to a playlist
add a list of alias -- the file(s) to add
[to location reference] -- the location of the added file(s)
Result: track -- reference to added track(s)

fast forward: skip forward in a playing track
fast forward

next track: advance to the next track in the current playlist
next track

pause: pause playback
pause

play: play the current track or the specified track or file.
play reference -- item to play

previous track: return to the previous track in the current playlist
previous track

rewind: skip backwards in a playing track
rewind

stop: stop playback
stop

Class application: The application program
Elements:
browser window by numeric index, by name, by ID
encoder by numeric index, by name, by ID
EQ preset by numeric index, by name, by ID
EQ window by numeric index, by name, by ID
playlist window by numeric index, by name, by ID
source by numeric index, by name, by ID
visual by numeric index, by name, by ID
window by numeric index, by name, by ID
Properties:
current encoder encoder -- the currently selected encoder (MP3, AIFF, WAV, etc.)
current EQ preset EQ preset -- the currently selected equalizer preset
current track track [r/o] -- the current targeted track
current visual visual -- the currently selected visual plug-in
EQ enabled boolean -- is the equalizer enabled?
fixed indexing boolean -- true if all AppleScript track indicies should be independent of the play order of the owning playlist.
frontmost boolean -- is iTunes the frontmost application?
full screen boolean -- are visuals displayed using the entire screen?
name Unicode text [r/o] -- the name of the application
mute boolean -- has the sound output been muted?
player position integer -- the player’s position within the currently playing track in seconds.
player state stopped/playing/paused/fast forwarding/rewinding [r/o] -- is iTunes stopped, paused, or playing?
selection reference [r/o] -- the selection visible to the user
sound volume integer -- the sound output volume (0 = minimum, 100 = maximum)
version version [r/o] -- the version of iTunes
visuals enabled boolean -- are visuals currently being displayed?
visual size small/medium/large -- the size of the displayed visual

Class audio CD playlist: a playlist representing an audio CD
Plural form:
audio CD playlists
Elements:
audio CD track by numeric index, by name, by ID
Properties:
&lt;Inheritance&gt; playlist [r/o] -- inherits some of its properties from the playlist class
artist Unicode text -- the artist of the CD
genre Unicode text -- the genre of the CD

Class audio CD track: a track on an audio CD
Plural form:
audio CD tracks
Properties:
&lt;Inheritance&gt; track [r/o] -- inherits some of its properties from the playlist class

Class browser window: the main iTunes window
Plural form:
browser windows
Properties:
&lt;Inheritance&gt; window [r/o] -- inherits some of its properties from the window class
minimized boolean -- is the small player visible?
selection reference [r/o] -- the selected songs
view playlist -- the playlist currently displayed in the window

Class device playlist: a playlist representing the contents of a portable device
Plural form:
device playlists
Elements:
device track by numeric index, by name, by ID
Properties:
&lt;Inheritance&gt; playlist [r/o] -- inherits some of its properties from the playlist class

Class device track: a track residing on a portable music player
Plural form:
device tracks
Properties:
&lt;Inheritance&gt; track [r/o] -- inherits some of its properties from the playlist class

Class encoder: converts a track to a specific file format
Plural form:
encoders
Properties:
&lt;Inheritance&gt; item [r/o] -- inherits some of its properties from the item class
format Unicode text [r/o] -- the data format created by the encoder

Class encoder configuration: the settings for a particular encoder
Plural form:
encoder configurations
Properties:
&lt;Inheritance&gt; item [r/o] -- inherits some of its properties from the item class
modifiable boolean [r/o] -- can this configuration be modified?

Class EQ preset: equalizer preset configuration
Plural form:
EQ presets
Properties:
&lt;Inheritance&gt; item [r/o] -- inherits some of its properties from the item class
band 1 small real -- the equalizer 32 Hz band level (-12.0 dB to +12.0 dB)
band 2 small real -- the equalizer 64 Hz band level (-12.0 dB to +12.0 dB)
band 3 small real -- the equalizer 125 Hz band level (-12.0 dB to +12.0 dB)
band 4 small real -- the equalizer 250 Hz band level (-12.0 dB to +12.0 dB)
band 5 small real -- the equalizer 500 Hz band level (-12.0 dB to +12.0 dB)
band 6 small real -- the equalizer 1 kHz band level (-12.0 dB to +12.0 dB)
band 7 small real -- the equalizer 2 kHz band level (-12.0 dB to +12.0 dB)
band 8 small real -- the equalizer 4 kHz band level (-12.0 dB to +12.0 dB)
band 9 small real -- the equalizer 8 kHz band level (-12.0 dB to +12.0 dB)
band 10 small real -- the equalizer 16 kHz band level (-12.0 dB to +12.0 dB)
modifiable boolean [r/o] -- can this preset be modified?
preamp small real -- the equalizer preamp level (-12.0 dB to +12.0 dB)

Class EQ window: the iTunes equalizer window
Plural form:
EQ windows
Properties:
&lt;Inheritance&gt; window [r/o] -- inherits some of its properties from the window class
minimized boolean -- is the small EQ window visible?

Class file track: a track representing an audio file (MP3, AIFF, etc.)
Plural form:
file tracks
Properties:
&lt;Inheritance&gt; track [r/o] -- inherits some of its properties from the playlist class
location alias [r/o] -- the location of the file represented by this track

Class item: an item
Plural form:
items
Properties:
container reference [r/o] -- the container of the item
name Unicode text -- the name of the item

Class library playlist: the master music library playlist
Plural form:
library playlists
Elements:
file track by numeric index, by name, by ID
URL track by numeric index, by name, by ID
Properties:
&lt;Inheritance&gt; playlist [r/o] -- inherits some of its properties from the playlist class

Class playlist: a list of songs/streams
Plural form:
playlists
Elements:
track by numeric index, by name, by ID
Properties:
&lt;Inheritance&gt; item [r/o] -- inherits some of its properties from the item class
duration integer [r/o] -- the total length of all songs (in seconds)
index integer [r/o] -- the index of the playlist in internal application order
name Unicode text -- the name of the playlist
shuffle boolean -- play the songs in this playlist in random order?
size double integer [r/o] -- the total size of all songs (in bytes)
song repeat off/one/all -- playback repeat mode
time Unicode text [r/o] -- the length of all songs in MM:SS format
visible boolean [r/o] -- is this playlist visible in the Source list?

Class playlist window: a sub-window showing a single playlist
Plural form:
playlist windows
Properties:
&lt;Inheritance&gt; window [r/o] -- inherits some of its properties from the window class
selection reference [r/o] -- the selected songs
view playlist [r/o] -- the playlist displayed in the window

Class radio tuner playlist: the radio tuner playlist
Plural form:
radio tuner playlists
Elements:
URL track by numeric index, by name, by ID
Properties:
&lt;Inheritance&gt; playlist [r/o] -- inherits some of its properties from the playlist class

Class source: a music source (music library, CD, device, etc.)
Plural form:
sources
Elements:
audio CD playlist by numeric index, by name, by ID
device playlist by numeric index, by name, by ID
library playlist by numeric index, by name, by ID
playlist by numeric index, by name, by ID
radio tuner playlist by numeric index, by name, by ID
user playlist by numeric index, by name, by ID
Properties:
&lt;Inheritance&gt; item [r/o] -- inherits some of its properties from the item class
capacity double integer [r/o] -- the total size of the source if it has a fixed size
free space double integer [r/o] -- the free space on the source if it has a fixed size
kind library/iPod/audio CD/MP3 CD/device/radio tuner/unknown [r/o]

Class track: playable audio source
Plural form:
tracks
Properties:
&lt;Inheritance&gt; item [r/o] -- inherits some of its properties from the item class
album Unicode text -- the album containing the track
artist Unicode text -- the artist/source of the track
bit rate integer [r/o] -- the bit rate of the track (in kbps)
comment Unicode text -- freeform notes about the track
database ID integer [r/o] -- the common, unique ID for this track. If two tracks in different playlists have the same database ID, they are sharing the same data.
date added date [r/o] -- the date the track was added to the playlist
duration integer [r/o] -- the length of the track in seconds
enabled boolean -- is this track checked for playback?
EQ Unicode text -- the name of the EQ preset of the track
genre Unicode text -- the music/audio genre (category) of the track
kind Unicode text [r/o] -- a text description of the track
modification date date [r/o] -- the modification date of the content of this track
sample rate integer [r/o] -- the sample rate of the track (in Hz)
size integer [r/o] -- the size of the track (in bytes)
time Unicode text [r/o] -- the length of the track in MM:SS format
track count integer -- the total number of tracks on the source album
track number integer -- the index of the track on the source album
volume adjustment integer -- relative volume adjustment of the track (-100% to 100%)
year integer -- the year the track was recorded/released

Class URL track: a track representing a network stream
Plural form:
URL tracks
Properties:
&lt;Inheritance&gt; track [r/o] -- inherits some of its properties from the playlist class
address Unicode text -- the URL for this track

Class user playlist: custom playlists created by the user
Plural form:
user playlists
Elements:
file track by numeric index, by name, by ID
URL track by numeric index, by name, by ID
Properties:
&lt;Inheritance&gt; playlist [r/o] -- inherits some of its properties from the playlist class

Class visual: a visual plug-in
Plural form:
visuals
Properties:
&lt;Inheritance&gt; item [r/o] -- inherits some of its properties from the item class

Class window: any window
Plural form:
windows
Properties:
&lt;Inheritance&gt; item [r/o] -- inherits some of its properties from the item class
bounds bounding rectangle -- the boundary rectangle for the window
closeable boolean [r/o] -- does the window have a close box?
collapseable boolean [r/o] -- does the window have a collapse (windowshade) box?
collapsed boolean -- is the window collapsed?
position point -- the upper left position of the window
resizable boolean [r/o] -- is the window resizable?
visible boolean -- is the window visible?
zoomable boolean [r/o] -- is the window zoomable?
zoomed boolean -- is the window zoomed?
Internet suite: Standard terms for Internet scripting

open location: Opens a URL to an audio stream
open location string -- the URL to open
You can access all of this by opening up apple script. in the file menu is "dictionary" and browse down to iTunes.

Enjoy!
You can also do what Cheerios and I do and that is put all of your music in your shared folder, mount that on your other comp, then just add all of the songs to your local copy of iTunes. Then control everything right from there.
The spirit of resistance to government is so valuable on certain occasions, that I wish it always to be kept alive.
- Thomas Jefferson, 1787
     
Scrod
Mac Elite
Join Date: Jan 2001
Location: Sad King Billy's Monument on Hyperion
Status: Offline
Reply With Quote
Dec 14, 2001, 11:06 PM
 
Originally posted by gorgonzola:
<STRONG>
AppleScript is probably your best bet; there's definitely no way through SSH. Synotic probably knows the AS commands for it.</STRONG>
Well, technically there is a way to control it through ssh--executing an AppleScript via the osascript command.
I abused my signature until she cried.
     
Wevah
Senior User
Join Date: Nov 2001
Location: State of Denial
Status: Offline
Reply With Quote
Dec 14, 2001, 11:44 PM
 
I just wanted to post that the "player state" application property of iTunes—at least on my machine—is somewhat buggy: unless I'm running a script from inside Script Editor, "player state as string" returns "«constant ****kPSP»" instead of "playing" (which is what it should return), for example. Also, it seems to use "stopped" for both stopped and paused when in Script Editor...I filed a bug report about it as well.

Not a big deal, but somthing to know.

:]

EDIT: I did some messing about and discovered the "«constant ****XXXX»" thing is not iTunes specific...it seems to happen for anything that returns a member of a predefined list, when called from anywhere outside Script Editor...

[ 12-15-2001: Message edited by: Wevah ]
[Wevah setPostCount:[Wevah postCount] + 1];
     
Mactoid
Grizzled Veteran
Join Date: Sep 2000
Location: Springfield, MA
Status: Offline
Reply With Quote
Dec 15, 2001, 02:58 AM
 
You should try asking one of the developers of those iTunes control programs to add an option to control a remote iTunes process.

Shouldn't be too hard since I imagine that those programs are already using applescript.
We hope your rules and wisdom choke you / Now we are one in everlasting peace
-- Radiohead, Exit Music (for a film)
     
Jelle Monkmater  (op)
Dedicated MacNNer
Join Date: Apr 2001
Location: World capital of drugs and prostitution. Hmmm... SEXTC...
Status: Offline
Reply With Quote
Dec 15, 2001, 06:37 AM
 
Originally posted by juanvaldes:
[QB}You can also do what Cheerios and I do and that is put all of your music in your shared folder, mount that on your other comp, then just add all of the songs to your local copy of iTunes. Then control everything right from there.[/QB]
Well, I could, but my G4 is hooked up to a stereo, while my iBook has got speakers that are smaller than the top of my index finger (I'm 6'7" before you start to wonder). Anyway, I'd prefer to hear music over the stereo.

Anyway, I've been toying around with AppleScript for a bit, and I think I should probably post a new question on the Developer's forum.

Thanks for all assistance.
The one you love and the one who loves you are never the same person.
     
megus
Junior Member
Join Date: Dec 2001
Location: Sweden
Status: Offline
Reply With Quote
Dec 15, 2001, 09:34 AM
 
Couldn't you just install a VNC server on your G4 and a VNC client on your iBook (this is how I solved it). Also, VNC gives you access to the hole computer. Not just iTunes.

---
megus
     
Jelle Monkmater  (op)
Dedicated MacNNer
Join Date: Apr 2001
Location: World capital of drugs and prostitution. Hmmm... SEXTC...
Status: Offline
Reply With Quote
Dec 15, 2001, 09:59 AM
 
Originally posted by megus:
<STRONG>Couldn't you just install a VNC server on your G4 and a VNC client on your iBook (this is how I solved it). Also, VNC gives you access to the hole computer. Not just iTunes.

---
megus</STRONG>
Hmmm. What VNC client would you suggest for this?
The one you love and the one who loves you are never the same person.
     
megus
Junior Member
Join Date: Dec 2001
Location: Sweden
Status: Offline
Reply With Quote
Dec 15, 2001, 10:25 AM
 
I use OSXvnc 0.6 as the server (I think this is the only one available) and VNCDimension 0.7.9 as the client (there are a couple of clients available but this one as worked best for me).
If you do a search for 'vnc' at VersionTracker you will find them.

---
megus
     
Jelle Monkmater  (op)
Dedicated MacNNer
Join Date: Apr 2001
Location: World capital of drugs and prostitution. Hmmm... SEXTC...
Status: Offline
Reply With Quote
Dec 15, 2001, 04:27 PM
 
Originally posted by megus:
<STRONG>I use OSXvnc 0.6 as the server (I think this is the only one available) and VNCDimension 0.7.9 as the client (there are a couple of clients available but this one as worked best for me).
If you do a search for 'vnc' at VersionTracker you will find them.

---
megus</STRONG>
This is pretty good stuff, it's just a shame the VNC server can't run on command line level so it doesn't show up on the Dock. But apart from that, it's really what I needed -- now I can control either computer from the other one.

Thanks.
The one you love and the one who loves you are never the same person.
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 04:44 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,