text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
set eventClickDown to current application's CGEventCreateMouseEvent(eventSource, CGEventType_rightMouseUp, tPoint, NULL)
|
tray-click.scpt
|
end mouseRightClick
|
tray-click.scpt
|
set trackers to {}
|
Get%20Lyrics.scpt
|
set trackers to (get selection)
|
Get%20Lyrics.scpt
|
else if view of front window is not library playlist 1 and special kind of view of front window is «constant eSpKkSpN» then -- iTunes 4.9 or better uses "special kind"
|
Get%20Lyrics.scpt
|
set trackers to every file track of view of front window
|
Get%20Lyrics.scpt
|
if trackers is not {} then
|
Get%20Lyrics.scpt
|
repeat with i from 1 to number of items in trackers
|
Get%20Lyrics.scpt
|
set theTrack to item i of trackers
|
Get%20Lyrics.scpt
|
fetchLyrics(theTrack, false)
|
Get%20Lyrics.scpt
|
tell application "iTunes" to display dialog "No tracks selected..." buttons {"OK"} default button 1 with icon 2 giving up after 15
|
Get%20Lyrics.scpt
|
on fetchLyrics(theTrack, overwrite)
|
Get%20Lyrics.scpt
|
set origlyr to lyrics
|
Get%20Lyrics.scpt
|
set art to my replace_chars(artist, "'", "'\\''")
|
Get%20Lyrics.scpt
|
set artist2 to artist
|
Get%20Lyrics.scpt
|
set nom to my replace_chars(name, "'", "'\\''")
|
Get%20Lyrics.scpt
|
set name2 to name
|
Get%20Lyrics.scpt
|
if (origlyr is not "") and (overwrite is false) then
|
Get%20Lyrics.scpt
|
display dialog "Lyrics already set on song \"" & name & "\" by \"" & artist & "\".. Skipping!!" default button 1 with icon 2 giving up after 1
|
Get%20Lyrics.scpt
|
set fetchedLyrics to do shell script ¬
|
Get%20Lyrics.scpt
|
"perl -e 'use LWP::UserAgent; my $ua = LWP::UserAgent->new(env_proxy => 1, keep_alive => 1, timeout => 30,); $ua->agent(\"\"); my ($artist,$title) = (\"" & art & "\",\"" & nom & "\"); my $searchUrl = \"http://www.google.com/search?hl=en&btnI=1&q=site:sing365.com \"; my $searchString = \"$artist \\\"$title Lyrics\\\" \\\"Print\\\"\"; my $lyricPage = $ua->get($searchUrl.$searchString); print \"Error while getting \", $lyricPage->request->uri, \" -- \", $lyricPage->status_line, \"Aborting\" unless $lyricPage->is_success(); my $lyrics = ($lyricPage->content =~ /color=red>Send.+script><BR>.(.+)<hr size=1 color=#cccccc>If you find some error/si)[0]; $lyrics =~ s/<(([^ >]|)*)>//g; $lyrics =~ s/\\"/\"/g; $lyrics =~ s/\\&/&/g; $lyrics =~ s/\\'/'\\''/g; $lyrics =~ s/\\n+$//; print $lyrics;'"
|
Get%20Lyrics.scpt
|
if (fetchedLyrics is not "") then
|
Get%20Lyrics.scpt
|
set lyrics to fetchedLyrics
|
Get%20Lyrics.scpt
|
display dialog "No lyrics found for song \"" & name2 & "\" by \"" & artist2 & "\"!" default button 1 with icon 2 giving up after 2
|
Get%20Lyrics.scpt
|
end fetchLyrics
|
Get%20Lyrics.scpt
|
set stop target when done of theFade to 1
|
Create fade-and-stops for selected.applescript
|
tell document 1 of application "Safari" to return (do JavaScript jsCode)
|
Export Results.applescript
|
runJavaScript("document.getElementsByName('BP113.DUMMY_B.MENSYS')[0].click();")
|
Export Results.applescript
|
runJavaScript("document.getElementsByName('BP102.DUMMY_B.MENSYS')[0].click();")
|
Export Results.applescript
|
runJavaScript("document.getElementsByName('BP101.DUMMY_B.MENSYS')[0].click();")
|
Export Results.applescript
|
set theText to argv as string
|
omnifocus-inbox.txt
|
parse tasks into default document with transport text theText
|
omnifocus-inbox.txt
|
set theFilePath to ((path to home folder) as string) & "Documents:Apps:Xcode:Playground iOS.playground"
|
Open iOS Playground.applescript
|
set hasOne to false
|
Status_minders.applescript
|
repeat with i from 1 to (count of (reminders whose completed is false))
|
Status_minders.applescript
|
set theReminder to reminder i of (reminders whose completed is false)
|
Status_minders.applescript
|
set reminderName to name of theReminder
|
Status_minders.applescript
|
set theList to name of container of theReminder
|
Status_minders.applescript
|
if due date of theReminder exists then
|
Status_minders.applescript
|
set dueDate to due date of theReminder
|
Status_minders.applescript
|
set timeStr to time string of dueDate
|
Status_minders.applescript
|
set dateStr to date string of dueDate
|
Status_minders.applescript
|
set dayInt to text -2 thru -1 of ("00" & day of dueDate)
|
Status_minders.applescript
|
set monthInt to text -2 thru -1 of ("00" & ((month of dueDate) as integer))
|
Status_minders.applescript
|
set yearInt to year of dueDate
|
Status_minders.applescript
|
set output to output & yearInt & monthInt & dayInt & tab & theList & tab & reminderName & linefeed
|
Status_minders.applescript
|
set sortedValues to do shell script "echo " & quoted form of output & " | sort -n -k1"
|
Status_minders.applescript
|
set theData to paragraphs of sortedValues
|
Status_minders.applescript
|
set theBigList to {}
|
Status_minders.applescript
|
repeat with i from 1 to count of theData
|
Status_minders.applescript
|
set theLine to text items of item i of theData
|
Status_minders.applescript
|
copy theLine to the end of theBigList
|
Status_minders.applescript
|
if hasOne is false then
|
Status_minders.applescript
|
set theDate to ""
|
Status_minders.applescript
|
set theTask to ""
|
Status_minders.applescript
|
set theCon to ""
|
Status_minders.applescript
|
set hasOne to true
|
Status_minders.applescript
|
set htmlOutput to ""
|
Status_minders.applescript
|
repeat with i from 2 to count of theBigList
|
Status_minders.applescript
|
set theD to text 7 thru 8 of item 1 of item i of theBigList
|
Status_minders.applescript
|
set theM to text 5 thru 6 of item 1 of item i of theBigList
|
Status_minders.applescript
|
set theTask to item 3 of item i of theBigList
|
Status_minders.applescript
|
set theCon to item 2 of item i of theBigList
|
Status_minders.applescript
|
set htmlOutput to htmlOutput & "<tr>" & return & "<td class=\"projectIcon\"><img src=\"http://www.clker.com/cliparts/T/c/V/a/h/H/checkbox-checked-gray-md.png\" /></td>" & return & "<td class=\"Last Modified\" style=\"width: 153px\">" & theM & "-" & theD & "</td>" & return & "<td class=\"projectName\" style=\"width: 228px\">" & theCon & "</td>" & return & "<td class=\"projectTask\" style=\"width: 480px\">" & theTask & "</td>" & "</tr>" & return
|
Status_minders.applescript
|
set preamble to "<table id=\"projects\">" & return & "<table style= font-size:0.8em>"
|
Status_minders.applescript
|
set outro to "</table>"
|
Status_minders.applescript
|
do shell script "echo " & quoted form of preamble & quoted form of htmlOutput & quoted form of outro & " > /Users/Uermane/Dropbox/StatusBoard/StatusMinders" & ".html"
|
Status_minders.applescript
|
tell application "Microsoft Word" to activate
|
Word to Applescript.applescript
|
tell application "Microsoft Word" to set theOldDefaultPath to get default file path file path type documents path -- looks like we change the default path to where the document is and then set it back when we're done
|
Word to Applescript.applescript
|
set theFilePath to container of theFile as text
|
Word to Applescript.applescript
|
set ext to name extension of theFile
|
Word to Applescript.applescript
|
set theName to name of theFile
|
Word to Applescript.applescript
|
on open {dropped_item}
|
copyPathDropped.applescript
|
tell application "Finder" to set the clipboard to the ¬
|
copyPathDropped.applescript
|
dropped_item as text
|
copyPathDropped.applescript
|
set testPass to text returned of (display dialog "Enter a test password:" default answer "" with hidden answer)
|
character_test.applescript
|
do shell script "/bin/echo '" & testPass & "' > /var/tmp/pass_file"
|
character_test.applescript
|
set echoedPass to (do shell script "/bin/cat /var/tmp/pass_file")
|
character_test.applescript
|
display dialog "This is what you typed:
|
character_test.applescript
|
" & testPass & "
|
character_test.applescript
|
This is what AppleScript echoed to a temp file:
|
character_test.applescript
|
" & echoedPass
|
character_test.applescript
|
set clipPath to "~/Dropbox/Library/Application\\ Support/Script\\ Debugger\\ 7/Clippings/Comments/handler\\ description.txt"
|
insert-dynamic-handler-description.applescript
|
do shell script "touch " & clipPath
|
insert-dynamic-handler-description.applescript
|
set ps to count of paragraphs of sourceText
|
insert-dynamic-handler-description.applescript
|
set currentLine to 1
|
insert-dynamic-handler-description.applescript
|
set currentHandler to missing value
|
insert-dynamic-handler-description.applescript
|
set lineCount to 0
|
insert-dynamic-handler-description.applescript
|
set charCount to 0
|
insert-dynamic-handler-description.applescript
|
repeat with x from 1 to count of paragraphs of sourceText
|
insert-dynamic-handler-description.applescript
|
considering white space
|
insert-dynamic-handler-description.applescript
|
set charCount to charCount + (count of characters of paragraph x of sourceText) + 1
|
insert-dynamic-handler-description.applescript
|
if charCount < theLocation then
|
insert-dynamic-handler-description.applescript
|
if paragraph x of sourceText begins with "on " then
|
insert-dynamic-handler-description.applescript
|
set currentHandler to paragraph x of sourceText as text
|
insert-dynamic-handler-description.applescript
|
set insertion to charCount - (count of characters of paragraph x of sourceText)
|
insert-dynamic-handler-description.applescript
|
set newSelection to {insertion, count of characters of paragraph x of sourceText}
|
insert-dynamic-handler-description.applescript
|
set selection to {insertion, 0}
|
insert-dynamic-handler-description.applescript
|
if currentHandler is missing value then set currentHandler to "run"
|
insert-dynamic-handler-description.applescript
|
set AppleScript's text item delimiters to "on "
|
insert-dynamic-handler-description.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.