Applescript to request PokerStars Tournament Summaries

General discussion of PokerTracker 3.

Moderator: Moderators

Applescript to request PokerStars Tournament Summaries

Postby jalanh » Tue Dec 29, 2009 5:21 pm

[Edit/Kraada: An updated version was posted by jalanh in this post.]

I've created an Applescript that will interact with the (mac) PokerStars application to request a specified tournament summary.

To use the script, save it as a 'scpt' file. Then in the terminal window type..

osascript <path/to/applescript/file>/filename.scpt <tourment_id> ...

There is no limit on the number of tourment ids that can be specified. That being said, the script doesn't know/care if it hits up against PS's limit of requests.

I'd be interested in hearing about any improvements to this script.
Jeff

Code: Select all
on request_tournament_history(tournament_id)
tell application "PokerStars"
      activate
   end tell
   
   tell application "System Events"
      tell process "PokerStars"
         tell menu bar 1
            tell menu bar item "Requests"
               tell menu "Requests"
                  click menu item "Tournament History..."
               end tell
            end tell
         end tell
         tell window "Tournament History"
            click radio button 1
            set focused of text field 0 to true
            set value of text field 0 to (tournament_id as string)
            click button "OK"
         end tell
         repeat while (window "PokerStars" exists) = false
         end repeat
         click button "OK" in window "PokerStars"
      end tell
   end tell
end request_tournament_history

on run argv
   repeat with id in argv
      request_tournament_history(id)
   end repeat
end run
jalanh
 
Posts: 9
Joined: Fri Mar 21, 2008 3:51 pm

Re: Applescript to request PokerStars Tournament Summaries

Postby kraada » Tue Dec 29, 2009 11:36 pm

Thanks! If you don't mind, I'll link others who might be interested in this sort of thing to this thread.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Applescript to request PokerStars Tournament Summaries

Postby paulewlnuts » Wed Dec 30, 2009 12:39 am

I'm a terminal noob....

here's what I'm entering:

osascript <Users/Andy/tourney.scpt>/tourney.scpt <tournament_id> ...

but before it can even execute the script, I'm getting an error that says Users/Andy/tourney.scpt: there is no such file or directory. However, there is a file named tourney.scpt in this location, so I'm a bit confused.
paulewlnuts
 
Posts: 20
Joined: Fri Dec 25, 2009 1:13 am

Re: Applescript to request PokerStars Tournament Summaries

Postby jalanh » Wed Dec 30, 2009 1:27 am

Andy, assuming your script is /Users/Andy/tourney.scpt and you want to request tournament summary for tournament 123456789 you would type

osascript /Users/Andy/tourney.scpt 123456789

Unfortunately the script doesn't currently interact directly with PokerTracker, you have to explicitly give it the tournament id's your requesting.

I'm working on updating the script to interact with PokerTracker to determine the tournaments that need to be requested. Unfortunately it isn't going well as the tables in the dialog aren't cooperating.


Jeff
jalanh
 
Posts: 9
Joined: Fri Mar 21, 2008 3:51 pm

Re: Applescript to request PokerStars Tournament Summaries

Postby paulewlnuts » Wed Dec 30, 2009 2:51 am

Thanks for your help Jeff, I wish I knew some apple script so I could be of some assistance. As you mentioned, the biggest problem I'm having with PT3 is getting all of my sng results imported correctly, and as Pokerstars restricts tournament summary queries to your last 200, it's been a pain to try to find a work around to this problem.
paulewlnuts
 
Posts: 20
Joined: Fri Dec 25, 2009 1:13 am

Re: Applescript to request PokerStars Tournament Summaries

Postby WhiteRider » Wed Dec 30, 2009 5:52 am

If you play 9 or 10 seat single table SNGs you can use the "Auto Fill" option on the Tournaments > Enter Results window - you can select and update multiple tournaments at once. Select the tournaments you want to be updated, set them as "SNG (1 table)" then click Auto Fill.
WhiteRider
Moderator
 
Posts: 54018
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Applescript to request PokerStars Tournament Summaries

Postby Rodie4 » Thu Dec 31, 2009 1:40 am

I was actually playing with Automator and got it to go through all the menu selections and clicking in dialogs, but I still had to paste in the tourney ID number. I couldn't get Automator to correctly copy the tourney ID from the PokerTracker window. It worked great the other day.

I don't know AppleScript, but this looks great. However, I'm getting a "Permission Denied" message in Terminal when I try this script. Not sure why.

Steve
Rodie4
 
Posts: 6
Joined: Sat Feb 02, 2008 9:40 pm

Re: Applescript to request PokerStars Tournament Summaries

Postby Rodie4 » Thu Dec 31, 2009 5:33 pm

Figured it out...works great! Thanks.
Rodie4
 
Posts: 6
Joined: Sat Feb 02, 2008 9:40 pm

Re: Applescript to request PokerStars Tournament Summaries

Postby kraada » Thu Dec 31, 2009 5:46 pm

In case others have the same problem: what ended up getting things working for you?
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Applescript to request PokerStars Tournament Summaries

Postby Rodie4 » Thu Dec 31, 2009 6:12 pm

Stupid stuff, like forgetting to type "osascript" before the path!

If people just follow directions, it'll work. jalanh spelled it out perfectly.
Rodie4
 
Posts: 6
Joined: Sat Feb 02, 2008 9:40 pm

Next

Return to General [Read Only]

Who is online

Users browsing this forum: No registered users and 15 guests

cron