text
stringlengths
0
15.7k
source
stringlengths
6
112
set pFolder to POSIX path of fullpath
NASA-ADS.applescript
if exists fullpath as POSIX file then
NASA-ADS.applescript
display dialog "A PDF file for " & (adscode) & "
NASA-ADS.applescript
EXISTS. Dont Download!!!!!!
NASA-ADS.applescript
Would you Like to Open it" with icon file "Users:vigeesh:Library:MyIcons:stop.icns" buttons {"Cancel", "Open"} default button 2
NASA-ADS.applescript
if result = {button returned:"Open"} then
NASA-ADS.applescript
open fullpath
NASA-ADS.applescript
Does NOT Exist.
NASA-ADS.applescript
Happy Downloading.....
NASA-ADS.applescript
(Bibcode available in clipboard)" with icon file "Users:vigeesh:Library:MyIcons:Download.icns" buttons {"OK"} default button 1
NASA-ADS.applescript
set the clipboard to adscode
NASA-ADS.applescript
log formatBits(82)
formatBits.applescript
log formatBits(142343)
formatBits.applescript
log formatBits(123424945)
formatBits.applescript
on formatBits(n)
formatBits.applescript
set n2 to n div 8
formatBits.applescript
set n to n / 8
formatBits.applescript
if n2 < 1000 then
formatBits.applescript
return (n2 as text) & " bit"
formatBits.applescript
else if n2 < 1000000 then
formatBits.applescript
set n to n div 1000
formatBits.applescript
set s to "Kbit"
formatBits.applescript
set n to n div 1000000
formatBits.applescript
set s to "Mbit"
formatBits.applescript
return (n as text) & " " & s
formatBits.applescript
on remove_range(the_list, from_index, to_index)
ListModifier.applescript
set first_part to (items 1 thru (from_index) of the_list)
ListModifier.applescript
set second_part to (items to_index thru (length of the_list) of the_list)
ListModifier.applescript
return first_part & second_part
ListModifier.applescript
end remove_range
ListModifier.applescript
on remove_at(the_list, the_index)
ListModifier.applescript
if the_index = 1 then
ListModifier.applescript
else if the_index = length of the_list then
ListModifier.applescript
set new_list to (items 1 thru (the_index - 1) of the_list) & (items (the_index + 1) thru -1 of the_list)
ListModifier.applescript
end remove_at
ListModifier.applescript
on add_item(the_list, the_item)
ListModifier.applescript
set the_list to the_list & the_item
ListModifier.applescript
return the_list
ListModifier.applescript
end add_item
ListModifier.applescript
on add_list(a, b)
ListModifier.applescript
set a to a & null --append null to the end of the list so that there is something to replace in the next step
ListModifier.applescript
set last item in a to b
ListModifier.applescript
end add_list
ListModifier.applescript
on add_at(the_list, the_item, the_index)
ListModifier.applescript
set beginning of the_list to the_item
ListModifier.applescript
else if v = (length of the_list) + 1 then
ListModifier.applescript
set end of the_list to the_item
ListModifier.applescript
set the_list to (items 1 thru (the_index - 1) of the_list) & the_item & (items (the_index) thru -1 of the_list)
ListModifier.applescript
end add_at
ListModifier.applescript
* Note: modifies the original array
ListModifier.applescript
* TODO: add support for not setting the item if there is no match
ListModifier.applescript
on replace(the_list, to_match, replacment)
ListModifier.applescript
set match_index to ListParser's index_of(the_list, to_match)
ListModifier.applescript
set item match_index of the_list to replacment
ListModifier.applescript
on replace_many(the_list, the_matches, the_replacments)
ListModifier.applescript
repeat with i from 1 to (length of the_matches)
ListModifier.applescript
set the_list to replace(the_list, (item i of the_matches), (item i of the_replacments))
ListModifier.applescript
end replace_many
ListModifier.applescript
on swap(the_list, a, b)
ListModifier.applescript
set a_index to ListParser's index_of(the_list, a)
ListModifier.applescript
set b_index to ListParser's index_of(the_list, b)
ListModifier.applescript
if a_index is not null and b_index is not null then
ListModifier.applescript
set item b_index of the_list to a
ListModifier.applescript
set item a_index of the_list to b
ListModifier.applescript
on remove(the_list, the_item)
ListModifier.applescript
set match_index to ListParser's index_of(the_list, the_item)
ListModifier.applescript
return remove_at(the_list, match_index)
ListModifier.applescript
on remove_many(the_Array, the_items)
ListModifier.applescript
set the_Array to remove(the_Array, (item i of the_items))
ListModifier.applescript
return the_Array
ListModifier.applescript
end remove_many
ListModifier.applescript
on combine(list_a, list_b, seperator)
ListModifier.applescript
set ret_val to {} --establish the return value
ListModifier.applescript
repeat with i from 1 to (length of list_a)
ListModifier.applescript
set the_item to (item i of list_a) & seperator & (item i of list_b) --create the text item
ListModifier.applescript
set ret_val to ret_val & the_item --concat the text item to the list
ListModifier.applescript
end combine
ListModifier.applescript
on bubble_sort(the_list)
ListModifier.applescript
repeat with i from 1 to (length of the_list) - 1
ListModifier.applescript
end bubble_sort
ListModifier.applescript
copy the_list to the_copy_list -- copy data
ListModifier.applescript
return the_copy_list
ListModifier.applescript
set aFn to (path to desktop as text) & "ittracs.txt"
test-3.applescript
set t_nm to description
test-3.applescript
write "d:" & t_did & "\t" & t_id & "\t" & t_art & "\t" & t_nm to myOut
test-3.applescript
global headerOptions, lineUndefined
00 Retrieve metadata headers.applescript
set headerOptions to {¬ "Description", ¬ "Author", ¬ "Link", ¬ "Version", ¬ "Changelog", ¬ "About", ¬ "Tested MacOS", ¬ "Tested Qlab", ¬ "Separate Process"}
00 Retrieve metadata headers.applescript
on retrieveHeaders(theScript)
00 Retrieve metadata headers.applescript
set theScriptContents to paragraphs of (read theScript)
00 Retrieve metadata headers.applescript
set indentLevel to 0
00 Retrieve metadata headers.applescript
log "--------"
00 Retrieve metadata headers.applescript
repeat with eachLine in theScriptContents
00 Retrieve metadata headers.applescript
repeat with eachOption in headerOptions
00 Retrieve metadata headers.applescript
set eachOptionNoSpace to util's splitString(eachOption, " ")
00 Retrieve metadata headers.applescript
if eachOption is in eachLine then
00 Retrieve metadata headers.applescript
log eachOption & ": " & item 2 of util's splitString(eachLine, eachOption & " ")
00 Retrieve metadata headers.applescript
multilineHeader(theScript, eachOption)
00 Retrieve metadata headers.applescript
else if (eachOptionNoSpace as string) is in eachLine then
00 Retrieve metadata headers.applescript
log eachOption & ": " & item 2 of util's splitString(eachLine, (eachOptionNoSpace as string) & " ")
00 Retrieve metadata headers.applescript
multilineHeader(theScript, eachOptionNoSpace)
00 Retrieve metadata headers.applescript