Make your own free website on Tripod.com
Pineapple Studios Home Miscellaneous  
Products Links  
Support News  

AppleScript

Feel free to use these resources.

Macscripter's Applescript BBS

Apple's Applescript Discussion


Here are some scripts you might find useful. I created them for the purpose of your use; you are free to use them as you please.

Get File Path

on open (path_to)
set path_to to path_to as string
set the_button to button returned of (display dialog path_to buttons {"Okay", "Copy"} default button 2)
if the_button is "Copy" then
set the clipboard to path_to
end if
end open
on run
set path_to to (choose file)

set path_to to path_to as string

set the_button to button returned of (display dialog path_to buttons {"Okay", "Copy"} default button 2)
if the_button is "Copy" then
set the clipboard to path_to
end if
end run

 

Card Draw

set suitlist to {"Spades", "Hearts", "Clubs", "Diamonds"}
set cardlist to {"Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"}
repeat
set suit1 to random number from 1 to 4
set card1 to random number from 1 to 13
set suit2 to item suit1 of suitlist as string
set card2 to item card1 of cardlist as string
set thecard to card2 & " of " & suit2
display dialog thecard buttons {"Cancel", "Again"} default button 2
end repeat

 

Open AppleScript App with Script Editor

on open (the_drop)
tell application "Finder"
if file type of (info for the_drop) is "APPL" and file creator of (info for the_drop) is "aplt" then
tell application "Script Editor"
open the_drop
activate
end tell
end if
end tell
end open

 

Internet Beat Time

set gmt_time to (time to GMT)
if gmt_time is less than 0 then
set gmt_time to -gmt_time
end if
set bmt_dif to gmt_time + 3600
--refresh beat time
set here_time to time of (current date)
set bmt_time to here_time + bmt_dif
if bmt_time is greater than or equal to 86400 then
set bmt_time to bmt_time - 86400
end if
set beat_time to (bmt_time div 86.4)
display dialog "Current Internet Time:" & return & (beat_time) & " Beats"

 

Close Access to File

on open (the_file)
try
close access the_file
end try
end open

 


 

  Made on a Mac
Contact the Webmaster