text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
tell row 5 | System Preferences - Turns Off and On iCloud Calendar.applescript |
on convertirColor(colorRGB) | colorPortapapales.scpt |
set listaHex to {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"} | colorPortapapales.scpt |
set valorHex to "" | colorPortapapales.scpt |
repeat with a from 1 to count of colorRGB | colorPortapapales.scpt |
set valorRGB to (item a of colorRGB) div 256 | colorPortapapales.scpt |
if valorRGB is 256 then set valorRGB to 255 | colorPortapapales.scpt |
set primerElemento to item ((valorRGB div 16) + 1) of listaHex | colorPortapapales.scpt |
set segundoElemento to item (((valorRGB / 16 mod 1) * 16) + 1) of listaHex | colorPortapapales.scpt |
set valorHex to (valorHex & primerElemento & segundoElemento) as string | colorPortapapales.scpt |
return ("#" & valorHex) as string | colorPortapapales.scpt |
end convertirColor | colorPortapapales.scpt |
set colorRGB to (choose color) | colorPortapapales.scpt |
set the clipboard to convertirColor(colorRGB) | colorPortapapales.scpt |
return currentArtist & " - " & currentTrack | spotify-getCurrentTrack.applescript |
property scriptName : "" | fmGUI_fullAccessToggle.applescript |
set scriptName to name of me | fmGUI_fullAccessToggle.applescript |
fmGUI_fullAccessToggle({ensureMode:"user", fullAccessAccountName:"admin", fullAccessPassword:"", userAccountName:"user", userPassword:""}) | fmGUI_fullAccessToggle.applescript |
on fmGUI_fullAccessToggle(prefs) | fmGUI_fullAccessToggle.applescript |
set defaultPrefs to {ensureMode:null, script_enterFullAccess:"Full Access Switch ON", script_leaveFullAccess:"Full Access Switch OFF", scriptFolderName:"Shortcuts", fullAccessAccountName:null, fullAccessPassword:null, userAccountName:null, userPassword:null} | fmGUI_fullAccessToggle.applescript |
set alreadyInUserMode to not fmGUI_isInFullAccessMode({}) | fmGUI_fullAccessToggle.applescript |
if ensureMode of prefs is equal to "user" then | fmGUI_fullAccessToggle.applescript |
set ensureUserMode to true | fmGUI_fullAccessToggle.applescript |
else if ensureMode of prefs is equal to "full" then | fmGUI_fullAccessToggle.applescript |
set ensureUserMode to false | fmGUI_fullAccessToggle.applescript |
set ensureUserMode to not alreadyInUserMode | fmGUI_fullAccessToggle.applescript |
if debugMode then logConsole(scriptName, "fmGUI_fullAccessToggle ensureUserMode: " & ensureUserMode) | fmGUI_fullAccessToggle.applescript |
if ensureUserMode and not alreadyInUserMode then | fmGUI_fullAccessToggle.applescript |
do script (first FileMaker script whose name contains (script_leaveFullAccess of prefs)) | fmGUI_fullAccessToggle.applescript |
if debugMode then logConsole(scriptName, "fmGUI_fullAccessToggle ran script: " & script_leaveFullAccess) | fmGUI_fullAccessToggle.applescript |
if debugMode then logConsole(scriptName, "fmGUI_fullAccessToggle failed to run script via app, trying via menu") | fmGUI_fullAccessToggle.applescript |
fmGUI_Menu_RunScript({scriptName:script_leaveFullAccess of prefs, scriptFolderList:{scriptFolderName of prefs}, partialMatch:true}) | fmGUI_fullAccessToggle.applescript |
if fmGUI_NameOfFrontmostWindow() does not start with "Open" then error "re-login script error" number -1024 | fmGUI_fullAccessToggle.applescript |
fmGUI_Relogin({accountName:userAccountName of prefs, pwd:userPassword of prefs}) | fmGUI_fullAccessToggle.applescript |
else if not ensureUserMode and alreadyInUserMode then | fmGUI_fullAccessToggle.applescript |
do script (first FileMaker script whose name contains (script_enterFullAccess of prefs)) | fmGUI_fullAccessToggle.applescript |
if debugMode then logConsole(scriptName, "fmGUI_fullAccessToggle ran script: " & script_enterFullAccess) | fmGUI_fullAccessToggle.applescript |
fmGUI_Menu_RunScript({scriptName:script_enterFullAccess of prefs, scriptFolderList:{scriptFolderName of prefs}, partialMatch:true}) | fmGUI_fullAccessToggle.applescript |
fmGUI_Relogin({accountName:fullAccessAccountName of prefs, pwd:fullAccessPassword of prefs}) | fmGUI_fullAccessToggle.applescript |
set didEndInUserMode to not fmGUI_isInFullAccessMode({}) | fmGUI_fullAccessToggle.applescript |
set modeSwitch to xor(alreadyInUserMode, didEndInUserMode) | fmGUI_fullAccessToggle.applescript |
if didEndInUserMode then | fmGUI_fullAccessToggle.applescript |
set exitMode to "user" | fmGUI_fullAccessToggle.applescript |
set exitMode to "full" | fmGUI_fullAccessToggle.applescript |
return {modeSwitch:modeSwitch, exitMode:exitMode} | fmGUI_fullAccessToggle.applescript |
error "unable to fullAccessToggle - " & errMsg number errNum | fmGUI_fullAccessToggle.applescript |
end fmGUI_fullAccessToggle | fmGUI_fullAccessToggle.applescript |
tell application "htcLib" to fmGUI_Menu_RunScript(prefs) | fmGUI_fullAccessToggle.applescript |
on fmGUI_Relogin(prefs) | fmGUI_fullAccessToggle.applescript |
tell application "htcLib" to fmGUI_Relogin(prefs) | fmGUI_fullAccessToggle.applescript |
end fmGUI_Relogin | fmGUI_fullAccessToggle.applescript |
on xor(firstBoolean, secondBoolean) | fmGUI_fullAccessToggle.applescript |
tell application "htcLib" to xor(firstBoolean, secondBoolean) | fmGUI_fullAccessToggle.applescript |
end xor | fmGUI_fullAccessToggle.applescript |
display dialog "Creating a tone is simple: | create-itunes-tone.scpt |
1. Select a track in iTunes | create-itunes-tone.scpt |
2. Choose a part of the track (30 seconds or less) | create-itunes-tone.scpt |
3. Remember the start and stop times | create-itunes-tone.scpt |
When you're ready to create a tone launch this script again." buttons {"Cancel", "Create Tone"} default button 2 | create-itunes-tone.scpt |
if theSelection is not {} and (length of theSelection) is 1 then | create-itunes-tone.scpt |
set theTrack to item 1 of theSelection | create-itunes-tone.scpt |
set start of theTrack to 0 | create-itunes-tone.scpt |
set finish of theTrack to 0 | create-itunes-tone.scpt |
set trackStartTime to my setToneDuration("Enter the start time of the tone:", theTrack) | create-itunes-tone.scpt |
set trackStopTime to my setToneDuration("Enter the stop time of the tone:", theTrack) | create-itunes-tone.scpt |
if trackStopTime - trackStartTime is less than or equal to 0 then | create-itunes-tone.scpt |
display dialog return & ¬ | create-itunes-tone.scpt |
"The length must be 30 seconds or less!" buttons {"Cancel", "Try Again"} default button 2 with icon 2 | create-itunes-tone.scpt |
else if trackStopTime - trackStartTime is greater than 30 then | create-itunes-tone.scpt |
set start of theTrack to trackStartTime | create-itunes-tone.scpt |
set finish of theTrack to trackStopTime | create-itunes-tone.scpt |
set preferredEncoder to current encoder | create-itunes-tone.scpt |
set availableEncoders to (name of encoders) | create-itunes-tone.scpt |
repeat with anEncoder in availableEncoders | create-itunes-tone.scpt |
if format of encoder anEncoder is "AAC" then | create-itunes-tone.scpt |
set current encoder to encoder anEncoder | create-itunes-tone.scpt |
set theConvertedTrack to first item of (convert theTrack) | create-itunes-tone.scpt |
set current encoder to preferredEncoder | create-itunes-tone.scpt |
set theConvertedTrackPath to quoted form of POSIX path of (get location of theConvertedTrack) | create-itunes-tone.scpt |
set theTonePath to ("/tmp/" & name of theConvertedTrack & ".m4r") | create-itunes-tone.scpt |
delete (some track of library playlist 1 whose persistent ID is (get persistent ID of theConvertedTrack)) | create-itunes-tone.scpt |
display dialog return & "Select a single track to create a tone..." buttons {"Cancel"} ¬ | create-itunes-tone.scpt |
do shell script "mv " & theConvertedTrackPath & space & quoted form of theTonePath | create-itunes-tone.scpt |
set theTone to POSIX file theTonePath | create-itunes-tone.scpt |
add theTone | create-itunes-tone.scpt |
display dialog return & "Tone created successfully! | create-itunes-tone.scpt |
Select 'Tones' in the left pane to play the tone." buttons {"OK"} ¬ | create-itunes-tone.scpt |
default button 1 with icon 1 | create-itunes-tone.scpt |
do shell script "rm " & quoted form of theTonePath | create-itunes-tone.scpt |
to setToneDuration(displayString, aTrack) | create-itunes-tone.scpt |
set aTrackDuration to duration of aTrack | create-itunes-tone.scpt |
set defaultAnswer to "00:00" | create-itunes-tone.scpt |
set defaultIcon to 1 | create-itunes-tone.scpt |
set theResponce to display dialog displayString default answer defaultAnswer with icon defaultIcon | create-itunes-tone.scpt |
set theTimeItems to text items of (text returned of theResponce) | create-itunes-tone.scpt |
set theMinutes to get item 1 of theTimeItems as number | create-itunes-tone.scpt |
set theSeconds to get item 2 of theTimeItems as number | create-itunes-tone.scpt |
set theTime to theMinutes * minutes + theSeconds | create-itunes-tone.scpt |
if theTime is greater than aTrackDuration then error | create-itunes-tone.scpt |
display dialog return & "'" & text returned of theResponce & "'" & ¬ | create-itunes-tone.scpt |
Subsets and Splits