text
stringlengths
0
15.7k
source
stringlengths
6
112
set processName to getProcessName(appPath)
appctrl.applescript
tell process processName
appctrl.applescript
end dostop
appctrl.applescript
set helpStr to "Usage: appctrl.applescript[(start|stop)]
appctrl.applescript
params not supported yet, only for pcap replay
appctrl.applescript
set action to "none"
appctrl.applescript
if length of argv is not less than 1 then
appctrl.applescript
return helpStr
appctrl.applescript
set appPath to getappPath()
appctrl.applescript
if action is equal to "start" then
appctrl.applescript
dostart(appPath)
appctrl.applescript
else if action is equal to "stop" then
appctrl.applescript
dostop(appPath)
appctrl.applescript
fmGUI_CustomFunctions_FunctionNames({})
fmGUI_CustomFunctions_FunctionNames.applescript
on fmGUI_CustomFunctions_FunctionNames(prefs)
fmGUI_CustomFunctions_FunctionNames.applescript
value of static text 1 of every row of table 1 of scroll area 1 of window 1
fmGUI_CustomFunctions_FunctionNames.applescript
error "Couldn't get names of custom functions - " & errMsg number errNum
fmGUI_CustomFunctions_FunctionNames.applescript
end fmGUI_CustomFunctions_FunctionNames
fmGUI_CustomFunctions_FunctionNames.applescript
set dialog_reply to display dialog "5472 ÷ 57 =" buttons {"56", "76", "96"} giving up after 7
Script 16-3.applescript
if (gave up of dialog_reply) then
Script 16-3.applescript
set the_response to "Not fast enough!"
Script 16-3.applescript
else if (button returned of dialog_reply is "96") then
Script 16-3.applescript
set the_response to "You got it!"
Script 16-3.applescript
set the_response to "Wrong answer!"
Script 16-3.applescript
display dialog the_response
Script 16-3.applescript
on run {app_name}
is_app_on_dock.applescript
tell list 1
is_app_on_dock.applescript
set dockItemTest to UI element app_name -- test if the application is in the Dock
is_app_on_dock.applescript
find "\\s[^\\s]" searching in (text 1 of window 1) options {search mode:grep, starting at top:false, wrap around:false, backwards:true, case sensitive:false, match words:false, extend selection:false}
Previous Word.applescript
tell application "Finder" of qlabMain to open ("Applications/SomeApp.app" as POSIX file as alias)
Remote App Launch.applescript
tell application "Finder" of qlabBackup to open ("Applications/SomeApp.app" as POSIX file as alias)
Remote App Launch.applescript
set text of front document to "The quick fox jumped over the lazy dog."
textedit_find_replace.applescript
set every word of front document where it = "fox" to "elephant"
textedit_find_replace.applescript
set text of front document to replace_chars(text of front document, "quick fox", "slow elephant") of me
textedit_find_replace.applescript
open "syllabus.pdf" -- edit for your filename
Find day MWF.applescript
if theWeekday = "Tuesday" then
Find day MWF.applescript
else if theWeekday = "Thursday" then
Find day MWF.applescript
property loop_min : 1 --useful to import only a few documents
Import%20Poacket.scpt
property loop_max : 10000 -- to DT, e.g. for testing or after errors
Import%20Poacket.scpt
property where_condition : "" --set to "" or something like " WHERE unique_id='13148'" or " WHERE unique_id>'13148'"; make sure loop_min is small enough
Import%20Poacket.scpt
property scriptlastchanged : "05.01.2015 10:00"
Import%20Poacket.scpt
property user_agent : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/600.2.5 (KHTML, like Gecko) Version/8.0.2 Safari/600.2.5"
Import%20Poacket.scpt
property sqlite_path : "sqlite3" --"/Applications/Sente65.app/Contents/MacOS/sqlite3"
Import%20Poacket.scpt
property strEOR : "<EOR>" & return
Import%20Poacket.scpt
property strRecDelim : quote & strEOR & quote
Import%20Poacket.scpt
property sFieldDelim : ";; "
Import%20Poacket.scpt
property db_path_p : POSIX path of (path to home folder) & "Library/Containers/com.readitlater.PocketMac/Data/Library/Application Support/Pocket/readItLater3.sqlite"
Import%20Poacket.scpt
property quoted_db_path_p : quoted form of db_path_p
Import%20Poacket.scpt
property offline_path : POSIX path of (path to home folder) & "Library/Containers/com.readitlater.PocketMac/Data/Library/Application Support/Pocket/offline/cache0/RIL_pages/"
Import%20Poacket.scpt
property tempfolder_path : POSIX path of (path to home folder) & "Desktop/import_pocket/"
Import%20Poacket.scpt
property timestamp : time of (current date) --for logfile
Import%20Poacket.scpt
property insta_url_prefix : "http://www.instapaper.com/text?u=http%3A%2F%2F"
Import%20Poacket.scpt
property insta_urls_prefix : "http://www.instapaper.com/text?u=https%3A%2F%2F"
Import%20Poacket.scpt
property pocket_url_prefix : "http://getpocket.com/a/read/"
Import%20Poacket.scpt
if where_condition is "" then
Import%20Poacket.scpt
set the_articles_text to get_articles("")
Import%20Poacket.scpt
set the_articles_text to get_articles(where_condition)
Import%20Poacket.scpt
set the_articles_text to replaceString(the_articles_text, {" "}, "\\n") -- avoids
Import%20Poacket.scpt
set the_articles to textToTwoDArray(the_articles_text, character id 13, ";; ")
Import%20Poacket.scpt
writelog("Pocket2Devonthink
Import%20Poacket.scpt
Script last changed: " & scriptlastchanged & "
Import%20Poacket.scpt
" & (current date) & "
Import%20Poacket.scpt
Pocket articles to create in Devonthink: " & loop_min & " - " & loop_max & "
Import%20Poacket.scpt
Condition: " & where_condition, timestamp)
Import%20Poacket.scpt
set loop_count to 0
Import%20Poacket.scpt
set error_count to 0 -- number is written into log file
Import%20Poacket.scpt
repeat with this_article in the_articles
Import%20Poacket.scpt
set itemlog to "" -- this var gets written to the logfile at the end of each repeat when errors_raised
Import%20Poacket.scpt
set errors_raised to false --current item gets into the logfile only when an error occured
Import%20Poacket.scpt
log "
Import%20Poacket.scpt
if (loop_count ≥ loop_min) and (loop_count ≤ loop_max) then
Import%20Poacket.scpt
set itemlog to "
Import%20Poacket.scpt
set itemlog to itemlog & "Raw data on this article according to pocket database: "
Import%20Poacket.scpt
set text item delimiters to ";; "
Import%20Poacket.scpt
set itemlog to itemlog & this_article
Import%20Poacket.scpt
set uid to item 1 of this_article
Import%20Poacket.scpt
set item_id to item 2 of this_article
Import%20Poacket.scpt
set url_orig to item 3 of this_article
Import%20Poacket.scpt
set title to item 4 of this_article
Import%20Poacket.scpt
set time_added_pocket to item 5 of this_article
Import%20Poacket.scpt
set time_added to timestamp2appledate(time_added_pocket) -- to date rli_date
Import%20Poacket.scpt
set word_count to item 6 of this_article
Import%20Poacket.scpt
set mime to item 7 of this_article
Import%20Poacket.scpt
set offline_text to item 8 of this_article
Import%20Poacket.scpt
set offline_web to item 9 of this_article
Import%20Poacket.scpt
set itemlog to itemlog & "
Import%20Poacket.scpt
loop_count: " & loop_count & ";;
Import%20Poacket.scpt
uid: " & uid & ";;
Import%20Poacket.scpt
item_id: " & item_id & ";;
Import%20Poacket.scpt
url_orig: " & url_orig & ";;
Import%20Poacket.scpt
title: " & title & ";;
Import%20Poacket.scpt
time_added: " & (time_added as string) & ";;
Import%20Poacket.scpt
word_count: " & word_count & ";;
Import%20Poacket.scpt
mime: " & mime & ";;
Import%20Poacket.scpt
offline_text: " & offline_text & ";;
Import%20Poacket.scpt
offline_web: " & offline_web
Import%20Poacket.scpt
log itemlog
Import%20Poacket.scpt
on error errormsg
Import%20Poacket.scpt
" & errormsg
Import%20Poacket.scpt
set errors_raised to true
Import%20Poacket.scpt