OSX Mavericks
Re: OSX Mavericks
Thanks. I'm still not understanding why the Python script won't recognize the path to my library...
Thanks!
Scott
Scott
-
- Posts: 1293
- Joined: Sun Apr 20, 2008 9:57 am
- Location: Pittsburgh, PA
- Contact:
Re: OSX Mavericks
Do this:
Replace the fifth line with this:
set kJamsPath to "/Users/yourusername/Music/kJams/kJams Library/"
Subbing in your username.
Cut and paste it over the current line, then run.
Replace the fifth line with this:
set kJamsPath to "/Users/yourusername/Music/kJams/kJams Library/"
Subbing in your username.
Cut and paste it over the current line, then run.
Last edited by DeusExMachina on Thu Oct 31, 2013 9:04 am, edited 1 time in total.
Re: OSX Mavericks
Thanks but my library is on an external "/Volumes/DJ Drive/kJams/kJams Library/"DeusExMachina wrote:Do this:
Replace the fifth line with this:
set kJamsPath to "/Users/yourusername/Music/kJams/kJams Library/"
Subbing in your username.
Cut and paste it over the current line, then run.
Thanks!
Scott
Scott
-
- Posts: 1293
- Joined: Sun Apr 20, 2008 9:57 am
- Location: Pittsburgh, PA
- Contact:
Re: OSX Mavericks
There are many errors in the python script. I do NOT know python, but I am attempting to fix it anyway. BBS.
-
- Posts: 1293
- Joined: Sun Apr 20, 2008 9:57 am
- Location: Pittsburgh, PA
- Contact:
Re: OSX Mavericks
If you replace the line in MY applescript with the line above, and then edit it to correspond to your machine, i.e.:
set kJamsPath to "/Volumes/DJ Drive/kJams/kJams Library/"
the AppleScript will work. The Python script will not. The code was just copied into a boilerplate, but it would appear Dave forgot to edit out AppleScript specific syntax for python code. So, for instance, the line you get hung up on:
set kJamsPath to "/Users/yourUserName/Music/kJams/kJams Library/"
should be:
kJamsPath = "/Users/yourUserName/Music/kJams/kJams Library/"
in python.
Likewise, repeat loops should be while loops. Etc..
I have done a partial edit, and it partially works. But I do not know enough about python yet to do the entire thing. Dave can probably hammer it out in a few minutes!
set kJamsPath to "/Volumes/DJ Drive/kJams/kJams Library/"
the AppleScript will work. The Python script will not. The code was just copied into a boilerplate, but it would appear Dave forgot to edit out AppleScript specific syntax for python code. So, for instance, the line you get hung up on:
set kJamsPath to "/Users/yourUserName/Music/kJams/kJams Library/"
should be:
kJamsPath = "/Users/yourUserName/Music/kJams/kJams Library/"
in python.
Likewise, repeat loops should be while loops. Etc..
I have done a partial edit, and it partially works. But I do not know enough about python yet to do the entire thing. Dave can probably hammer it out in a few minutes!
Re: OSX Mavericks
Your work is much appreciated, but I cannot get your script to work either...just a straight copy from the site and then changing the path produces "The action 'Run AppleScript' encountered an error.DeusExMachina wrote:If you replace the line in MY applescript with the line above, and then edit it to correspond to your machine, i.e.:
set kJamsPath to "/Volumes/DJ Drive/kJams/kJams Library/"
the AppleScript will work. The Python script will not. The code was just copied into a boilerplate, but it would appear Dave forgot to edit out AppleScript specific syntax for python code. So, for instance, the line you get hung up on:
set kJamsPath to "/Users/yourUserName/Music/kJams/kJams Library/"
should be:
kJamsPath = "/Users/yourUserName/Music/kJams/kJams Library/"
in python.
Likewise, repeat loops should be while loops. Etc..
I have done a partial edit, and it partially works. But I do not know enough about python yet to do the entire thing. Dave can probably hammer it out in a few minutes!
Thanks!
Scott
Scott
Re: OSX Mavericks
Expected end of line but found identifier:
kScriptCommand_GET_SHOW_ROTATION_TIME_REMAIN
kScriptCommand_GET_SHOW_ROTATION_TIME_REMAIN
Thanks!
Scott
Scott
-
- Posts: 1293
- Joined: Sun Apr 20, 2008 9:57 am
- Location: Pittsburgh, PA
- Contact:
Re: OSX Mavericks
I'll need a bit more info. Open up the script in AppleScript Editor, run it, and tell me what line it bails out on.
Or for now, just paste in the code. Seems there is a copy problem.
Or for now, just paste in the code. Seems there is a copy problem.
Re: OSX Mavericks
This is what's working on my backup machine:
Code: Select all
on run {input, parameters}
set kJamsPath to "/Volumes/DJ Drive/kJams/kJams Library/"
set kJamsLibraryPath to kJamsPath & "Library.xml"
set XMLfile to (POSIX file (kJamsLibraryPath))
set Paras to paragraphs of (read XMLfile)
-- we cycle through the list and extract the portion between the tag we're interested in
-- we know that the tag we want is immediately after "<key>Current Value</key>"
set tagValue to {}
repeat with i from 1 to count of Paras
if item i of Paras contains "Current Venue" then -- first we find the tag we're interested in
set tagValue to item (i + 1) of Paras
exit repeat
end if
end repeat
-- return tagValue
-- next we extract each value from the found tags knowing that the value is between "<string>" and "</string>
repeat with i from 1 to count of tagValue
set thisTag to item i of tagValue
set thisTagValue to ""
if thisTag is ">" then
repeat with k from (i + 1) to count of tagValue
set thisTag to item k of tagValue
if thisTag is "<" then exit repeat
set thisTagValue to thisTagValue & thisTag
end repeat
exit repeat
end if
end repeat
thisTagValue
set kJamsPath to kJamsPath & "Venues/"
set venuePath to (POSIX file (kJamsPath))
set singerPath to (POSIX file (kJamsPath & thisTagValue & "/Singers"))
set Singers to (choose folder default location alias venuePath with prompt "Choose singers to copy to the current venue" with multiple selections allowed) as list
repeat with i from 1 to count of Singers
tell application "Finder"
set Singer to item i of Singers
make new alias file at singerPath to Singer
end tell
end repeat
set kScriptCommand_RESCAN_VENUE to 19
tell application "kJams 2"
docommand kScriptCommand_RESCAN_VENUE
end tell
return input
end run
Thanks!
Scott
Scott
-
- Posts: 1293
- Joined: Sun Apr 20, 2008 9:57 am
- Location: Pittsburgh, PA
- Contact:
Re: OSX Mavericks
Are you using that in Automator, or just as a script? Either way, use this version:
Code: Select all
set kJamsPath to "/Volumes/DJ Drive/kJams/kJams Library/"
set kJamsLibraryPath to kJamsPath & "Library.xml"
set XMLfile to (POSIX file (kJamsLibraryPath))
set Paras to paragraphs of (read XMLfile)
-- we cycle through the list and extract the portion between the tag we're interested in
-- we know that the tag we want is immediately after "<key>Current Venue</key>"
set tagValue to {}
repeat with i from 1 to count of Paras
if item i of Paras contains "Current Venue" then -- first we find the tag we're interested in
set tagValue to item (i + 1) of Paras
exit repeat
end if
end repeat
-- next we extract each value from the found tags knowing that the value is between "<string>" and "</string>
repeat with i from 1 to count of tagValue
set thisTag to item i of tagValue
set venueName to ""
if thisTag is ">" then
repeat with k from (i + 1) to count of tagValue
set thisTag to item k of tagValue
if thisTag is "<" then exit repeat
set venueName to venueName & thisTag
end repeat
exit repeat
end if
end repeat
set kJamsPath to kJamsPath & "Venues/"
set venuePath to (POSIX file (kJamsPath))
set singerPath to (POSIX file (kJamsPath & venueName & "/Singers"))
set Singers to (choose folder default location alias venuePath with prompt "Choose singers to copy to the current venue" with multiple selections allowed) as list
tell application "Finder"
make new alias file at singerPath to Singers
end tell
set kCurSongTime_REMAINING to 2
set kScriptCommand_RESCAN_VENUE to 19
set kScriptCommand_SHOW_ROTATION to 20
set kScriptCommand_HIDE_SHOWSCREEN to 21
set kScriptCommand_IS_SHOWSCREEN_SHOWING to 22
set kScriptCommand_GET_SHOW_ROTATION_TIME_REMAIN to 23
tell application "kJams 2"
set rotationCueTime to docommand kScriptCommand_GET_SHOW_ROTATION_TIME_REMAIN
set timeRemaining to get time kCurSongTime_REMAINING
set showScreenIsShowing to docommand kScriptCommand_IS_SHOWSCREEN_SHOWING
if showScreenIsShowing = 0 then
if rotationCueTime is equal to timeRemaining then docommand kScriptCommand_SHOW_ROTATION
end if
docommand kScriptCommand_RESCAN_VENUE
end tell
-
- Posts: 1293
- Joined: Sun Apr 20, 2008 9:57 am
- Location: Pittsburgh, PA
- Contact:
Re: OSX Mavericks
Okay, so here's the OFFICIAL word:
That copy singers python script was NOT supposed to have been in there! It was abandoned after the decision was made to fold the functionality into kJams itself. So for now, we're stuck with the Apple Script (which is fine, since I have gotten that working on Mavericks, anyway).
That copy singers python script was NOT supposed to have been in there! It was abandoned after the decision was made to fold the functionality into kJams itself. So for now, we're stuck with the Apple Script (which is fine, since I have gotten that working on Mavericks, anyway).
-
- Posts: 1293
- Joined: Sun Apr 20, 2008 9:57 am
- Location: Pittsburgh, PA
- Contact:
Re: OSX Mavericks
No problem. And this version is a little smarter, in that it eliminates a few lines of code AND smartly puts up the Rotation screen if you happen to run it at the appropriate time.
Re: OSX Mavericks
Now a serious question. Should I only run that script BETWEEN singers?
Thanks!
Scott
Scott
-
- Posts: 1293
- Joined: Sun Apr 20, 2008 9:57 am
- Location: Pittsburgh, PA
- Contact:
Re: OSX Mavericks
Actually, that is the worst time, IMO. Since the switch over can take a good while with a large venue, and since you lose all control over the app during the switch, I try to do it RIGHT after I start a track. Then I have the duration of the playback for it to do the work, hopefully regaining control before the track finishes.
For you, though, this might not matter, if you only have a few score singers. For me, with thousands of singers saved over like five years, it can take upward of five minutes! Also, since I use server almost exclusively, and since the server goes down during the switch, while I am copying users, I can not take song submissions, so I also have to time it so that no one is on my computers or on their phones while I do the copy.
For you, though, this might not matter, if you only have a few score singers. For me, with thousands of singers saved over like five years, it can take upward of five minutes! Also, since I use server almost exclusively, and since the server goes down during the switch, while I am copying users, I can not take song submissions, so I also have to time it so that no one is on my computers or on their phones while I do the copy.