Applescript to request PokerStars Tournament Summaries

General discussion of PokerTracker 3.

Moderator: Moderators

Re: Applescript to request PokerStars Tournament Summaries

Postby kraada » Thu Dec 31, 2009 6:25 pm

Ok, it just seemed worth checking :)
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Applescript to request PokerStars Tournament Summaries

Postby jalanh » Sat Jan 02, 2010 7:06 pm

Here is an updated version that doesn't need to be run from a terminal window.

Open AppleScript Editor and paste the code in. Then Save As... You can specify it be saved as an app. Then just interact with it like any other app.

When the dialog comes up, enter tournament ids separated by a space

Jeff

Code: Select all
set idText to ""

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

tell application "Finder"
   display dialog "Enter Tournament IDs:" default answer idText
   set idText to text returned of the result
end tell

set oldDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to " "
set idList to every text item of idText
set AppleScript's text item delimiters to oldDelim

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

Re: Applescript to request PokerStars Tournament Summaries

Postby kraada » Sat Jan 02, 2010 7:20 pm

Thanks! I updated your first post so that people who are new to the thread will see the update.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Applescript to request PokerStars Tournament Summaries

Postby paulewlnuts » Sun Jan 03, 2010 1:14 am

are there plans to implement applescript support into pokertracker 3? dictionary, standard suite, etc..
paulewlnuts
 
Posts: 20
Joined: Fri Dec 25, 2009 1:13 am

Re: Applescript to request PokerStars Tournament Summaries

Postby paulewlnuts » Sun Jan 03, 2010 2:50 am

Also, I keep getting this when running the script:
Image
paulewlnuts
 
Posts: 20
Joined: Fri Dec 25, 2009 1:13 am

Re: Applescript to request PokerStars Tournament Summaries

Postby kraada » Sun Jan 03, 2010 10:47 am

paulewlnuts wrote:are there plans to implement applescript support into pokertracker 3? dictionary, standard suite, etc..


It may be possible down the road but I don't think it's likely to come particularly soon.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Applescript to request PokerStars Tournament Summaries

Postby Rodie4 » Mon Jan 04, 2010 1:48 am

jalanh, this is awesome. Thanks.

Applescript, as a default, times out after 2 minutes, so if you are cutting and pasting Tourney IDs into the dialog box, make sure you don't take more than 2 minutes before clicking the OK button.

There is a command to tell it to wait longer (e.g., "with timeout of x seconds..."), but I'm not sure where to put it to extend the time before timing out.

I've been pasting in about 5 Tourney IDs at a time. I almost have 2009 finished.
Rodie4
 
Posts: 6
Joined: Sat Feb 02, 2008 9:40 pm

Re: Applescript to request PokerStars Tournament Summaries

Postby paulewlnuts » Mon Jan 04, 2010 3:20 pm

I'm not sure if this is the exact source of the issue I'm having. Any ideas? Obviously it's something on my system's end as nobody else is having any problems.


1/4/10 2:01:14 PM AppleScript Editor[2350] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find:
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper


1/4/10 2:01:47 PM Finder[1479] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find:
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper
paulewlnuts
 
Posts: 20
Joined: Fri Dec 25, 2009 1:13 am

Re: Applescript to request PokerStars Tournament Summaries

Postby jalanh » Tue Jan 05, 2010 1:03 am

paulewlnuts wrote:I'm not sure if this is the exact source of the issue I'm having. Any ideas? Obviously it's something on my system's end as nobody else is having any problems.


1/4/10 2:01:14 PM AppleScript Editor[2350] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find:
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper


1/4/10 2:01:47 PM Finder[1479] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find:
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper


I'm afraid I can't really help you much. Before I wrote this script I knew nothing about applescript. What OS are you running? I'm on Snow Leopard. Not sure if any of the constructs I've used are OS version specific.

Wish I could help more.

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

Re: Applescript to request PokerStars Tournament Summaries

Postby tarix » Tue Jan 05, 2010 7:10 am

paulewlnuts wrote:1/4/10 2:01:14 PM AppleScript Editor[2350] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find:
/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper


The easy fix is to delete /Library/AcriptingAdditions/Adobe Unit Types.osax A more involved fix would be to reinstall Adobe so that it will hopefully install the correct plugin.
tarix
Developer
 
Posts: 3760
Joined: Tue May 20, 2008 2:49 pm

PreviousNext

Return to General [Read Only]

Who is online

Users browsing this forum: No registered users and 16 guests

cron
highfalutin