text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
set protocol to getProperty("com_panic_transmit_protocol", transmitFile) | workstation.scpt |
if protocol is equal to "SFTP" then | workstation.scpt |
set nickname to getProperty("com_panic_transmit_nickname", transmitFile) | workstation.scpt |
copy nickname to the end of availableWorkspaces | workstation.scpt |
copy transmitFile to the end of availableWorkspaceFiles | workstation.scpt |
set nickname to {choose from list bubbleSort(availableWorkspaces)} | workstation.scpt |
set selectedWorkspaceIndex to IndexOfItem(nickname, availableWorkspaces) | workstation.scpt |
set selectedWorkspaceFile to item selectedWorkspaceIndex in availableWorkspaceFiles | workstation.scpt |
set server to getProperty("com_panic_transmit_server", selectedWorkspaceFile) | workstation.scpt |
set ssh_port to getProperty("com_panic_transmit_port", selectedWorkspaceFile) | workstation.scpt |
set username to getProperty("com_panic_transmit_username", selectedWorkspaceFile) | workstation.scpt |
set remotePath to getProperty("com_panic_transmit_remotePath", selectedWorkspaceFile) | workstation.scpt |
set myFave to item 1 of (favorites whose name is nickname) | workstation.scpt |
set current tab to (make new tab at end) | workstation.scpt |
if username is not "" and server is not "" then | workstation.scpt |
if ssh_port is not false then | workstation.scpt |
set scriptString to "ssh -p " & ssh_port & " " & username & "@" & server | workstation.scpt |
set scriptString to "ssh " & username & "@" & server | workstation.scpt |
set currentTab to do script scriptString | workstation.scpt |
do shell script "open -a TextMate \"" & (POSIX path of transmitCachePath) & "\"" | workstation.scpt |
on IndexOfItem(theItem, theList) | workstation.scpt |
set theList to {"", theList, ""} as string | workstation.scpt |
set AppleScript's text item delimiters to {"", theItem, ""} as string | workstation.scpt |
set i to (count paragraphs of text item 1 of theList) mod (count paragraphs of theList) | workstation.scpt |
end IndexOfItem | workstation.scpt |
on getProperty(propertyName, plistFile) | workstation.scpt |
if property list item propertyName of plistFile exists then | workstation.scpt |
return value of property list item propertyName of plistFile | workstation.scpt |
end getProperty | workstation.scpt |
on bubbleSort(theList) | workstation.scpt |
script bs | workstation.scpt |
property alist : theList | workstation.scpt |
set theCount to length of bs's alist | workstation.scpt |
if theCount < 2 then return bs's alist | workstation.scpt |
repeat with indexA from theCount to 1 by -1 | workstation.scpt |
repeat with indexB from 1 to indexA - 1 | workstation.scpt |
if item indexB of bs's alist > item (indexB + 1) of bs's alist then | workstation.scpt |
set temp to item indexB of bs's alist | workstation.scpt |
set item indexB of bs's alist to item (indexB + 1) of bs's alist | workstation.scpt |
set item (indexB + 1) of bs's alist to temp | workstation.scpt |
return bs's alist | workstation.scpt |
end bubbleSort | workstation.scpt |
on removeText(unwanted, theText) | removeOrReplace.scpt |
set text item delimiters of AppleScript to unwanted | removeOrReplace.scpt |
set text item delimiters of AppleScript to "" | removeOrReplace.scpt |
end removeText | removeOrReplace.scpt |
set theSentence to "I love Windows and I will always love Windows and I have always loved Windows." | removeOrReplace.scpt |
set theSentence to removeText("Windows", theSentence) | removeOrReplace.scpt |
on replaceText(unwanted, replacement, theText) | removeOrReplace.scpt |
set text item delimiters of AppleScript to replacement | removeOrReplace.scpt |
set theSentence to replaceText(" ", " ", theSentence) | removeOrReplace.scpt |
on q(str) | notify.applescript |
return "\"" & str & "\"" | notify.applescript |
end q | notify.applescript |
on notify(rec) # params: title, description, sticky, icon of application | notify.applescript |
set params to "tell application id \"com.Growl.GrowlHelperApp\" to notify with " | notify.applescript |
try # application name | notify.applescript |
set reg_name to |application name| of rec as text | notify.applescript |
set reg_name to app_name | notify.applescript |
if reg_name is missing value then | notify.applescript |
set reg_name to (get name of current application) | notify.applescript |
try # notification | notify.applescript |
set n to |name| of rec | notify.applescript |
set n to item 1 of notifications | notify.applescript |
set n to "default" | notify.applescript |
register(reg_name, app_icon, {n}) | notify.applescript |
if n is in notifications or n is notifications then | notify.applescript |
set params to params & " name " & q(n) | notify.applescript |
error "unknown notifications " & n | notify.applescript |
try # title | notify.applescript |
set params to params & " title " & q(title of rec as text) | notify.applescript |
try #description | notify.applescript |
set params to params & " description " & q(|description| of rec as text) | notify.applescript |
set params to params & " description \"\"" | notify.applescript |
try # sticky | notify.applescript |
set params to params & " sticky " & (sticky of rec as text) | notify.applescript |
on error # default value | notify.applescript |
set params to params & " sticky false" | notify.applescript |
try # icon of application | notify.applescript |
set params to params & " icon of application " & q(|icon of application| of rec as text) | notify.applescript |
set params to params & " icon of application " & q(app_icon) | notify.applescript |
app_icon | notify.applescript |
try # icon of file | notify.applescript |
set params to params & " icon of file " & q(|icon of file| of rec as text) | notify.applescript |
set params to params & " image from location " & q(|image from location| of rec as text) | notify.applescript |
set params to params & " application name " & q(app_name) | notify.applescript |
run script params | notify.applescript |
set theSubject to subject of first item of theSelection | Copy Title Sent Date and Link.applescript |
set the clipboard to theSubject & tab & theSentDateString & tab & theLink | Copy Title Sent Date and Link.applescript |
set _path to (path of speakable items folder) as string | Speakable Items.applescript |
set the currentAudioSource to (do shell script "/usr/local/bin/SwitchAudioSource -c") | audio_switch.applescript |
if currentAudioSource is equal to "FiiO USB DAC-E10" then | audio_switch.applescript |
do shell script "/usr/local/bin/SwitchAudioSource -s \"AudioQuest DragonFly Black v1.5\"" | audio_switch.applescript |
display notification "SwitchAudioSource" with title "AudioQuest DragonFly Black v1.5" | audio_switch.applescript |
do shell script "/usr/local/bin/SwitchAudioSource -s \"FiiO USB DAC-E10\"" | audio_switch.applescript |
display notification "SwitchAudioSource" with title "FiiO USB DAC-E10" | audio_switch.applescript |
display notification "SwitchAudioSource" with title "Source not found" | audio_switch.applescript |
set dialogResult to display dialog "Please enter a JPEG compression level (in %)." buttons {"Cancel", "OK"} default button "OK" cancel button "Cancel" default answer ("70") with title "Choose JPEG compression" | JPG compress XY%.applescript |
set theCompression to text returned of dialogResult | JPG compress XY%.applescript |
do shell script "sips -s format jpeg -s formatOptions " & theCompression & " " & thePathShell | JPG compress XY%.applescript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.