{"commit":"0bdc9fa698b18e29e4e1a0c880fb8be8e8a69301","old_file":"host\/SendImessage.applescript","new_file":"host\/SendImessage.applescript","old_contents":"#! \/usr\/bin\/osascript\non run argv\n  tell application \"Messages\"\n    send (item 2 of argv) to buddy (item 1 of argv) of (service 1 whose service type is iMessage)\n  end tell\nend run\n","new_contents":"#! \/usr\/bin\/osascript\non run argv\n  tell application \"Messages\"\n    send (item 2 of argv) to buddy (item 1 of argv) of (first service whose service type is iMessage)\n  end tell\nend run\n","subject":"Use english syntax","message":"Use english syntax\n","lang":"AppleScript","license":"mit","repos":"chainsawsalad\/imessage-liberator,chainsawsalad\/imessage-liberator,chainsawsalad\/imessage-liberator"}
{"commit":"36c34b538edb8a4e8d5eabb83cdac04078676d91","old_file":"lib\/nehm\/applescripts\/add_track_to_playlist.applescript","new_file":"lib\/nehm\/applescripts\/add_track_to_playlist.applescript","old_contents":"on run argv\n\ttell application \"iTunes\"\n\t\tset p to first item of argv\n\t\tset a to (p as POSIX file)\n\t\tadd a to playlist (second item of argv)\n\tend tell\nend run\n","new_contents":"on run argv\n\tset posixFile to first item of argv\n\tset playlistName to second item of argv\n\n\ttell application \"iTunes\"\n\t\tset p to posixFile\n\t\tset a to (p as POSIX file)\n\t\tadd a to playlist playlistName\n\tend tell\nend run\n","subject":"Add explanation of arguments in AppleScript scripts","message":"Add explanation of arguments in AppleScript scripts\n","lang":"AppleScript","license":"mit","repos":"bogem\/nehm"}
{"commit":"1ee633a9f5f3897c095c4bceca23a1c807d37742","old_file":"AppleScripts\/Hammerspoon-scpt\/bluetooth_toggle.applescript","new_file":"AppleScripts\/Hammerspoon-scpt\/bluetooth_toggle.applescript","old_contents":"-- Symlinked into ~\/Library\/Services\/ dir to be run as an Apple Service\n\n-- Using \"blueutil\" installed at:\nset blueutilpath to \"\/usr\/local\/bin\/blueutil\"\n-- Toggle Bluetooth off\nset sb to last word of (do shell script blueutilpath & \" status\")\nif sb is \"on\" then\n\tdo shell script blueutilpath & \" off\"\n\treturn \"Bluetooth is now off\"\nelse\n\tdo shell script blueutilpath & \" on\"\n\treturn \"Bluetooth is now on\"\nend if\n","new_contents":"-- Symlinked into ~\/Library\/Services\/ dir to be run as an Apple Service\n\n-- Using \"blueutil\" installed at:\nset blueutilpath to \"\/usr\/local\/bin\/blueutil\"\n-- Might work? The blueutil API changed in version 2\nset sb to (do shell script blueutilpath)\nif \"Power: 1\" in sb then\n\tdo shell script blueutilpath & \" -p off\"\n\treturn \"Bluetooth is now off\"\nelse\n\tdo shell script blueutilpath & \" -p on\"\n\treturn \"Bluetooth is now on\"\nend if\n","subject":"update blueutil version to v ^2","message":"Fix: update blueutil version to v ^2\n","lang":"AppleScript","license":"mit","repos":"KyleKing\/My-Programming-Sketchbook,KyleKing\/My-Programming-Sketchbook,KyleKing\/My-Programming-Sketchbook,KyleKing\/My-Programming-Sketchbook,KyleKing\/My-Programming-Sketchbook,KyleKing\/My-Programming-Sketchbook,KyleKing\/My-Programming-Sketchbook,KyleKing\/My-Programming-Sketchbook,KyleKing\/My-Programming-Sketchbook"}
{"commit":"3da4ae8cce298ea5459f61c2cd8e06b7439a1063","old_file":"support\/template.applescript","new_file":"support\/template.applescript","old_contents":"on run (volumeName)\n\ttell application \"Finder\"\n\t\ttell disk (volumeName as string)\n\t\t\topen\n\t\t\t\n\t\t\tset theXOrigin to WINX\n\t\t\tset theYOrigin to WINY\n\t\t\tset theWidth to WINW\n\t\t\tset theHeight to WINH\n\t\t\t\n\t\t\tset theBottomRightX to (theXOrigin + theWidth)\n\t\t\tset theBottomRightY to (theYOrigin + theHeight)\n\t\t\tset dsStore to \"\\\"\" & \"\/Volumes\/\" & volumeName & \"\/\" & \".DS_STORE\\\"\"\n\t\t\t\n\t\t\ttell container window\n\t\t\t\tset current view to icon view\n\t\t\t\tset toolbar visible to false\n\t\t\t\tset statusbar visible to false\n\t\t\t\tset the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY}\n\t\t\t\tset statusbar visible to false\n\t\t\tend tell\n\t\t\t\n\t\t\tset opts to the icon view options of container window\n\t\t\ttell opts\n\t\t\t\tset icon size to ICON_SIZE\n\t\t\t\tset text size to TEXT_SIZE\n\t\t\t\tset arrangement to not arranged\n\t\t\tend tell\n\t\t\tBACKGROUND_CLAUSE\n\t\t\t\n\t\t\t-- Positioning\n\t\t\tPOSITION_CLAUSE\n\t\t\t\n\t\t\t-- Hiding\n\t\t\tHIDING_CLAUSE\n\t\t\t\n\t\t\t-- Application Link Clause\n\t\t\tAPPLICATION_CLAUSE\n            close\n            open\n\t\t\t\n\t\t\tupdate without registering applications\n\t\t\t-- Force saving of the size\n\t\t\tdelay 1\n\t\t\t\n\t\t\ttell container window\n\t\t\t\tset statusbar visible to false\n\t\t\t\tset the bounds to {theXOrigin, theYOrigin, theBottomRightX - 10, theBottomRightY - 10}\n\t\t\tend tell\n\t\t\t\n\t\t\tupdate without registering applications\n\t\tend tell\n\t\t\n\t\tdelay 1\n\t\t\n\t\ttell disk (volumeName as string)\n\t\t\ttell container window\n\t\t\t\tset statusbar visible to false\n\t\t\t\tset the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY}\n\t\t\tend tell\n\t\t\t\n\t\t\tupdate without registering applications\n\t\tend tell\n\t\t\n\t\t--give the finder some time to write the .DS_Store file\n\t\tdelay 3\n\t\t\n\t\tset waitTime to 0\n\t\tset ejectMe to false\n\t\trepeat while ejectMe is false\n\t\t\tdelay 1\n\t\t\tset waitTime to waitTime + 1\n\t\t\t\n\t\t\tif (do shell script \"[ -f \" & dsStore & \" ]; echo $?\") = \"0\" then set ejectMe to true\n\t\tend repeat\n\t\tlog \"waited \" & waitTime & \" seconds for .DS_STORE to be created.\"\n\tend tell\nend run\n","new_contents":"on run (volumeName)\n\ttell application \"Finder\"\n\t\ttell disk (volumeName as string)\n\t\t\topen\n\t\t\t\n\t\t\tset theXOrigin to WINX\n\t\t\tset theYOrigin to WINY\n\t\t\tset theWidth to WINW\n\t\t\tset theHeight to WINH\n\t\t\t\n\t\t\tset theBottomRightX to (theXOrigin + theWidth)\n\t\t\tset theBottomRightY to (theYOrigin + theHeight)\n\t\t\tset dsStore to \"\\\"\" & \"\/Volumes\/\" & volumeName & \"\/\" & \".DS_STORE\\\"\"\n\t\t\t\n\t\t\ttell container window\n\t\t\t\tset current view to icon view\n\t\t\t\tset toolbar visible to false\n\t\t\t\tset statusbar visible to false\n\t\t\t\tset position of every item to {theBottomRightX + 100, 100}\n\t\t\t\tset the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY}\n\t\t\t\tset statusbar visible to false\n\t\t\tend tell\n\t\t\t\n\t\t\tset opts to the icon view options of container window\n\t\t\ttell opts\n\t\t\t\tset icon size to ICON_SIZE\n\t\t\t\tset text size to TEXT_SIZE\n\t\t\t\tset arrangement to not arranged\n\t\t\tend tell\n\t\t\tBACKGROUND_CLAUSE\n\t\t\t\n\t\t\t-- Positioning\n\t\t\tPOSITION_CLAUSE\n\t\t\t\n\t\t\t-- Hiding\n\t\t\tHIDING_CLAUSE\n\t\t\t\n\t\t\t-- Application Link Clause\n\t\t\tAPPLICATION_CLAUSE\n            close\n            open\n\t\t\t\n\t\t\tupdate without registering applications\n\t\t\t-- Force saving of the size\n\t\t\tdelay 1\n\t\t\t\n\t\t\ttell container window\n\t\t\t\tset statusbar visible to false\n\t\t\t\tset the bounds to {theXOrigin, theYOrigin, theBottomRightX - 10, theBottomRightY - 10}\n\t\t\tend tell\n\t\t\t\n\t\t\tupdate without registering applications\n\t\tend tell\n\t\t\n\t\tdelay 1\n\t\t\n\t\ttell disk (volumeName as string)\n\t\t\ttell container window\n\t\t\t\tset statusbar visible to false\n\t\t\t\tset the bounds to {theXOrigin, theYOrigin, theBottomRightX, theBottomRightY}\n\t\t\tend tell\n\t\t\t\n\t\t\tupdate without registering applications\n\t\tend tell\n\t\t\n\t\t--give the finder some time to write the .DS_Store file\n\t\tdelay 3\n\t\t\n\t\tset waitTime to 0\n\t\tset ejectMe to false\n\t\trepeat while ejectMe is false\n\t\t\tdelay 1\n\t\t\tset waitTime to waitTime + 1\n\t\t\t\n\t\t\tif (do shell script \"[ -f \" & dsStore & \" ]; echo $?\") = \"0\" then set ejectMe to true\n\t\tend repeat\n\t\tlog \"waited \" & waitTime & \" seconds for .DS_STORE to be created.\"\n\tend tell\nend run\n","subject":"Make sure all hidden files are outside the background image","message":"Make sure all hidden files are outside the background image\n\nIf the user enabled Mac OS X to show hidden files then when mounted the\ngenerated DMG package may show some of them within the bounds of the\nbackground image.\n\nThis change makes sure that all items in the DMG package are moved to a\nposition outside the bounds of the background image. The\nPOSITITION_CLAUSE and APPLICATION_CLAUSE that are executed later will\nstill place the app icon and Application correctly.","lang":"AppleScript","license":"mit","repos":"andreyvit\/create-dmg,mrpau\/create-dmg,digitalreasoning\/create-dmg,strukturag\/create-dmg,heavilessrose\/create-dmg,andreyvit\/create-dmg,heavilessrose\/create-dmg,mrpau\/create-dmg,heavilessrose\/create-dmg,andrey-str\/create-dmg,digitalreasoning\/create-dmg,andreyvit\/create-dmg,mrpau\/create-dmg,strukturag\/create-dmg,strukturag\/create-dmg,andrey-str\/create-dmg,andrey-str\/create-dmg,digitalreasoning\/create-dmg"}
{"commit":"9c29d52bd0c27f84251adf023ad80993595be743","old_file":"Release\/dmg_growl.applescript","new_file":"Release\/dmg_growl.applescript","old_contents":"on run -- for testing in script editor\n\tprocess_disk_image(\"Growl\", \"\/Users\/evands\/growl\/Release\/Artwork\")\nend run\n\non process_disk_image(volumeName, artPath)\n\ttell application \"Finder\"\n\t\ttell disk volumeName\n\t\t\topen\n\t\t\ttell container window\n\t\t\t\tset current view to icon view\n\t\t\t\tset toolbar visible to false\n\t\t\t\tset statusbar visible to false\n\t\t\t\t--set the bounds to {30, 50, 579, 600}\n\t\t\tend tell\n\t\t\tclose\n\t\t\tset opts to the icon view options of container window\n\t\t\ttell opts\n\t\t\t\tset icon size to 64\n\t\t\t\tset arrangement to not arranged\n\t\t\tend tell\n\t\t\tset background picture of opts to file \".background:growlDMGBackground.png\"\n\t\t\tset position of item \"Growl.pkg\" to {147, 75}\n\t\t\tset position of item \"Extras\" to {100, 320}\n\t\t\t--set position of item \"Scripts\" to {36, 153}\n\t\t\tset position of item \"Growl Documentation.webloc\" to {100, 218}\n\t\t\tset position of item \"Growl version history.webloc\" to {275, 218}\n\t\t\tset position of item \"Get more styles.webloc\" to {415, 218}\n\t\t\tset position of item \"Uninstall Growl.app\" to {415, 320}\n\t\t\t\n\t\t\t-- Custom icons\n\t\t\tmy copyIconOfTo(artPath & \"\/GrowlIcon\", \"\/Volumes\/\" & volumeName & \"\/Growl.mpkg\")\n\t\t\t\n\t\t\tupdate without registering applications\n\t\t\ttell container window\n\t\t\t\topen\n\t\t\t\tset the_window_id to id\n\t\t\tend tell\n\t\t\tupdate without registering applications\n\t\tend tell\n\t\tset bounds of window id the_window_id to {30, 50, 575, 450}\n\t\t--give the finder some time to write the .DS_Store file\n\t\tdelay 5\n\tend tell\nend process_disk_image\n\non copyIconOfTo(aFileOrFolderWithIcon, aFileOrFolder)\n\ttell application \"Finder\" to set f to POSIX file aFileOrFolderWithIcon as alias\n\t-- grab the file's icon\n\tmy CopyOrPaste(f, \"c\")\n\t-- now the icon is in the clipboard\n\ttell application \"Finder\" to set c to POSIX file aFileOrFolder as alias\n\tmy CopyOrPaste(result, \"v\")\nend copyIconOfTo\n\non CopyOrPaste(i, cv)\n\ttell application \"Finder\"\n\t\tactivate\n\t\topen information window of i\n\tend tell\n\ttell application \"System Events\" to tell process \"Finder\" to tell window 1\n\t\tkeystroke tab -- select icon button\n\t\tkeystroke (cv & \"w\") using command down (* (copy or paste) + close window *)\n\tend tell -- window 1 then process Finder then System Events\nend CopyOrPaste\n","new_contents":"on run -- for testing in script editor\n\tprocess_disk_image(\"Growl\", \"\/Users\/evands\/growl\/Release\/Artwork\")\nend run\n\non process_disk_image(volumeName, artPath)\n\ttell application \"Finder\"\n\t\ttell disk volumeName\n\t\t\topen\n\t\t\ttell container window\n\t\t\t\tset current view to icon view\n\t\t\t\tset toolbar visible to false\n\t\t\t\tset statusbar visible to false\n\t\t\t\tset bounds to {30, 50, 579, 486}\n\t\t\tend tell\n\t\t\tclose\n\t\t\tset opts to the icon view options of container window\n\t\t\ttell opts\n\t\t\t\tset icon size to 64\n\t\t\t\tset arrangement to not arranged\n\t\t\tend tell\n\t\t\tset background picture of opts to file \".background:growlDMGBackground.png\"\n\t\t\tset position of item \"Growl.pkg\" to {147, 75}\n\t\t\tset position of item \"Extras\" to {100, 320}\n\t\t\t--set position of item \"Scripts\" to {36, 153}\n\t\t\tset position of item \"Growl Documentation.webloc\" to {100, 218}\n\t\t\tset position of item \"Growl version history.webloc\" to {275, 218}\n\t\t\tset position of item \"Get more styles.webloc\" to {415, 218}\n\t\t\tset position of item \"Uninstall Growl.app\" to {415, 320}\n\t\t\t\n\t\t\t-- Custom icons\n\t\t\tmy copyIconOfTo(artPath & \"\/GrowlIcon\", \"\/Volumes\/\" & volumeName & \"\/Growl.mpkg\")\n\t\t\t\n\t\t\tupdate without registering applications\n\t\t\ttell container window\n\t\t\t\topen\n\t\t\t\tset the_window_id to id\n\t\t\tend tell\n\t\t\tupdate without registering applications\n\t\tend tell\n\t\tset bounds of window id the_window_id to {30, 50, 575, 450}\n\t\t--give the finder some time to write the .DS_Store file\n\t\tdelay 5\n\tend tell\nend process_disk_image\n\non copyIconOfTo(aFileOrFolderWithIcon, aFileOrFolder)\n\ttell application \"Finder\" to set f to POSIX file aFileOrFolderWithIcon as alias\n\t-- grab the file's icon\n\tmy CopyOrPaste(f, \"c\")\n\t-- now the icon is in the clipboard\n\ttell application \"Finder\" to set c to POSIX file aFileOrFolder as alias\n\tmy CopyOrPaste(result, \"v\")\nend copyIconOfTo\n\non CopyOrPaste(i, cv)\n\ttell application \"Finder\"\n\t\tactivate\n\t\topen information window of i\n\tend tell\n\ttell application \"System Events\" to tell process \"Finder\" to tell window 1\n\t\tkeystroke tab -- select icon button\n\t\tkeystroke (cv & \"w\") using command down (* (copy or paste) + close window *)\n\tend tell -- window 1 then process Finder then System Events\nend CopyOrPaste\n","subject":"Set the bounds of the disk image volume window. I'm not sure why this was commented out. Not only have I uncommented it, I also changed the value.","message":"Set the bounds of the disk image volume window. I'm not sure why this was commented out. Not only have I uncommented it, I also changed the value.\n","lang":"AppleScript","license":"bsd-3-clause","repos":"tectronics\/growl,an0nym0u5\/growl,tectronics\/growl,xhruso00\/growl,morganestes\/morganestes-growl,ylian\/growl,chashion\/growl,ylian\/growl,nkhorman\/archive-growl,an0nym0u5\/growl,nagyistoce\/growl,chashion\/growl,an0nym0u5\/growl,SalrJupiter\/growl,tectronics\/growl,xhruso00\/growl,SalrJupiter\/growl,nochkin\/growl,timbck2\/growl,nagyistoce\/growl,nagyistoce\/growl,tectronics\/growl,ylian\/growl,chashion\/growl,tectronics\/growl,nkhorman\/archive-growl,SalrJupiter\/growl,morganestes\/morganestes-growl,nagyistoce\/growl,nagyistoce\/growl,xhruso00\/growl,timbck2\/growl,chashion\/growl,an0nym0u5\/growl,ylian\/growl,SalrJupiter\/growl,chashion\/growl,timbck2\/growl,morganestes\/morganestes-growl,nagyistoce\/growl,morganestes\/morganestes-growl,nochkin\/growl,nkhorman\/archive-growl,timbck2\/growl,nochkin\/growl,SalrJupiter\/growl,nkhorman\/archive-growl,nochkin\/growl,ylian\/growl,timbck2\/growl,nkhorman\/archive-growl,xhruso00\/growl,morganestes\/morganestes-growl,tectronics\/growl,morganestes\/morganestes-growl,an0nym0u5\/growl,nochkin\/growl,xhruso00\/growl,chashion\/growl,nkhorman\/archive-growl,nochkin\/growl,an0nym0u5\/growl,timbck2\/growl,SalrJupiter\/growl,ylian\/growl,xhruso00\/growl"}
{"commit":"13e6daaff29d31e342dae59e00f3a1652245e576","old_file":"bin\/spotify.scpt","new_file":"bin\/spotify.scpt","old_contents":"if application \"Spotify\" is running then\n  tell application \"Spotify\"\n    if exists current track then\n      set theName to the name of the current track\n      set theArtist to the artist of the current track\n      try\n        return \"\u266b  \" & theName & \" - \" & theArtist\n      on error err\n      end try\n    end if\n  end tell\nend if\n","new_contents":"#!\/usr\/bin\/osascript\n\ntell application \"Spotify\"\n  if it is running then\n    if player state is playing then\n      set track_name to name of current track\n      set artist_name to artist of current track\n\n      if artist_name > 0\n        # If the track has an artist set and is therefore most likely a song rather than an advert\n        \"\u266b \" & artist_name & \" - \" & track_name\n      else\n        # If the track doesn't have an artist set and is therefore most likely an advert rather than a song\n        \"~ \" & track_name\n      end if\n    end if\n  end if\nend tell\n","subject":"fix spotify","message":"fix spotify\n","lang":"AppleScript","license":"bsd-3-clause","repos":"ankoh\/dotfiles"}
{"commit":"da076f89b13cbbf60f0de02c35960cbb536ec958","old_file":"utils\/launch_in_iterm.applescript","new_file":"utils\/launch_in_iterm.applescript","old_contents":"set test_cmd to system attribute \"TEST_CMD\"\n \ntell application \"iTerm\"\n    activate\n    (* set t to (make new terminal) *)\n\n    -- make a new terminal\n    -- set myterm to (current terminal)\n    set myterm to (make new terminal)\n    \n    -- talk to the new terminal\n    tell myterm\n\n        -- make a new session\n        set mysession to launch session \"Default\"\n        -- set mysession to (make new session at the end of sessions)\n        -- select mysession\n\n        -- talk to the session\n        tell mysession\n\n            -- execute a command\n            -- exec command test_cmd\n            write text test_cmd\n        end tell -- we are done talking to the session\n    end tell\nend tell","new_contents":"-- Updated launcher for iTerm 3 beta\nset test_cmd to system attribute \"TEST_CMD\"\n\ntell application \"iTerm\"\n    activate\n    if (count of windows) = 0 then\n        set t to (create window with default profile)\n    else\n        set t to current window\n    end if\n    tell t\n        tell current session\n            write text test_cmd\n        end tell\n    end tell\nend tell\n\n-- legacy iTerm2 code:\n-- set test_cmd to system attribute \"TEST_CMD\"\n \n-- tell application \"iTerm\"\n--     activate\n--     (* set t to (make new terminal) *)\n\n--     -- make a new terminal\n--     -- set myterm to (current terminal)\n--     set myterm to (make new terminal)\n    \n--     -- talk to the new terminal\n--     tell myterm\n\n--         -- make a new session\n--         set mysession to launch session \"Default\"\n--         -- set mysession to (make new session at the end of sessions)\n--         -- select mysession\n\n--         -- talk to the session\n--         tell mysession\n\n--             -- execute a command\n--             -- exec command test_cmd\n--             write text test_cmd\n--         end tell -- we are done talking to the session\n--     end tell\n-- end tell","subject":"update applescript for iTerm 3 beta","message":"fix(launch_in_iterm): update applescript for iTerm 3 beta\n","lang":"AppleScript","license":"mit","repos":"asfaltboy\/Sublime-Test-Plier,asfaltboy\/Sublime-Test-Plier,asfaltboy\/SublimeTestPlier"}
{"commit":"a249e9637caa7a9c479d05a64ab05f84aa0ab38b","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\n-- workflow folders\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\n\n-- album artwork folders\nproperty artworkDocsFolder : ((get path to library folder from user domain as text) & \"Containers:com.apple.AMPArtworkAgent:Data:Documents\")\nproperty artworkImageFolder : (artworkDocsFolder & \":artwork:\")\n\n-- the default icon used for search results without album artwork\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and convert from hexadecimal to decimal (base-10)\n\t\t\tset hexSongId to persistent ID of theSong\n\t\t\tset decSongId to (do shell script \"echo $((16#\" & hexSongId & \"))\")\n\n\t\t\t-- retrieve filename of cached artwork (without extension)\n\t\t\tset artworkName to (do shell script (\"\/usr\/bin\/sqlite3 \" & (POSIX path of artworkDocsFolder) & \"\/artworkd.sqlite '\" & \u00ac\n\t\t\t\"select ZHASHSTRING, ZKIND from ZIMAGEINFO where Z_PK = (\" & \u00ac\n\t\t\t\"(select ZIMAGEINFO from ZSOURCEINFO where Z_PK = (\" & \u00ac\n\t\t\t\"select ZSOURCEINFO from ZDATABASEITEMINFO where ZPERSISTENTID = \" & \u00ac\n\t\t\tdecSongId & \")))' | \" & \u00ac\n\t\t\t\"awk '{split($0,a,\\\"|\\\"); print a[1] \\\"_sk_\\\" a[2] \\\"_cid_1\\\"}'\"))\n\n\t\t\tset artworkPath to (artworkImageFolder & artworkName)\n\n\t\tend tell\n\n\t\treturn selectFirstArtworkThatExists({ \u00ac\n\t\t\t(artworkImageFolder & artworkName & \".jpeg\"), \u00ac\n\t\t\t(artworkImageFolder & artworkName & \".png\")}) of me\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getSongArtworkPath\n\n-- select the first path (in the given set of artwork paths) that exists on the\n-- user's local system\non selectFirstArtworkThatExists(artworkPaths)\n\n\ttell application \"Finder\"\n\t\trepeat with artworkPath in artworkPaths\n\t\t\tif artworkPath exists then\n\t\t\t\treturn artworkPath as text\n\t\t\tend if\n\t\tend repeat\n\tend tell\n\n\treturn defaultIconName\n\nend selectFirstArtworkThatExists\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"Music\"\n\n\t\tset genreSongs to every track of playlist 2 whose genre is genreName\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in genreSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset genreSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset genreSongs to genreSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn genreSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in artistSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset artistSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName)\n\t\t\tset artistSongs to artistSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\n-- workflow folders\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\n\n-- album artwork folders\nproperty artworkDocsFolder : ((get path to library folder from user domain as text) & \"Containers:com.apple.AMPArtworkAgent:Data:Documents\")\nproperty artworkImageFolder : (artworkDocsFolder & \":artwork:\")\n\n-- the default icon used for search results without album artwork\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and convert from hexadecimal to decimal (base-10)\n\t\t\tset hexSongId to persistent ID of theSong\n\t\t\tset decSongId to (do shell script \"echo $((16#\" & hexSongId & \"))\")\n\n\t\t\t-- retrieve filename of cached artwork (without extension)\n\t\t\tset artworkName to (do shell script (\"\/usr\/bin\/sqlite3 \" & (POSIX path of artworkDocsFolder) & \"\/artworkd.sqlite '\" & \u00ac\n\t\t\t\"select ZHASHSTRING, ZKIND from ZIMAGEINFO where Z_PK = (\" & \u00ac\n\t\t\t\"(select ZIMAGEINFO from ZSOURCEINFO where Z_PK = (\" & \u00ac\n\t\t\t\"select ZSOURCEINFO from ZDATABASEITEMINFO where ZPERSISTENTID = \" & \u00ac\n\t\t\tdecSongId & \")))' | \" & \u00ac\n\t\t\t\"awk '{split($0,a,\\\"|\\\"); print a[1] \\\"_sk_\\\" a[2] \\\"_cid_1\\\"}'\"))\n\n\t\t\tset artworkPath to (artworkImageFolder & artworkName)\n\n\t\tend tell\n\n\t\treturn selectFirstArtworkThatExists({ \u00ac\n\t\t\t(artworkImageFolder & artworkName & \".jpeg\"), \u00ac\n\t\t\t(artworkImageFolder & artworkName & \".png\")}) of me\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getSongArtworkPath\n\n-- select the first path (in the given set of artwork paths) that exists on the\n-- user's local system\non selectFirstArtworkThatExists(artworkPaths)\n\n\ttell application \"Finder\"\n\t\trepeat with artworkPath in artworkPaths\n\t\t\tif artworkPath exists then\n\t\t\t\treturn artworkPath as text\n\t\t\tend if\n\t\tend repeat\n\tend tell\n\n\treturn defaultIconName\n\nend selectFirstArtworkThatExists\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"Music\"\n\n\t\tset genreSongs to every track of playlist 2 whose genre is genreName\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in genreSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset genreSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset genreSongs to genreSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn genreSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in artistSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset artistSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName)\n\t\t\tset artistSongs to artistSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","subject":"Remove obsolete fileWrite() handler","message":"Remove obsolete fileWrite() handler\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"77adc261b070ce81c99ade972413bdcc94a7eced","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-2:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes XML reserved characters in the given string\non encodeXmlChars(theString)\n\n\tset theString to replace(\"&\", \"&amp;\", theString)\n\tset theString to replace(\"<\", \"&lt;\", theString)\n\tset theString to replace(\">\", \"&gt;\", theString)\n\tset theString to replace(\"\\\"\", \"&quot;\", theString)\n\tset theString to replace(\"'\", \"&apos;\", theString)\n\treturn theString\n\nend encodeXmlChars\n\n-- decodes XML reserved characters in the given string\non decodeXmlChars(theString)\n\n\tset theString to replace(\"&amp;\", \"&\", theString)\n\tset theString to replace(\"&lt;\", \"<\", theString)\n\tset theString to replace(\"&gt;\", \">\", theString)\n\tset theString to replace(\"&quot;\", \"\\\"\", theString)\n\tset theString to replace(\"&apos;\", \"'\", theString)\n\treturn theString\n\nend decodeXmlChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as XML\non getResultXml(theResult)\n\n\t-- encode reserved XML characters\n\tset resultUid to encodeXmlChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeXmlChars(title of theResult)\n\tset resultSubtitle to encodeXmlChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeXmlChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset xml to \"<item uid='\" & resultUid & \"' arg='\" & resultUid & \"' valid='\" & resultValid & \"'>\"\n\tset xml to xml & \"<title>\" & resultTitle & \"<\/title>\"\n\tset xml to xml & \"<subtitle>\" & resultSubtitle & \"<\/subtitle>\"\n\tset xml to xml & \"<icon>\" & resultIcon & \"<\/icon>\"\n\tset xml to xml & \"<\/item>\"\n\treturn xml\n\nend getResultXml\n\n-- retrieves XML document for Alfred results\non getResultListXml()\n\n\tset xml to \"<?xml version='1.0'?><items>\"\n\n\trepeat with theResult in resultList\n\n\t\tset xml to xml & getResultXml(theResult)\n\n\tend repeat\n\n\tset xml to xml & \"<\/items>\"\n\treturn xml\n\nend getResultListXml\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\ttry\n\n\t\tset fileRef to open for access theFile with write permission\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\n\ton error\n\n\t\tclose access fileRef\n\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\n-- brings queue into view in iTunes window\non focusQueue()\n\n\ttell application \"iTunes\"\n\n\t\treveal user playlist workflowPlaylistName\n\n\tend tell\n\nend focusQueue\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to first user playlist whose id is playlistId\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif disc number of theSong is discIndex and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeXmlChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeXmlChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeXmlChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\n\tfocusQueue()\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tfocusQueue()\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes XML reserved characters in the given string\non encodeXmlChars(theString)\n\n\tset theString to replace(\"&\", \"&amp;\", theString)\n\tset theString to replace(\"<\", \"&lt;\", theString)\n\tset theString to replace(\">\", \"&gt;\", theString)\n\tset theString to replace(\"\\\"\", \"&quot;\", theString)\n\tset theString to replace(\"'\", \"&apos;\", theString)\n\treturn theString\n\nend encodeXmlChars\n\n-- decodes XML reserved characters in the given string\non decodeXmlChars(theString)\n\n\tset theString to replace(\"&amp;\", \"&\", theString)\n\tset theString to replace(\"&lt;\", \"<\", theString)\n\tset theString to replace(\"&gt;\", \">\", theString)\n\tset theString to replace(\"&quot;\", \"\\\"\", theString)\n\tset theString to replace(\"&apos;\", \"'\", theString)\n\treturn theString\n\nend decodeXmlChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as XML\non getResultXml(theResult)\n\n\t-- encode reserved XML characters\n\tset resultUid to encodeXmlChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeXmlChars(title of theResult)\n\tset resultSubtitle to encodeXmlChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeXmlChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset xml to \"<item uid='\" & resultUid & \"' arg='\" & resultUid & \"' valid='\" & resultValid & \"'>\"\n\tset xml to xml & \"<title>\" & resultTitle & \"<\/title>\"\n\tset xml to xml & \"<subtitle>\" & resultSubtitle & \"<\/subtitle>\"\n\tset xml to xml & \"<icon>\" & resultIcon & \"<\/icon>\"\n\tset xml to xml & \"<\/item>\"\n\treturn xml\n\nend getResultXml\n\n-- retrieves XML document for Alfred results\non getResultListXml()\n\n\tset xml to \"<?xml version='1.0'?><items>\"\n\n\trepeat with theResult in resultList\n\n\t\tset xml to xml & getResultXml(theResult)\n\n\tend repeat\n\n\tset xml to xml & \"<\/items>\"\n\treturn xml\n\nend getResultListXml\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\ttry\n\n\t\tset fileRef to open for access theFile with write permission\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\n\ton error\n\n\t\tclose access fileRef\n\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\n-- brings queue into view in iTunes window\non focusQueue()\n\n\ttell application \"iTunes\"\n\n\t\treveal user playlist workflowPlaylistName\n\n\tend tell\n\nend focusQueue\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to first user playlist whose id is playlistId\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif disc number of theSong is discIndex and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeXmlChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeXmlChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeXmlChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\n\tfocusQueue()\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tfocusQueue()\n\tplayQueue()\n\nend play\n","subject":"Use Alfred 3 cache folder","message":"Use Alfred 3 cache folder\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"1ea0ec81dc1f4ebcd8c9ddac8950336bff8bf1a3","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\n-- brings queue into view in iTunes window\non focusQueue()\n\n\ttell application \"iTunes\"\n\n\t\treveal user playlist workflowPlaylistName\n\n\tend tell\n\nend focusQueue\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to first user playlist whose id is playlistId\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif disc number of theSong is discIndex and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\n\tfocusQueue()\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tfocusQueue()\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\n-- brings queue into view in iTunes window\non focusQueue()\n\n\ttell application \"iTunes\"\n\n\t\treveal user playlist workflowPlaylistName\n\n\tend tell\n\nend focusQueue\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to first user playlist whose id is playlistId\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif disc number of theSong is discIndex and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset searchSongs to {}\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset searchSongs to (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset searchSongs to (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\t\trepeat with searchSong in searchSongs\n\n\t\t\t\t\t\tset duplicateSong to false\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif theSong is searchSong then\n\n\t\t\t\t\t\t\t\tset duplicateSong to true\n\t\t\t\t\t\t\t\texit repeat\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\t\tif duplicateSong is false then\n\n\t\t\t\t\t\t\tcopy searchSong to end of theSongs\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\n\tfocusQueue()\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tfocusQueue()\n\tplayQueue()\n\nend play\n","subject":"Fix bug where search would yield duplicate results","message":"Fix bug where search would yield duplicate results\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"2dd417c1bec7abb4228c407b6fac2bd32a90110b","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes XML reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"&\", \"&amp;\", theString)\n\tset theString to replace(\"<\", \"&lt;\", theString)\n\tset theString to replace(\">\", \"&gt;\", theString)\n\tset theString to replace(\"\\\"\", \"&quot;\", theString)\n\tset theString to replace(\"'\", \"&apos;\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes XML reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"&amp;\", \"&\", theString)\n\tset theString to replace(\"&lt;\", \"<\", theString)\n\tset theString to replace(\"&gt;\", \">\", theString)\n\tset theString to replace(\"&quot;\", \"\\\"\", theString)\n\tset theString to replace(\"&apos;\", \"'\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as XML\non getResultFeedback(theResult)\n\n\t-- encode reserved XML characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset xml to \"<item uid='\" & resultUid & \"' arg='\" & resultUid & \"' valid='\" & resultValid & \"'>\"\n\tset xml to xml & \"<title>\" & resultTitle & \"<\/title>\"\n\tset xml to xml & \"<subtitle>\" & resultSubtitle & \"<\/subtitle>\"\n\tset xml to xml & \"<icon>\" & resultIcon & \"<\/icon>\"\n\tset xml to xml & \"<\/item>\"\n\treturn xml\n\nend getResultFeedback\n\n-- retrieves XML document for Alfred results\non getResultListFeedback()\n\n\tset xml to \"<?xml version='1.0'?><items>\"\n\n\trepeat with theResult in resultList\n\n\t\tset xml to xml & getResultFeedback(theResult)\n\n\tend repeat\n\n\tset xml to xml & \"<\/items>\"\n\treturn xml\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\n-- brings queue into view in iTunes window\non focusQueue()\n\n\ttell application \"iTunes\"\n\n\t\treveal user playlist workflowPlaylistName\n\n\tend tell\n\nend focusQueue\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to first user playlist whose id is playlistId\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif disc number of theSong is discIndex and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\n\tfocusQueue()\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tfocusQueue()\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\n-- brings queue into view in iTunes window\non focusQueue()\n\n\ttell application \"iTunes\"\n\n\t\treveal user playlist workflowPlaylistName\n\n\tend tell\n\nend focusQueue\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to first user playlist whose id is playlistId\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif disc number of theSong is discIndex and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\n\tfocusQueue()\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tfocusQueue()\n\tplayQueue()\n\nend play\n","subject":"Switch from XML to JSON for results feedback","message":"Switch from XML to JSON for results feedback\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"0efd6d52ba59d8f7cc024ae005d6fabe8680cdbf","old_file":"macosx\/scripts\/iTunes\/mobile-speakers.applescript","new_file":"macosx\/scripts\/iTunes\/mobile-speakers.applescript","old_contents":"script remoteSpeakerFinder\n\tglobal the_bwindow, the_state\n\t\n\t-- Find the remote speakers button\n\ton findCorrectButton()\n\t\ttell application \"System Events\"\n\t\t\ttell process \"iTunes\"\n\t\t\t\tset the_window to (get window \"iTunes\")\n\t\t\t\tset in_buttons to (get buttons of the_window)\n\t\t\t\t\n\t\t\t\trepeat with a_button in in_buttons\n\t\t\t\t\tset the_desc to (get description of a_button)\n\t\t\t\t\tif the_desc contains \"remote speakers\" then\n\t\t\t\t\t\treturn a_button\n\t\t\t\t\tend if\n\t\t\t\tend repeat\n\t\t\tend tell\n\t\tend tell\n\tend findCorrectButton\n\t\n\ton makeSpeakerWindowShow()\n\t\ttell application \"System Events\"\n\t\t\ttell process \"iTunes\"\n\t\t\t\tset the_speaker_button to (remoteSpeakerFinder's findCorrectButton())\n\t\t\t\t\n\t\t\t\t-- Switch to the speakers in my bedroom\n\t\t\t\tset frontmost to true\n\t\t\t\tclick the_speaker_button\n\t\t\t\tkey code 119 -- Key Code for \"END\"\n\t\t\t\tkey code 76 -- Click \"enter\" for last menu item\n\t\t\t\tdelay 2\n\t\t\tend tell\n\t\tend tell\n\tend makeSpeakerWindowShow\n\t\n\ton setValueOfComputerSpeaker(value_to_set)\n\t\tmakeSpeakerWindowShow()\n\t\t\n\t\ttell application \"System Events\"\n\t\t\ttell process \"iTunes\"\n\t\t\t\ttell window \"Multiple Speakers\"\n\t\t\t\t\tactivate\n\t\t\t\t\t\n\t\t\t\t\tset the_cbox to (get checkbox 1 of group 1 of row 1 of table 1 of scroll area 1)\n\t\t\t\t\tset the_value to (get value of the_cbox as integer)\n\t\t\t\t\t\n\t\t\t\t\tif the_value is not equal to value_to_set then\n\t\t\t\t\t\tset value of the_cbox to value_to_set\n\t\t\t\t\tend if\n\t\t\t\tend tell\n\t\t\tend tell\n\t\tend tell\n\t\t\n\t\ttell application \"iTunes\" to close window \"Multiple Speakers\"\n\tend setValueOfComputerSpeaker\n\t\n\ton turnOffAllRemoteSpeakers()\n\t\tmakeSpeakerWindowShow()\n\t\t\n\t\ttell application \"System Events\"\n\t\t\ttell process \"iTunes\"\n\t\t\t\ttell window \"Multiple Speakers\"\n\t\t\t\t\tactivate\n\t\t\t\t\t\n\t\t\t\t\trepeat with a_row in (get rows of table 1 of scroll area 1)\n\t\t\t\t\t\tset the_desc to (get description of checkbox 1 of group 1 of a_row)\n\t\t\t\t\t\tset the_value to (get value of checkbox 1 of group 1 of a_row as integer)\n\t\t\t\t\t\tif the_desc is not equal to \"Computer\" and the_value is not equal to 0 then\n\t\t\t\t\t\t\tset value of checkbox 1 of group 1 of a_row to 0\n\t\t\t\t\t\tend if\n\t\t\t\t\tend repeat\n\t\t\t\tend tell\n\t\t\tend tell\n\t\tend tell\n\t\t\n\t\ttell application \"iTunes\" to close window \"Multiple Speakers\"\n\tend turnOffAllRemoteSpeakers\n\t\n\ton turnOnGivenSpeakerName(speaker_name)\n\t\tmakeSpeakerWindowShow()\n\t\t\n\t\ttell application \"System Events\"\n\t\t\ttell process \"iTunes\"\n\t\t\t\ttell window \"Multiple Speakers\"\n\t\t\t\t\tactivate\n\t\t\t\t\t\n\t\t\t\t\trepeat with a_row in (get rows of table 1 of scroll area 1)\n\t\t\t\t\t\tset the_desc to (get description of checkbox 1 of group 1 of a_row)\n\t\t\t\t\t\tset the_value to (get value of checkbox 1 of group 1 of a_row as integer)\n\t\t\t\t\t\tif the_desc is equal to speaker_name and the_value is not equal to 1 then\n\t\t\t\t\t\t\tset value of checkbox 1 of group 1 of a_row to 0\n\t\t\t\t\t\t\tdelay 5\n\t\t\t\t\t\tend if\n\t\t\t\t\tend repeat\n\t\t\t\tend tell\n\t\t\tend tell\n\t\tend tell\n\t\ttell application \"iTunes\" to close window \"Multiple Speakers\"\n\tend turnOnGivenSpeakerName\n\t\n\ton setRemoteSpeakersTo(speaker_name)\n\t\tmakeSpeakerWindowShow()\n\t\t\n\t\ttell application \"System Events\"\n\t\t\ttell process \"iTunes\"\n\t\t\t\t\n\t\t\t\t-- Flip the right checkboxes\n\t\t\t\ttell (get window \"Multiple Speakers\")\n\t\t\t\t\tactivate\n\t\t\t\t\ttell table 1 of scroll area 1\n\t\t\t\t\t\tactivate\n\t\t\t\t\t\t\n\t\t\t\t\t\tset did_activate_correct_speaker to 0\n\t\t\t\t\t\tset computer_speaker to null\n\t\t\t\t\t\t\n\t\t\t\t\t\trepeat with i from 1 to (count of every row)\n\t\t\t\t\t\t\ttell group 1 of row i\n\t\t\t\t\t\t\t\tactivate\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tset the_desc to (description of checkbox 1)\n\t\t\t\t\t\t\t\tset the_value to (value of checkbox 1 as integer)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif the_desc = \"Computer\" then\n\t\t\t\t\t\t\t\t\tset computer_speaker to (get checkbox 1)\n\t\t\t\t\t\t\t\t\tif the_value = 0 then\n\t\t\t\t\t\t\t\t\t\tclick checkbox 1\n\t\t\t\t\t\t\t\t\t\tdelay 10\n\t\t\t\t\t\t\t\t\tend if\n\t\t\t\t\t\t\t\telse if the_desc = speaker_name then\n\t\t\t\t\t\t\t\t\tset did_activate_correct_speaker to 1\n\t\t\t\t\t\t\t\t\tif the_value = 0 then\n\t\t\t\t\t\t\t\t\t\tclick checkbox 1\n\t\t\t\t\t\t\t\t\t\tdelay 10\n\t\t\t\t\t\t\t\t\tend if\n\t\t\t\t\t\t\t\telse if the_value = 1 then\n\t\t\t\t\t\t\t\t\tclick checkbox 1\n\t\t\t\t\t\t\t\t\tdelay 10\n\t\t\t\t\t\t\t\tend if\n\t\t\t\t\t\t\tend tell\n\t\t\t\t\t\tend repeat\n\t\t\t\t\t\t\n\t\t\t\t\t\t-- Turn off the computer speakers\n\t\t\t\t\t\tif did_activate_correct_speaker = 1 then\n\t\t\t\t\t\t\tclick computer_speaker\n\t\t\t\t\t\t\tdelay 10\n\t\t\t\t\t\tend if\n\t\t\t\t\tend tell\n\t\t\t\tend tell\n\t\t\tend tell\n\t\tend tell\n\t\t\n\t\ttell application \"iTunes\" to close window \"Multiple Speakers\"\n\tend setRemoteSpeakersTo\n\t\n\ton prepareWindow()\n\t\ttell application \"iTunes\"\n\t\t\tset the_bwindow to (get first browser window)\n\t\t\tset the_state to (get minimized of the_bwindow)\n\t\t\tset visible of the_bwindow to true\n\t\t\tset minimized of the_bwindow to false\n\t\tend tell\n\tend prepareWindow\n\t\n\ton resetWindow()\n\t\ttell application \"iTunes\"\n\t\t\t-- Return window to previous state\n\t\t\tset minimized of the_bwindow to the_state\n\t\tend tell\n\tend resetWindow\nend script\n\non run (argv)\n\ttell application \"iTunes\" to stop\n\tset speaker_name to (get item 1 of argv)\n\t\n\tremoteSpeakerFinder's prepareWindow()\n\tremoteSpeakerFinder's setValueOfComputerSpeaker(1)\n\tremoteSpeakerFinder's turnOffAllRemoteSpeakers()\n\t\t\n\tif speaker_name is not equal to \"Computer\" then\n\t\tremoteSpeakerFinder's turnOnGivenSpeakerName(speaker_name)\n\t\tremoteSpeakerFinder's setValueOfComputerSpeaker(0)\n\tend if\n\t\n\tremoteSpeakerFinder's resetWindow()\nend run\n","new_contents":"script remoteSpeakerFinder\n\tglobal the_bwindow, the_state\n\t\n\t-- Find the remote speakers button\n\ton findCorrectButton()\n\t\ttell application \"System Events\"\n\t\t\ttell process \"iTunes\"\n\t\t\t\tset the_window to (get window \"iTunes\")\n\t\t\t\tset in_buttons to (get buttons of the_window)\n\t\t\t\t\n\t\t\t\trepeat with a_button in in_buttons\n\t\t\t\t\tset the_desc to (get description of a_button)\n\t\t\t\t\tif the_desc contains \"AirPlay\" then\n\t\t\t\t\t\treturn a_button\n\t\t\t\t\tend if\n\t\t\t\tend repeat\n\t\t\tend tell\n\t\tend tell\n\tend findCorrectButton\n\t\n\ton makeSpeakerWindowShow()\n\t\ttell application \"System Events\"\n\t\t\ttell process \"iTunes\"\n\t\t\t\tset the_speaker_button to (remoteSpeakerFinder's findCorrectButton())\n\t\t\t\t\n\t\t\t\t-- Switch to the speakers in my bedroom\n\t\t\t\tset frontmost to true\n\t\t\t\tclick the_speaker_button\n\t\t\t\tkey code 119 -- Key Code for \"END\"\n\t\t\t\tkey code 76 -- Click \"enter\" for last menu item\n\t\t\t\tdelay 2\n\t\t\tend tell\n\t\tend tell\n\tend makeSpeakerWindowShow\n\t\n\ton setValueOfComputerSpeaker(value_to_set)\n\t\tmakeSpeakerWindowShow()\n\t\t\n\t\ttell application \"System Events\"\n\t\t\ttell process \"iTunes\"\n\t\t\t\ttell window \"Multiple Speakers\"\n\t\t\t\t\tactivate\n\t\t\t\t\t\n\t\t\t\t\tset the_cbox to (get checkbox 1 of group 1 of row 1 of table 1 of scroll area 1)\n\t\t\t\t\tset the_value to (get value of the_cbox as integer)\n\t\t\t\t\t\n\t\t\t\t\tif the_value is not equal to value_to_set then\n\t\t\t\t\t\tset value of the_cbox to value_to_set\n\t\t\t\t\tend if\n\t\t\t\tend tell\n\t\t\tend tell\n\t\tend tell\n\t\t\n\t\ttell application \"iTunes\" to close window \"Multiple Speakers\"\n\tend setValueOfComputerSpeaker\n\t\n\ton turnOffAllRemoteSpeakers()\n\t\tmakeSpeakerWindowShow()\n\t\t\n\t\ttell application \"System Events\"\n\t\t\ttell process \"iTunes\"\n\t\t\t\ttell window \"Multiple Speakers\"\n\t\t\t\t\tactivate\n\t\t\t\t\t\n\t\t\t\t\trepeat with a_row in (get rows of table 1 of scroll area 1)\n\t\t\t\t\t\tset the_desc to (get description of checkbox 1 of group 1 of a_row)\n\t\t\t\t\t\tset the_value to (get value of checkbox 1 of group 1 of a_row as integer)\n\t\t\t\t\t\tif the_desc is not equal to \"Computer\" and the_value is not equal to 0 then\n\t\t\t\t\t\t\tset value of checkbox 1 of group 1 of a_row to 0\n\t\t\t\t\t\tend if\n\t\t\t\t\tend repeat\n\t\t\t\tend tell\n\t\t\tend tell\n\t\tend tell\n\t\t\n\t\ttell application \"iTunes\" to close window \"Multiple Speakers\"\n\tend turnOffAllRemoteSpeakers\n\t\n\ton turnOnGivenSpeakerName(speaker_name)\n\t\tmakeSpeakerWindowShow()\n\t\t\n\t\ttell application \"System Events\"\n\t\t\ttell process \"iTunes\"\n\t\t\t\ttell window \"Multiple Speakers\"\n\t\t\t\t\tactivate\n\t\t\t\t\t\n\t\t\t\t\trepeat with a_row in (get rows of table 1 of scroll area 1)\n\t\t\t\t\t\tset the_desc to (get description of checkbox 1 of group 1 of a_row)\n\t\t\t\t\t\tset the_value to (get value of checkbox 1 of group 1 of a_row as integer)\n\t\t\t\t\t\tif the_desc is equal to speaker_name and the_value is not equal to 1 then\n\t\t\t\t\t\t\tset value of checkbox 1 of group 1 of a_row to 0\n\t\t\t\t\t\t\tdelay 5\n\t\t\t\t\t\tend if\n\t\t\t\t\tend repeat\n\t\t\t\tend tell\n\t\t\tend tell\n\t\tend tell\n\t\ttell application \"iTunes\" to close window \"Multiple Speakers\"\n\tend turnOnGivenSpeakerName\n\t\n\ton setRemoteSpeakersTo(speaker_name)\n\t\tmakeSpeakerWindowShow()\n\t\t\n\t\ttell application \"System Events\"\n\t\t\ttell process \"iTunes\"\n\t\t\t\t\n\t\t\t\t-- Flip the right checkboxes\n\t\t\t\ttell (get window \"Multiple Speakers\")\n\t\t\t\t\tactivate\n\t\t\t\t\ttell table 1 of scroll area 1\n\t\t\t\t\t\tactivate\n\t\t\t\t\t\t\n\t\t\t\t\t\tset did_activate_correct_speaker to 0\n\t\t\t\t\t\tset computer_speaker to null\n\t\t\t\t\t\t\n\t\t\t\t\t\trepeat with i from 1 to (count of every row)\n\t\t\t\t\t\t\ttell group 1 of row i\n\t\t\t\t\t\t\t\tactivate\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tset the_desc to (description of checkbox 1)\n\t\t\t\t\t\t\t\tset the_value to (value of checkbox 1 as integer)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif the_desc = \"Computer\" then\n\t\t\t\t\t\t\t\t\tset computer_speaker to (get checkbox 1)\n\t\t\t\t\t\t\t\t\tif the_value = 0 then\n\t\t\t\t\t\t\t\t\t\tclick checkbox 1\n\t\t\t\t\t\t\t\t\t\tdelay 10\n\t\t\t\t\t\t\t\t\tend if\n\t\t\t\t\t\t\t\telse if the_desc = speaker_name then\n\t\t\t\t\t\t\t\t\tset did_activate_correct_speaker to 1\n\t\t\t\t\t\t\t\t\tif the_value = 0 then\n\t\t\t\t\t\t\t\t\t\tclick checkbox 1\n\t\t\t\t\t\t\t\t\t\tdelay 10\n\t\t\t\t\t\t\t\t\tend if\n\t\t\t\t\t\t\t\telse if the_value = 1 then\n\t\t\t\t\t\t\t\t\tclick checkbox 1\n\t\t\t\t\t\t\t\t\tdelay 10\n\t\t\t\t\t\t\t\tend if\n\t\t\t\t\t\t\tend tell\n\t\t\t\t\t\tend repeat\n\t\t\t\t\t\t\n\t\t\t\t\t\t-- Turn off the computer speakers\n\t\t\t\t\t\tif did_activate_correct_speaker = 1 then\n\t\t\t\t\t\t\tclick computer_speaker\n\t\t\t\t\t\t\tdelay 10\n\t\t\t\t\t\tend if\n\t\t\t\t\tend tell\n\t\t\t\tend tell\n\t\t\tend tell\n\t\tend tell\n\t\t\n\t\ttell application \"iTunes\" to close window \"Multiple Speakers\"\n\tend setRemoteSpeakersTo\n\t\n\ton prepareWindow()\n\t\ttell application \"iTunes\"\n\t\t\tset the_bwindow to (get first browser window)\n\t\t\tset the_state to (get minimized of the_bwindow)\n\t\t\tset visible of the_bwindow to true\n\t\t\tset minimized of the_bwindow to false\n\t\tend tell\n\tend prepareWindow\n\t\n\ton resetWindow()\n\t\ttell application \"iTunes\"\n\t\t\t-- Return window to previous state\n\t\t\tset minimized of the_bwindow to the_state\n\t\tend tell\n\tend resetWindow\nend script\n\non run (argv)\n\ttell application \"iTunes\" to stop\n\tset speaker_name to (get item 1 of argv)\n\t\n\tremoteSpeakerFinder's prepareWindow()\n\tremoteSpeakerFinder's setValueOfComputerSpeaker(1)\n\tremoteSpeakerFinder's turnOffAllRemoteSpeakers()\n\t\t\n\tif speaker_name is not equal to \"Computer\" then\n\t\tremoteSpeakerFinder's turnOnGivenSpeakerName(speaker_name)\n\t\tremoteSpeakerFinder's setValueOfComputerSpeaker(0)\n\tend if\n\t\n\tremoteSpeakerFinder's resetWindow()\nend run\n","subject":"Update for iTunes 10.1.2","message":"Update for iTunes 10.1.2\n","lang":"AppleScript","license":"bsd-3-clause","repos":"pjones\/emacsrc"}
{"commit":"0dfeb53c383b10b43c2c40b9d9c69e761db91081","old_file":"QuickStats\/QuickStats.applescript","new_file":"QuickStats\/QuickStats.applescript","old_contents":"property pTitle : \"OmniFocus: Quick Stats\"\nproperty pVersion : \"2.07.brett\"\n\nproperty pstrDBPath : \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/com.omnigroup.OmniFocus\/OmniFocusDatabase2\"\nproperty pstrMinOSX : \"10.9\"\n\nproperty pTimeOut : 20\n\n-- Original version: https:\/\/github.com\/RobTrew\/tree-tools\/blob\/master\/OmniFocus%20scripts\/Statistics\/QuickStats.applescript\n\n-- Copyright  2012, 2013, 2014 Robin Trew\n-- \n-- Permission is hereby granted, free of charge, \n-- to any person obtaining a copy of this software \n-- and associated documentation files (the \"Software\"), \n-- to deal in the Software without restriction, \n-- including without limitation the rights to use, copy, \n-- modify, merge, publish, distribute, sublicense, \n-- and\/or sell copies of the Software, and to permit persons \n-- to whom the Software is furnished to do so, \n-- subject to the following conditions:\n-- \n-- *******\n-- The above copyright notice and this permission notice \n-- shall be included in ALL copies \n-- or substantial portions of the Software.\n-- *******\n-- \n-- THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, \n-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES \n-- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \n-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \n-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, \n-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE \n-- OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n-- Ver 0.8 adds clipboard option to dialogue\n-- Ver 0.9 gives an error message if the cache schema has changed, leading to an SQL error in the script\n-- Ver 1.0 slight simplification of the code\n-- Ver 1.1 added count of Pending projects\n-- Ver 1.2 added a count of available actions\n-- Ver 1.3 added a break-down of unavailable actions\n-- Ver 1.4 added count of Current projects to complement Pending projects\n-- ver 1.5 replaced Applescript time function with SQL time expression\n-- Ver 1.7 Reorganizes menu, and attempts to enable access for .macappstore installations of OF\n--Ver 1.8 Adjusts handling of variant bundle identifiers generally\n-- Ver 2.00 Redraft of task breakdown, with progressive narrowing of criteria ...\n\nproperty pToClipboard : \"Copy list to clipboard\"\n\nif not FileExists(pstrDBPath) then set pstrDBPath to GetCachePath()\n\ntell application \"Finder\"\n\tif (version < pstrMinOSX) then\n\t\tdisplay dialog \"This script requires OSX \" & pstrMinOSX & \" or higher\" buttons {\"OK\"} default button 1 with title pTitle & \"Ver. \" & pVersion\n\t\treturn\n\tend if\nend tell\n\nif pstrDBPath  \"\" then\n\tset inbox_cmd to \"\n\tselect 'INBOX GROUPS & ACTIONS', count(*) from task where (inInbox=1);\n\tselect '    Inbox action groups', count(*) from task where (inInbox=1) and (childrenCount>0);\n\tselect '    Inbox actions', count(*) from task where (inInbox=1) and (childrenCount=0);\n\tselect null;\n\t\"\n\tset folders_cmd to \"\n\tselect 'FOLDERS'\t, count(*) from folder;\n\tselect '    Active folders', count(*) from folder where effectiveActive=1;\n\tselect '    Dropped folders', count(*) from folder where effectiveActive=0;\n\tselect null;\n\t\"\n\tset projects_cmd to \"\n\tselect 'PROJECTS', count(*) from projectInfo where containsSingletonActions=0;\n\tselect '    Active projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='active');\n\tselect '            Current projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart is null or t.dateToStart < (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '            Pending projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart > (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '    On-hold projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='inactive');\n\tselect '    Completed projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='done');\n\tselect '    Dropped projects', count(*) from projectInfo where (containsSingletonActions=0) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset lists_cmd to \"\n\tselect 'SINGLE ACTION LISTS', count(*) from projectInfo where containsSingletonActions=1;\n\tselect '    Active single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='active');\n\tselect '    On-hold single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='inactive');\n\tselect '    Completed single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='done');\n\tselect '    Dropped single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset contexts_cmd to \"\n\tselect 'CONTEXTS', count(*) from context;\n\tselect '    Active contexts', count(*) from context where (effectiveActive=1) and (allowsNextAction=1);\n\tselect '    On-hold contexts', count(*) from context where (effectiveActive=1) and allowsNextAction=0;\n\tselect '    Dropped contexts', count(*) from context where effectiveActive=0;\n\tselect null;\n\t\"\n\tset groups_cmd to \"\n\tselect 'ACTION GROUPS', count(*) from task where (projectinfo is null) and (childrenCount>0);\n\tselect '    Remaining action groups', count(*) from task where (projectinfo is null) and (dateCompleted is null) and (childrenCount>0);\n\tselect '    Completed action groups', count(dateCompleted) from task where (projectinfo is null) and (childrenCount>0);\n\tselect null;\n\t\"\n\tset actions_cmd to \"\n\tselect 'ACTIONS', count(*) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Completed actions', count(dateCompleted) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Dropped project actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp where (projectinfo is null) and (childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is not null and (tp.status='dropped' or tp.folderEffectiveActive=0));\n\tselect '    Dropped context actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand c.effectiveActive= 0;\n\tselect '    Remaining actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1);\n\tselect '        Actions in Projects on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is not null and tp.status='inactive');\n\tselect '        Actions in Contexts on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is not null and c.allowsNextAction=0);\n\tselect '        Blocked actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1;\n\tselect '        \tBlocked by future start date', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=1;\n\tselect '        \tSequentially blocked', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=0;\n\tselect '        Available actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=0;\n\tselect null;\n\t\"\n\tset commands to inbox_cmd & folders_cmd & projects_cmd & lists_cmd & contexts_cmd & groups_cmd & actions_cmd\n\tset strCmd to \"sqlite3 -separator ': ' \\\"\" & pstrDBPath & \"\\\" \" & quoted form of (commands)\n\t\n\t-- \t\ttry\n\tset strList to do shell script strCmd\n\t-- \t\ton error\n\t-- \t\t\tdisplay dialog \"The SQL schema for the OmniFocus cache may have changed in a recent update of OF.\" & return & return & \n\t-- \t\t\t\t\"Look on the OmniFocus user forums for an updated version of this script.\" buttons {\"OK\"} with title pTitle & \"Ver. \" & pVersion\n\t-- \t\t\treturn\n\t-- \t\tend try\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tif button returned of (display dialog strList buttons {pToClipboard, \"OK\"} default button \"OK\" giving up after pTimeOut with title pTitle & \" Ver. \" & pVersion) \n\t\t\tis pToClipboard then tell application id \"com.apple.finder\" to set the clipboard to strList\n\tend tell\nelse\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tdisplay dialog \"OmniFocus cache not found ...\" buttons {\"OK\"} default button 1 with title pTitle & \" Ver. \" & pVersion\n\tend tell\nend if\n\n\non FileExists(strPath)\n\t(do shell script \"test -e \" & strPath & \" ; echo $?\") = \"0\"\nend FileExists\n\non GetCachePath()\n\ttry\n\t\ttell application \"Finder\" to tell (application file id \"OFOC\") to \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/\" & its id & \"\/OmniFocusDatabase2\"\n\ton error\n\t\terror \"OmniFocus not installed ...\"\n\tend try\nend GetCachePath\n\n","new_contents":"property pTitle : \"OmniFocus: Quick Stats\"\nproperty pVersion : \"2.07.brett\"\n\nproperty pstrDBPath : \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/com.omnigroup.OmniFocus\/OmniFocusDatabase2\"\nproperty pstrMinOSX : \"10.9\"\n\nproperty pTimeOut : 20\n\n-- Original version: https:\/\/github.com\/RobTrew\/tree-tools\/blob\/master\/OmniFocus%20scripts\/Statistics\/QuickStats.applescript\n\n-- Copyright  2012, 2013, 2014 Robin Trew\n-- \n-- Permission is hereby granted, free of charge, \n-- to any person obtaining a copy of this software \n-- and associated documentation files (the \"Software\"), \n-- to deal in the Software without restriction, \n-- including without limitation the rights to use, copy, \n-- modify, merge, publish, distribute, sublicense, \n-- and\/or sell copies of the Software, and to permit persons \n-- to whom the Software is furnished to do so, \n-- subject to the following conditions:\n-- \n-- *******\n-- The above copyright notice and this permission notice \n-- shall be included in ALL copies \n-- or substantial portions of the Software.\n-- *******\n-- \n-- THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, \n-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES \n-- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \n-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \n-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, \n-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE \n-- OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n-- Ver 0.8 adds clipboard option to dialogue\n-- Ver 0.9 gives an error message if the cache schema has changed, leading to an SQL error in the script\n-- Ver 1.0 slight simplification of the code\n-- Ver 1.1 added count of Pending projects\n-- Ver 1.2 added a count of available actions\n-- Ver 1.3 added a break-down of unavailable actions\n-- Ver 1.4 added count of Current projects to complement Pending projects\n-- ver 1.5 replaced Applescript time function with SQL time expression\n-- Ver 1.7 Reorganizes menu, and attempts to enable access for .macappstore installations of OF\n--Ver 1.8 Adjusts handling of variant bundle identifiers generally\n-- Ver 2.00 Redraft of task breakdown, with progressive narrowing of criteria ...\n\nproperty pToClipboard : \"Copy list to clipboard\"\n\nif not FileExists(pstrDBPath) then set pstrDBPath to GetCachePath()\n\ntell application \"Finder\"\n\tif (version < pstrMinOSX) then\n\t\tdisplay dialog \"This script requires OSX \" & pstrMinOSX & \" or higher\" buttons {\"OK\"} default button 1 with title pTitle & \"Ver. \" & pVersion\n\t\treturn\n\tend if\nend tell\n\nif pstrDBPath  \"\" then\n\tset inbox_cmd to \"\n\tselect 'INBOX GROUPS & ACTIONS', count(*) from task where (inInbox=1);\n\tselect '    Inbox action groups', count(*) from task where (inInbox=1) and (childrenCount>0);\n\tselect '    Inbox actions', count(*) from task where (inInbox=1) and (childrenCount=0);\n\tselect null;\n\t\"\n\tset folders_cmd to \"\n\tselect 'FOLDERS'\t, count(*) from folder;\n\tselect '    Active folders', count(*) from folder where effectiveActive=1;\n\tselect '    Dropped folders', count(*) from folder where effectiveActive=0;\n\tselect null;\n\t\"\n\tset projects_cmd to \"\n\tselect 'PROJECTS', count(*) from projectInfo where containsSingletonActions=0;\n\tselect '    Active projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='active');\n\tselect '            Current projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart is null or t.dateToStart < (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '            Pending projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart > (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '    On-hold projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='inactive');\n\tselect '    Completed projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='done');\n\tselect '    Dropped projects', count(*) from projectInfo where (containsSingletonActions=0) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset lists_cmd to \"\n\tselect 'SINGLE ACTION LISTS', count(*) from projectInfo where containsSingletonActions=1;\n\tselect '    Active single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='active');\n\tselect '    On-hold single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='inactive');\n\tselect '    Completed single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='done');\n\tselect '    Dropped single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset contexts_cmd to \"\n\tselect 'CONTEXTS', count(*) from context;\n\tselect '    Active contexts', count(*) from context where (effectiveActive=1) and (allowsNextAction=1);\n\tselect '    On-hold contexts', count(*) from context where (effectiveActive=1) and allowsNextAction=0;\n\tselect '    Dropped contexts', count(*) from context where effectiveActive=0;\n\tselect null;\n\t\"\n\tset groups_cmd to \"\n\tselect 'ACTION GROUPS', count(*) from task where (projectinfo is null) and (childrenCount>0);\n\tselect '    Remaining action groups', count(*) from task where (projectinfo is null) and (dateCompleted is null) and (childrenCount>0);\n\tselect '    Completed action groups', count(dateCompleted) from task where (projectinfo is null) and (childrenCount>0);\n\tselect null;\n\t\"\n\tset actions_cmd to \"\n\tselect 'ACTIONS', count(*) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Completed actions', count(dateCompleted) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Dropped project actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp where (projectinfo is null) and (childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is not null and (tp.status='dropped' or tp.folderEffectiveActive=0));\n\tselect '    Dropped context actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand c.effectiveActive= 0;\n\tselect '    Remaining actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1);\n\tselect '        Actions in Projects on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is not null and tp.status='inactive');\n\tselect '        Actions in Contexts on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is not null and c.allowsNextAction=0);\n\tselect '        Blocked actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1;\n\tselect '        \tBlocked by future start date', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=1;\n\tselect '        \tSequentially blocked', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=0;\n\tselect '        Available actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=0;\n\tselect null;\n\t\"\n\tset summary_cmd to \"\n\tselect 'SUMMARY';\n\tselect '    Inbox available actions', count(*) from task where (inInbox=1) and (dateCompleted is null);\n\tselect '    Due in next week', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01');\n\tselect '    Flagged projects and actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand tp.effectiveFlagged;\n\tselect '    Due or Flagged', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand (tp.effectiveFlagged or (effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01')));\n\tselect null;\n\t\"\n\tset commands to inbox_cmd & folders_cmd & projects_cmd & lists_cmd & contexts_cmd & groups_cmd & actions_cmd & summary_cmd\n\tset strCmd to \"sqlite3 -separator ': ' \\\"\" & pstrDBPath & \"\\\" \" & quoted form of (commands)\n\t\n\t-- \t\ttry\n\tset strList to do shell script strCmd\n\t-- \t\ton error\n\t-- \t\t\tdisplay dialog \"The SQL schema for the OmniFocus cache may have changed in a recent update of OF.\" & return & return & \n\t-- \t\t\t\t\"Look on the OmniFocus user forums for an updated version of this script.\" buttons {\"OK\"} with title pTitle & \"Ver. \" & pVersion\n\t-- \t\t\treturn\n\t-- \t\tend try\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tif button returned of (display dialog strList buttons {pToClipboard, \"OK\"} default button \"OK\" giving up after pTimeOut with title pTitle & \" Ver. \" & pVersion) \n\t\t\tis pToClipboard then tell application id \"com.apple.finder\" to set the clipboard to strList\n\tend tell\nelse\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tdisplay dialog \"OmniFocus cache not found ...\" buttons {\"OK\"} default button 1 with title pTitle & \" Ver. \" & pVersion\n\tend tell\nend if\n\n\non FileExists(strPath)\n\t(do shell script \"test -e \" & strPath & \" ; echo $?\") = \"0\"\nend FileExists\n\non GetCachePath()\n\ttry\n\t\ttell application \"Finder\" to tell (application file id \"OFOC\") to \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/\" & its id & \"\/OmniFocusDatabase2\"\n\ton error\n\t\terror \"OmniFocus not installed ...\"\n\tend try\nend GetCachePath\n\n","subject":"add a summary section","message":"add a summary section\n","lang":"AppleScript","license":"apache-2.0","repos":"brettporter\/omnifocus-tools"}
{"commit":"03e79121376c1776653bb1a70180cc1f58ef1324","old_file":"autoload\/applescript\/iterm.scpt","new_file":"autoload\/applescript\/iterm.scpt","old_contents":"-- execute_iterm.scpt\n-- last change: 19 Jan 2013\n---\n-- this script require an argument that represent the command to execute\n\non run argv\n\n    set command to (item 1 of argv)\n    \n    tell application \"iTerm\"\n\n        try\n            set mysession to current session of current terminal\n        on error\n            set myterm to (make new terminal)\n            tell myterm\n                launch session \"Default\"\n                set mysession to current session\n            end tell\n        end try\n\n        -- execute the command\n        tell mysession\n            write text command\n        end tell\n\n    end tell\n\nend run\n","new_contents":"-- execute_iterm.scpt\n-- last change: 19 Jan 2013\n---\n-- this script require an argument that represent the command to execute\n\non run argv\n\n    set command to (item 1 of argv)\n\n    tell application \"iTerm\"\n\n        try\n            set mysession to current session of current terminal\n        on error\n            set myterm to (make new terminal)\n            tell myterm\n                launch session \"rspec\"\n                set mysession to current session\n            end tell\n        end try\n\n        -- execute the command\n        tell mysession\n            write text command\n        end tell\n\n    end tell\n\nend run\n","subject":"Change session name to 'rspec'","message":"Change session name to 'rspec'","lang":"AppleScript","license":"mit","repos":"chautoni\/tube.vim"}
{"commit":"33c600d81ed29d18634ed92dac0f16d9b5f4def1","old_file":"status.applescript","new_file":"status.applescript","old_contents":"tell application \"Finder\"\n\tset json_path to file \"json.scpt\" of folder of (path to me)\nend tell\nset json to load script (json_path as alias)\n\non is_running(appName)\n\ttell application \"System Events\" to (name of processes) contains appName\nend is_running\n\nset nl to \"\n\"\n\nset reply to json's createDict()\nif is_running(\"Hermes\") then\n\treply's setkv(\"running\", true)\n\tset hermesInfo to json's createDict()\n\ttell application \"Hermes\"\n\t\thermesInfo's setkv(\"state\", playback state as string)\n\t\thermesInfo's setkv(\"title\", current song's title)\n\t\thermesInfo's setkv(\"artist\", current song's artist)\n\t\thermesInfo's setkv(\"album\", current song's album)\n\t\thermesInfo's setkv(\"artwork\", current song's artwork URL)\n\t\thermesInfo's setkv(\"rating\", current song's rating)\n\t\thermesInfo's setkv(\"position\", playback position as integer)\n\t\thermesInfo's setkv(\"duration\", current song duration as integer)\n\tend tell\n\treply's setkv(\"info\", hermesInfo)\nelse\n\treply's setkv(\"running\", false)\nend if\nreturn reply's toJson()\n","new_contents":"tell application \"Finder\"\n\tset json_path to file \"json.scpt\" of folder of (path to me)\nend tell\nset json to load script (json_path as alias)\n\non is_running(appName)\n\ttell application \"System Events\" to (name of processes) contains appName\nend is_running\n\nset reply to json's createDict()\nif is_running(\"Hermes\") then\n\treply's setkv(\"running\", true)\n\tset hermesInfo to json's createDict()\n\ttell application \"Hermes\"\n\t\thermesInfo's setkv(\"state\", playback state as string)\n\t\thermesInfo's setkv(\"title\", current song's title)\n\t\thermesInfo's setkv(\"artist\", current song's artist)\n\t\thermesInfo's setkv(\"album\", current song's album)\n\t\thermesInfo's setkv(\"artwork\", current song's artwork URL)\n\t\thermesInfo's setkv(\"rating\", current song's rating)\n\t\thermesInfo's setkv(\"position\", playback position as integer)\n\t\thermesInfo's setkv(\"duration\", current song duration as integer)\n\tend tell\n\treply's setkv(\"info\", hermesInfo)\nelse\n\treply's setkv(\"running\", false)\nend if\nreturn reply's toJson()\n","subject":"remove unused newline variable","message":"remove unused newline variable\n","lang":"AppleScript","license":"mit","repos":"winny-\/HermesRemote,winny-\/HermesRemote"}
{"commit":"a9ec3c8e94c22bdb296970a7f7a4297a80f02d45","old_file":"bin\/viscosity.applescript","new_file":"bin\/viscosity.applescript","old_contents":"#!\/usr\/bin\/osascript\n\ntell application \"Viscosity\"\n  if the state of the first connection is not \"Connected\" then\n    connect the first connection\n\n    repeat until state of the first connection is \"Connected\" \n      delay 1\n    end repeat\n  end if\nend tell\n","new_contents":"#!\/usr\/bin\/osascript\n\ntry\n\ttell application \"Viscosity\"\n\t\tif the state of the first connection is not \"Connected\" then\n\t\t\tconnect the first connection\n\t\t\t\n\t\t\trepeat until state of the first connection is \"Connected\"\n\t\t\t\tdelay 1\n\t\t\tend repeat\n\t\tend if\n\tend tell\non error\n\ttell me to quit\nend try\n\n","subject":"handle viscosity errors more gracefully","message":"handle viscosity errors more gracefully\n","lang":"AppleScript","license":"mit","repos":"kfox\/dotfiles,kfox\/dotfiles,kfox\/dotfiles"}
{"commit":"7624fbc0053bb4f97f1af4e4ef0d826b470cf435","old_file":"lib\/scripts\/get_state.applescript","new_file":"lib\/scripts\/get_state.applescript","old_contents":"tell application \"Spotify\"\n  set cstate to \"{\"\n  set cstate to cstate & \"\\\"track_id\\\": \\\"\" & current track's id & \"\\\"\"\n  set cstate to cstate & \",\\\"volume\\\": \" & sound volume\n  set cstate to cstate & \",\\\"position\\\": \" & player position\n  set cstate to cstate & \",\\\"state\\\": \\\"\" & player state & \"\\\"\"\n  set cstate to cstate & \"}\"\n\n  return cstate\nend tell","new_contents":"on replace_chars(this_text, search_string, replacement_string)\n  set AppleScript's text item delimiters to the search_string\n  set the item_list to every text item of this_text\n  set AppleScript's text item delimiters to the replacement_string\n  set this_text to the item_list as string\n  set AppleScript's text item delimiters to \"\"\n  return this_text\nend replace_chars\n\ntell application \"Spotify\"\n  -- force string coercion and locale format\n  set position to \"\" & player position\n\n  set cstate to \"{\"\n  set cstate to cstate & \"\\\"track_id\\\": \\\"\" & current track's id & \"\\\"\"\n  set cstate to cstate & \",\\\"volume\\\": \" & sound volume\n  -- replace , with . when locale has , as decimal delimiter\n  set cstate to cstate & \",\\\"position\\\": \" & my replace_chars(position, \",\", \".\")\n  set cstate to cstate & \",\\\"state\\\": \\\"\" & player state & \"\\\"\"\n  set cstate to cstate & \"}\"\n\n  return cstate\nend tell\n","subject":"Fix get state for locales that have commas as decimal delimiters","message":"Fix get state for locales that have commas as decimal delimiters\n\nWhen your current set locale uses \",\" as decimal delimiter, AppleScript\nwill automatically use this when you convert the number to a string. This\nwill break the JSON parsing for the callback, as \",\" is invalid when not\nin quotes.\n","lang":"AppleScript","license":"mit","repos":"andrehaveman\/spotify-node-applescript"}
{"commit":"c7f2827b9a9923cf0ce0e07e6762feb40c67941e","old_file":"Filterer.applescript","new_file":"Filterer.applescript","old_contents":"on run\n\ttell application \"BibDesk\"\n\t\ttry\n\t\t\tset alertResult to display alert (\"Really remove all linked files and private notes from \" & name of first document as string) & \"?\" buttons {\"Cancel\", \"OK\"} default button \"OK\" cancel button \"Cancel\" as warning\n\t\t\t\n\t\t\tif button returned of alertResult is \"OK\" then\n\t\t\t\tsave first document in \"Filtered \" & (name of first document as string) & \".bib\"\n\t\t\t\trepeat with thePub in first document's publications\n\t\t\t\t\tset thePub's note to my splitNote(thePub's note)\n\t\t\t\t\trepeat with theFile in thePub's linked files\n\t\t\t\t\t\tremove theFile from thePub\n\t\t\t\t\tend repeat\n\t\t\t\tend repeat\n\t\t\t\tsave first document\n\t\t\tend if\n\t\ton error -128\n\t\t\tdisplay dialog \"User cancelled.\"\n\t\tend try\n\tend tell\nend run\n\nto splitNote(theNoteText)\n\ttry\n\t\tset oldDelims to AppleScript's text item delimiters\n\t\tset AppleScript's text item delimiters to {\"---\"}\n\t\t\n\t\tset theParts to every text item of theNoteText\n\t\t\n\t\tif length of theParts is greater than 1 then\n\t\t\tset outText to text 2 through end of last item of theParts\n\t\telse\n\t\t\tset outText to \"\"\n\t\tend if\n\t\tset AppleScript's text item delimiters to oldDelims\n\ton error\n\t\tset AppleScript's text item delimiters to oldDelims\n\tend try\n\treturn outText\nend splitNote","new_contents":"on run\n\ttell application \"BibDesk\"\n\t\ttry\n\t\t\tset alertResult to display alert (\"Really remove all linked files and private notes from \" & name of first document as string) & \"?\" buttons {\"Cancel\", \"OK\"} default button \"OK\" cancel button \"Cancel\" as warning\n\t\t\t\n\t\t\tif button returned of alertResult is \"OK\" then\n\t\t\t\tset theDocument to first document\n\t\t\t\t\n\t\t\t\tsave theDocument\n\t\t\t\t\n\t\t\t\tset theFile to (theDocument's file) as alias\n\t\t\t\t\n\t\t\t\ttell application \"Finder\"\n\t\t\t\t\tset theContainer to (container of theFile) as alias\n\t\t\t\t\tset newFile to make new file with properties {container:theFile, name:\"Filtered \" & ((name of theDocument) as string)}\n\t\t\t\tend tell\n\t\t\t\treturn\n\t\t\t\t\n\t\t\t\tsave first document in (newFile as file)\n\t\t\t\trepeat with thePub in first document's publications\n\t\t\t\t\tset thePub's note to my splitNote(thePub's note)\n\t\t\t\t\trepeat with theFile in thePub's linked files\n\t\t\t\t\t\tremove theFile from thePub\n\t\t\t\t\tend repeat\n\t\t\t\tend repeat\n\t\t\t\tsave first document\n\t\t\tend if\n\t\ton error -128\n\t\t\tdisplay dialog \"User cancelled.\"\n\t\tend try\n\tend tell\nend run\n\nto splitNote(theNoteText)\n\ttry\n\t\tset oldDelims to AppleScript's text item delimiters\n\t\tset AppleScript's text item delimiters to {\"---\"}\n\t\t\n\t\tset theParts to every text item of theNoteText\n\t\t\n\t\tif length of theParts is greater than 1 then\n\t\t\tset outText to (text 2 through end) of last item of theParts\n\t\telse\n\t\t\tset outText to \"\"\n\t\tend if\n\t\tset AppleScript's text item delimiters to oldDelims\n\ton error\n\t\tset AppleScript's text item delimiters to oldDelims\n\tend try\n\treturn outText\nend splitNote","subject":"Simplify filterer code so it actually works.","message":"Simplify filterer code so it actually works.\n","lang":"AppleScript","license":"mit","repos":"kurtraschke\/htmlbib,kurtraschke\/htmlbib"}
{"commit":"8caa4cba5542dfb477b6fa61daef1d8a63e01b78","old_file":"itunes-concatenator\/itunes-concatenator\/DASAppDelegate.applescript","new_file":"itunes-concatenator\/itunes-concatenator\/DASAppDelegate.applescript","old_contents":"--\n--  DASAppDelegate.applescript\n--  itunes-concatenator\n--\n--  Created by David Schlachter on 2014-08-26.\n--  Copyright (c) 2014 Red Eft Software. All rights reserved.\n--\n\n-- via http:\/\/macscripter.net\/viewtopic.php?pid=173787 ; apparently needed for using arrays\n\nscript DASAppDelegate\n\tproperty parent : class \"NSObject\"\n\t\n    global these_files, these_times, these_titles, the_index, the_pipes, theCounter, cmdPrefix\n    \n\t-- IBOutlets\n\tproperty window : missing value\n    property trackTable : missing value\n    property catName : missing value\n    property catArtist : missing value\n    property catAlbum : missing value\n    property catComposer : missing value\n    property catGenre : missing value\n    property catTrack : missing value\n    property catTracks : missing value\n    property catDisc : missing value\n    property catDiscs : missing value\n    \n    -- Again, per macscripter, we'll set up bindings for the options\n    property pcatName : \"\"\n    property pcatArtist : \"\"\n    property pcatAlbum : \"\"\n    property pcatComposer : \"\"\n    property pcatGenre : \"\"\n    property pcatTrack : \"\"\n    property pcatTracks : \"\"\n    property pcatDisc : \"\"\n    property pcatDiscs : \"\"\n    \n    -- Empty strings for each file name and location\n    property pEachName : \"\"\n    property pEachLocation : \"\"\n    \n    property these_titles : {}\n    property these_files : {}\n    property these_times: {}\n    property the_index: {}\n    property the_pipes: {}\n    \n    property theCounter : \"\"\n    property cmdPrefix : \"if [[ -r \/etc\/profile ]];then . \/etc\/profile;fi;if [[ -r ~\/.bashrc ]];then . ~\/.bashrc;fi;if [[ -r ~\/.bash_profile ]];then . ~\/.bash_profile;fi;\"\n    \n    on awakeFromNib()\n        --\n        -- Check for FFMPEG and MP4v2\n        --\n        -- (This works, but it's ugly!)\n        --\n        --\n        try\n            do shell script cmdPrefix & \" if [ -x \\\"`\/usr\/bin\/which ffmpeg`\\\" ];then exit 0;else exit 1;fi\"\n        on error number error_number\n            display dialog \"You must install FFMPEG and MP4v2 to continue. \\n\\nYou may have to install Xcode Command Line Tools and Homebrew first. If you continue, we'll attempt to install them for you if they are not already present. \\n\\nIf you have already installed FFMPEG and MP4v2, ensure that they are in your bash path.\" buttons {\"Quit\",\"Install\"} default button 2\n            If button returned of result is \"Install\" then\n                try\n                    tell application \"Terminal\"\n                        -- TODO: This should be cleaner -- Terminal in front, only one window, focus back to the cat'er afterwards\n                        set newTab to do script cmdPrefix & \"if [[ -x `which brew` ]];then brew install ffmpeg;else \/usr\/bin\/ruby -e \\\"$(\/usr\/bin\/curl -fsSL https:\/\/raw.github.com\/Homebrew\/homebrew\/go\/install)\\\";brew install ffmpeg mp4v2;fi\"\n                        delay 4\n                        repeat\n                            delay 0.1\n                            if not busy of newTab then exit repeat\n                        end repeat\n                    end tell\n                     -- TODO: This needs a better test, i.e., check if ffmpeg is actually accessible on the path\n                    display dialog \"FFMPEG was successfully installed\"\n                    -- TODO: This should actually work! (Bring us back to the foreground)\n                    activate current application\n                on error number error_number\n                    display dialog \"FFMPEG did not successfully install\"\n                end try\n            end If\n            If button returned of result is \"Quit\" then\n                -- Fix!\n                current application's NSApp's terminate()\n            end If\n        end try\n    end awakeFromNib\n\n\n    on btnGetTracks_(sender)\n        -- Code to add iTunes tracks to our list\n        -- via http:\/\/dougscripts.com\/itunes\/itinfo\/info02.php and http:\/\/www.randomsequence.com\/articles\/applescript-to-send-selected-itunes-tracks-using-mail\/\n        tell application \"iTunes\"\n            set these_titles to {}\n            set these_times to {}\n            set these_files to {}\n            set the_index to {}\n            if selection is not {} then -- there ARE tracks selected...\n                set mySelection to selection\n                set i to 1\n                repeat with aTrack in mySelection\n                    if class of aTrack is file track then\n                        set end of these_titles to ((name of aTrack) as string)\n                        set end of these_times to ((time of aTrack) as string)\n                        set end of these_files to (posix path of (get location of aTrack))\n                        set end of the_index to (count of these_titles)\n                        -- Get metadata from the first track\n                        if i is 1 then\n                            set pcatArtist to ((artist of aTrack) as string)\n                            set pcatAlbum to ((album of aTrack) as string)\n                            set pcatComposer to ((composer of aTrack) as string)\n                            set pcatGenre to ((genre of aTrack) as string)\n                            set pcatDisc to ((disc number of aTrack) as string)\n                            set pcatDiscs to ((disc count of aTrack) as string)\n                        end if\n                        set i to (i + 1)\n                    end if\n                end repeat\n            end if\n        end tell\n        -- Display the songs to be concatenated\n        -- via http:\/\/stackoverflow.com\/questions\/25537750\/setstringvalue-with-applescript-list\n        set olddelimeters to AppleScript's text item delimiters\n        set AppleScript's text item delimiters to \"\\n\"\n        set disp_titles to these_titles as string\n        trackTable's setStringValue_(disp_titles)\n        set AppleScript's text item delimiters to olddelimeters\n        -- Update the default metadata\n        catArtist's setStringValue_(pcatArtist)\n        catAlbum's setStringValue_(pcatAlbum)\n        catComposer's setStringValue_(pcatComposer)\n        catGenre's setStringValue_(pcatGenre)\n        catDisc's setStringValue_(pcatDisc)\n        catDiscs's setStringValue_(pcatDiscs)\n    end btnGetTracks_\n\n    on btnConcatenate_(sender)\n        set the_pipes to {}\n        repeat with theIndex in the_index\n            -- TODO: Needs error checking!\n            -- TODO: We need to check what kind of audio files we have, then adjust accordingly\n            do shell script (cmdPrefix & \"ffmpeg -i \\\"\" & (item theIndex of these_files as text) & \"\\\" -c copy -bsf:v h264_mp4toannexb -f mpegts \/private\/tmp\/concat\" & theIndex & \".ts 2> \/dev\/null\" as text)\n            log (\"Processed file number\" & theIndex) as text\n            set end of the_pipes to (\"\/private\/tmp\/concat\" & theIndex & \".ts\" as text)\n        end repeat\n        -- Run the actual concatenation command in ffmpeg (for mp4\/AAC files only!)\n        -- via https:\/\/trac.ffmpeg.org\/wiki\/How%20to%20concatenate%20(join,%20merge)%20media%20files\n        set olddelimeters to AppleScript's text item delimiters\n        set AppleScript's text item delimiters to \"|\"\n        set disp_thepipes to the_pipes as string\n        do shell script (cmdPrefix & \"ffmpeg -f mpegts -i \\\"concat:\" & (disp_thepipes as text) & \"\\\" -c copy -bsf:a aac_adtstoasc \/private\/tmp\/cat.mp4\")\n        set AppleScript's text item delimiters to olddelimeters\n        -- Log some debugging information\n        log (pcatArtist as string)\n        log (pcatAlbum as string)\n        log (pcatComposer as string)\n        log (pcatGenre as string)\n        log (pcatDisc as string)\n        log (pcatDiscs as string)\n        -- Now let's create the chapter file\n        repeat with theIndex in the_index\n            if theIndex < 2 then\n                do shell script (\"\/bin\/echo \\\"00:00:00.000 \" & (item theIndex of these_titles as text) & \"\\\" > \/private\/tmp\/cat.chapters.txt\" as text)\n                set theCounter to (do shell script (cmdPrefix & \"ffprobe -loglevel panic -show_streams \/private\/tmp\/concat\" & (theIndex as text) & \".ts | egrep -m 1 'duration=[0-9]+\\\\.' | sed 's\/duration=\\\\([0-9]*[0-9]\\\\)\\\\.[0-9]*\/\\\\1\/'\" as text) as string)\n            else\n                set theDateStamp to do shell script (cmdPrefix & \"t=\"& (theCounter as text) & \";((sec=t%60, t\/=60, min=t%60, hrs=t\/60));timestamp=$(printf \\\"%02d:%02d:%02d\\\" $hrs $min $sec);\/bin\/echo $timestamp\" as text)\n                do shell script (\"\/bin\/echo \\\"\" & (theDateStamp as text) & \".000 \" & (item theIndex of these_titles as text) & \"\\\" >> \/private\/tmp\/cat.chapters.txt\" as text)\n                log (\"Before the addition, theCounter is \" & theCounter) as text\n                set theCounter to do shell script (cmdPrefix & \"t=\" & theCounter & \";t=`echo $t\\\"+\\\\`ffprobe -loglevel panic -show_streams \/private\/tmp\/concat\" & (theIndex as text) & \".ts | egrep -m 1 'duration=[0-9]+\\\\.' | sed 's\/duration=\\\\([0-9]*[0-9]\\\\)\\\\.[0-9]*\/\\\\1\/'\\\\`\\\" | bc`;echo $t\" as text)\n                log (\"After the addition, theCounter is \" & theCounter) as text\n            end if\n        end repeat\n        -- Chapterize cat.mp4\n        do shell script (cmdPrefix & \"mp4chaps -i \/private\/tmp\/cat.mp4\" as text)\n        -- Clean up\n        do shell script \"\/bin\/rm \/private\/tmp\/concat* \/private\/tmp\/cat.chapters.txt \/private\/tmp\/cat.mp4\"\n        set theCounter to \"\"\n    end btnConcatenate_\n\n\n\ton applicationWillFinishLaunching_(aNotification)\n\t\t-- Insert code here to initialize your application before any files are opened\n\tend applicationWillFinishLaunching_\n\n\ton applicationShouldTerminate_(sender)\n\t\t-- Insert code here to do any housekeeping before your application quits\n\t\treturn current application's NSTerminateNow\n\tend applicationShouldTerminate_\n\nend script","new_contents":"--\n--  DASAppDelegate.applescript\n--  itunes-concatenator\n--\n--  Created by David Schlachter on 2014-08-26.\n--  Copyright (c) 2014 Red Eft Software. All rights reserved.\n--\n\n-- via http:\/\/macscripter.net\/viewtopic.php?pid=173787 ; apparently needed for using arrays\n\nscript DASAppDelegate\n\tproperty parent : class \"NSObject\"\n\t\n    global these_files, these_times, these_titles, the_index, the_pipes, theCounter, cmdPrefix\n    \n\t-- IBOutlets\n\tproperty window : missing value\n    property trackTable : missing value\n    property catName : missing value\n    property catArtist : missing value\n    property catAlbum : missing value\n    property catComposer : missing value\n    property catGenre : missing value\n    property catTrack : missing value\n    property catTracks : missing value\n    property catDisc : missing value\n    property catDiscs : missing value\n    \n    -- Again, per macscripter, we'll set up bindings for the options\n    property pcatName : \"\"\n    property pcatArtist : \"\"\n    property pcatAlbum : \"\"\n    property pcatComposer : \"\"\n    property pcatGenre : \"\"\n    property pcatTrack : \"\"\n    property pcatTracks : \"\"\n    property pcatDisc : \"\"\n    property pcatDiscs : \"\"\n    \n    -- Empty strings for each file name and location\n    property pEachName : \"\"\n    property pEachLocation : \"\"\n    \n    property these_titles : {}\n    property these_files : {}\n    property these_times: {}\n    property the_index: {}\n    property the_pipes: {}\n    \n    property theCounter : \"\"\n    property cmdPrefix : \"if [[ -r \/etc\/profile ]];then . \/etc\/profile;fi;if [[ -r ~\/.bashrc ]];then . ~\/.bashrc;fi;if [[ -r ~\/.bash_profile ]];then . ~\/.bash_profile;fi;\"\n    \n    on awakeFromNib()\n        --\n        -- Check for FFMPEG and MP4v2\n        --\n        -- (This works, but it's ugly!)\n        --\n        --\n        try\n            do shell script cmdPrefix & \" if [ -x \\\"`\/usr\/bin\/which ffmpeg`\\\" ];then exit 0;else exit 1;fi\"\n        on error number error_number\n            display dialog \"You must install FFMPEG and MP4v2 to continue. \\n\\nYou may have to install Xcode Command Line Tools and Homebrew first. If you continue, we'll attempt to install them for you if they are not already present. \\n\\nIf you have already installed FFMPEG and MP4v2, ensure that they are in your bash path.\" buttons {\"Quit\",\"Install\"} default button 2\n            If button returned of result is \"Install\" then\n                try\n                    tell application \"Terminal\"\n                        -- TODO: This should be cleaner -- Terminal in front, only one window, focus back to the cat'er afterwards\n                        set newTab to do script cmdPrefix & \"if [[ -x `which brew` ]];then brew install ffmpeg;else \/usr\/bin\/ruby -e \\\"$(\/usr\/bin\/curl -fsSL https:\/\/raw.github.com\/Homebrew\/homebrew\/go\/install)\\\";brew install ffmpeg mp4v2;fi\"\n                        delay 4\n                        repeat\n                            delay 0.1\n                            if not busy of newTab then exit repeat\n                        end repeat\n                    end tell\n                     -- TODO: This needs a better test, i.e., check if ffmpeg is actually accessible on the path\n                    display dialog \"FFMPEG was successfully installed\"\n                    -- TODO: This should actually work! (Bring us back to the foreground)\n                    activate current application\n                on error number error_number\n                    display dialog \"FFMPEG did not successfully install\"\n                end try\n            end If\n            If button returned of result is \"Quit\" then\n                -- Fix!\n                current application's NSApp's terminate()\n            end If\n        end try\n    end awakeFromNib\n\n\n    on btnGetTracks_(sender)\n        -- Code to add iTunes tracks to our list\n        -- via http:\/\/dougscripts.com\/itunes\/itinfo\/info02.php and http:\/\/www.randomsequence.com\/articles\/applescript-to-send-selected-itunes-tracks-using-mail\/\n        tell application \"iTunes\"\n            set these_titles to {}\n            set these_times to {}\n            set these_files to {}\n            set the_index to {}\n            if selection is not {} then -- there ARE tracks selected...\n                set mySelection to selection\n                set i to 1\n                repeat with aTrack in mySelection\n                    if class of aTrack is file track then\n                        set end of these_titles to ((name of aTrack) as string)\n                        set end of these_times to ((time of aTrack) as string)\n                        set end of these_files to (posix path of (get location of aTrack))\n                        set end of the_index to (count of these_titles)\n                        -- Get metadata from the first track\n                        if i is 1 then\n                            set pcatArtist to ((artist of aTrack) as string)\n                            set pcatAlbum to ((album of aTrack) as string)\n                            set pcatComposer to ((composer of aTrack) as string)\n                            set pcatGenre to ((genre of aTrack) as string)\n                            set pcatDisc to ((disc number of aTrack) as string)\n                            set pcatDiscs to ((disc count of aTrack) as string)\n                        end if\n                        set i to (i + 1)\n                    end if\n                end repeat\n            end if\n        end tell\n        -- Display the songs to be concatenated\n        -- via http:\/\/stackoverflow.com\/questions\/25537750\/setstringvalue-with-applescript-list\n        set olddelimeters to AppleScript's text item delimiters\n        set AppleScript's text item delimiters to \"\\n\"\n        set disp_titles to these_titles as string\n        trackTable's setStringValue_(disp_titles)\n        set AppleScript's text item delimiters to olddelimeters\n        -- Update the default metadata\n        catArtist's setStringValue_(pcatArtist)\n        catAlbum's setStringValue_(pcatAlbum)\n        catComposer's setStringValue_(pcatComposer)\n        catGenre's setStringValue_(pcatGenre)\n        catDisc's setStringValue_(pcatDisc)\n        catDiscs's setStringValue_(pcatDiscs)\n    end btnGetTracks_\n\n    on btnConcatenate_(sender)\n        -- Update the metadata variables with the user's input\n        set pcatArtist to catArtist's stringValue()\n        set pcatAlbum to catAlbum's stringValue()\n        set pcatComposer to catComposer's stringValue()\n        set pcatGenre to catGenre's stringValue()\n        set pcatTrack to catTrack's stringValue()\n        set pcatTracks to catTracks's stringValue()\n        set pcatDisc to catDisc's stringValue()\n        set pcatDiscs to catDiscs's stringValue()\n        set the_pipes to {}\n        repeat with theIndex in the_index\n            -- TODO: Needs error checking!\n            -- TODO: We need to check what kind of audio files we have, then adjust accordingly\n            do shell script (cmdPrefix & \"ffmpeg -i \\\"\" & (item theIndex of these_files as text) & \"\\\" -c copy -bsf:v h264_mp4toannexb -f mpegts \/private\/tmp\/concat\" & theIndex & \".ts 2> \/dev\/null\" as text)\n            log (\"Processed file number\" & theIndex) as text\n            set end of the_pipes to (\"\/private\/tmp\/concat\" & theIndex & \".ts\" as text)\n        end repeat\n        -- Run the actual concatenation command in ffmpeg (for mp4\/AAC files only!)\n        -- via https:\/\/trac.ffmpeg.org\/wiki\/How%20to%20concatenate%20(join,%20merge)%20media%20files\n        set olddelimeters to AppleScript's text item delimiters\n        set AppleScript's text item delimiters to \"|\"\n        set disp_thepipes to the_pipes as string\n        do shell script (cmdPrefix & \"ffmpeg -f mpegts -i \\\"concat:\" & (disp_thepipes as text) & \"\\\" -c copy -bsf:a aac_adtstoasc \/private\/tmp\/cat.mp4\")\n        set AppleScript's text item delimiters to olddelimeters\n        -- Now let's create the chapter file\n        repeat with theIndex in the_index\n            if theIndex < 2 then\n                do shell script (\"\/bin\/echo \\\"00:00:00.000 \" & (item theIndex of these_titles as text) & \"\\\" > \/private\/tmp\/cat.chapters.txt\" as text)\n                set theCounter to (do shell script (cmdPrefix & \"ffprobe -loglevel panic -show_streams \/private\/tmp\/concat\" & (theIndex as text) & \".ts | egrep -m 1 'duration=[0-9]+\\\\.' | sed 's\/duration=\\\\([0-9]*[0-9]\\\\)\\\\.[0-9]*\/\\\\1\/'\" as text) as string)\n            else\n                set theDateStamp to do shell script (cmdPrefix & \"t=\"& (theCounter as text) & \";((sec=t%60, t\/=60, min=t%60, hrs=t\/60));timestamp=$(printf \\\"%02d:%02d:%02d\\\" $hrs $min $sec);\/bin\/echo $timestamp\" as text)\n                do shell script (\"\/bin\/echo \\\"\" & (theDateStamp as text) & \".000 \" & (item theIndex of these_titles as text) & \"\\\" >> \/private\/tmp\/cat.chapters.txt\" as text)\n                log (\"Before the addition, theCounter is \" & theCounter) as text\n                set theCounter to do shell script (cmdPrefix & \"t=\" & theCounter & \";t=`echo $t\\\"+\\\\`ffprobe -loglevel panic -show_streams \/private\/tmp\/concat\" & (theIndex as text) & \".ts | egrep -m 1 'duration=[0-9]+\\\\.' | sed 's\/duration=\\\\([0-9]*[0-9]\\\\)\\\\.[0-9]*\/\\\\1\/'\\\\`\\\" | bc`;echo $t\" as text)\n                log (\"After the addition, theCounter is \" & theCounter) as text\n            end if\n        end repeat\n        -- Chapterize cat.mp4\n        do shell script (cmdPrefix & \"mp4chaps -i \/private\/tmp\/cat.mp4\" as text)\n        -- Clean up\n        do shell script \"\/bin\/rm \/private\/tmp\/concat* \/private\/tmp\/cat.chapters.txt \/private\/tmp\/cat.mp4\"\n        set theCounter to \"\"\n    end btnConcatenate_\n\n\n\ton applicationWillFinishLaunching_(aNotification)\n\t\t-- Insert code here to initialize your application before any files are opened\n\tend applicationWillFinishLaunching_\n\n\ton applicationShouldTerminate_(sender)\n\t\t-- Insert code here to do any housekeeping before your application quits\n\t\treturn current application's NSTerminateNow\n\tend applicationShouldTerminate_\n\nend script","subject":"Update the metadata variables from user input","message":"Update the metadata variables from user input\n","lang":"AppleScript","license":"bsd-2-clause","repos":"davidschlachter\/itunes-concatenator,davidschlachter\/itunes-concatenator"}
{"commit":"f26210bedca6c0696988d55564d89da2a6932fe9","old_file":"Extras\/GrowlAction\/main.applescript","new_file":"Extras\/GrowlAction\/main.applescript","old_contents":"-- main.applescript\n-- GrowlAction\n\non run {input_items, parameters}\n\tset the output_items to {}\n\tset the notification_title to (|notificationTitle| of parameters) as string\n\tset the notification_description to (|notificationDescription| of parameters) as string\n\tset the notification_priority to (priority of parameters) as integer\n\tset the notification_sticky to (sticky of parameters) as boolean\n\ttell application \"GrowlHelperApp\"\n\t\tregister as application \"Automator\" all notifications {\"Automator notification\"} default notifications {\"Automator notification\"}\n\t\tnotify with name \"Automator notification\" title notification_title description notification_description application name \"Automator\" sticky notification_sticky priority notification_priority\n\tend tell\n\treturn input_items\nend run\n\non localized_string(key_string)\n\treturn localized string key_string in bundle with identifier \"com.growl.GrowlAction\"\nend localized_string\n","new_contents":"-- main.applescript\n-- GrowlAction\n\non run {input_items, parameters}\n\tset the output_items to {}\n\tset the notification_title to (|notificationTitle| of parameters) as string\n\tset the notification_description to (|notificationDescription| of parameters) as string\n\tset the notification_priority to (priority of parameters) as integer\n\tset the notification_sticky to (sticky of parameters) as boolean\n\ttell application \"GrowlHelperApp\"\n\t\tregister as application \"Automator\" all notifications {\"Automator notification\"} default notifications {\"Automator notification\"}\n\t\tnotify with name \"Automator notification\" title notification_title description notification_description application name \"Automator\" sticky notification_sticky priority notification_priority\n\tend tell\n\treturn input_items\nend run\n","subject":"Fix the Automator action. The ?in bundle with identifier? parameter doesn't exist on my 10.5.5 machine (for some reason, even though the AppleScript Studio Release Notes claim it has since Tiger), which breaks compilation of the action's main script. We don't call the function that uses that phantom parameter, anyway, so I fixed the problem by simply axing the function.","message":"Fix the Automator action. The ?in bundle with identifier? parameter doesn't exist on my 10.5.5 machine (for some reason, even though the AppleScript Studio Release Notes claim it has since Tiger), which breaks compilation of the action's main script. We don't call the function that uses that phantom parameter, anyway, so I fixed the problem by simply axing the function.\n","lang":"AppleScript","license":"bsd-3-clause","repos":"timbck2\/growl,timbck2\/growl,coltonfisher\/coltonfisher-growl,Shalaco\/shalzers-growl,chashion\/growl,morganestes\/morganestes-growl,Shalaco\/shalzers-growl,an0nym0u5\/growl,nochkin\/growl,nochkin\/growl,nagyistoce\/growl,coltonfisher\/coltonfisher-growl,xhruso00\/growl,nagyistoce\/growl,morganestes\/morganestes-growl,nochkin\/growl,SalrJupiter\/growl,Shalaco\/shalzers-growl,coltonfisher\/coltonfisher-growl,ylian\/growl,CarlosCD\/growl,nkhorman\/archive-growl,Shalaco\/shalzers-growl,ylian\/growl,nagyistoce\/growl,nagyistoce\/growl,nagyistoce\/growl,tectronics\/growl,chashion\/growl,an0nym0u5\/growl,ylian\/growl,an0nym0u5\/growl,nkhorman\/archive-growl,SalrJupiter\/growl,timbck2\/growl,ylian\/growl,Shalaco\/shalzers-growl,tectronics\/growl,nochkin\/growl,nagyistoce\/growl,chashion\/growl,coltonfisher\/coltonfisher-growl,SalrJupiter\/growl,Shalaco\/shalzers-growl,coltonfisher\/coltonfisher-growl,Shalaco\/shalzers-growl,xhruso00\/growl,doshinirav\/doshinirav-myversion,doshinirav\/doshinirav-myversion,CarlosCD\/growl,nkhorman\/archive-growl,morganestes\/morganestes-growl,Shalaco\/shalzers-growl,morganestes\/morganestes-growl,SalrJupiter\/growl,Shalaco\/shalzers-growl,doshinirav\/doshinirav-myversion,tectronics\/growl,morganestes\/morganestes-growl,CarlosCD\/growl,CarlosCD\/growl,morganestes\/morganestes-growl,timbck2\/growl,xhruso00\/growl,coltonfisher\/coltonfisher-growl,coltonfisher\/coltonfisher-growl,SalrJupiter\/growl,ylian\/growl,timbck2\/growl,nkhorman\/archive-growl,Shalaco\/shalzers-growl,doshinirav\/doshinirav-myversion,Shalaco\/shalzers-growl,SalrJupiter\/growl,an0nym0u5\/growl,tectronics\/growl,xhruso00\/growl,xhruso00\/growl,tectronics\/growl,tectronics\/growl,nochkin\/growl,CarlosCD\/growl,doshinirav\/doshinirav-myversion,ylian\/growl,timbck2\/growl,chashion\/growl,chashion\/growl,chashion\/growl,nkhorman\/archive-growl,doshinirav\/doshinirav-myversion,nochkin\/growl,an0nym0u5\/growl,doshinirav\/doshinirav-myversion,an0nym0u5\/growl,CarlosCD\/growl,nkhorman\/archive-growl,CarlosCD\/growl,xhruso00\/growl"}
{"commit":"913f8dea1b8fc2b131ac03808701f47c5bd80868","old_file":"Extras\/GrowlAction\/main.applescript","new_file":"Extras\/GrowlAction\/main.applescript","old_contents":"-- main.applescript\n-- GrowlAction\n\non run {input_items, parameters}\n\tset the output_items to {}\n\tset the notification_title to (|notificationTitle| of parameters) as string\n\tset the notification_description to (|notificationDescription| of parameters) as string\n\tset the notification_priority to (priority of parameters) as integer\n\tset the notification_sticky to (sticky of parameters) as boolean\n\ttell application \"GrowlHelperApp\"\n\t\tregister as application \"Automator\" all notifications {\"Automator notification\"} default notifications {\"Automator notification\"}\n\t\tnotify with name \"Automator notification\" title notification_title description notification_description application name \"Automator\" sticky notification_sticky priority notification_priority\n\tend tell\n\treturn input_items\nend run\n\non localized_string(key_string)\n\treturn localized string key_string in bundle with identifier \"com.growl.GrowlAction\"\nend localized_string\n","new_contents":"-- main.applescript\n-- GrowlAction\n\non run {input_items, parameters}\n\tset the output_items to {}\n\tset the notification_title to (|notificationTitle| of parameters) as string\n\tset the notification_description to (|notificationDescription| of parameters) as string\n\tset the notification_priority to (priority of parameters) as integer\n\tset the notification_sticky to (sticky of parameters) as boolean\n\ttell application \"GrowlHelperApp\"\n\t\tregister as application \"Automator\" all notifications {\"Automator notification\"} default notifications {\"Automator notification\"}\n\t\tnotify with name \"Automator notification\" title notification_title description notification_description application name \"Automator\" sticky notification_sticky priority notification_priority\n\tend tell\n\treturn input_items\nend run\n","subject":"Fix the Automator action. The \u201cin bundle with identifier\u201d parameter doesn't exist on my 10.5.5 machine (for some reason, even though the AppleScript Studio Release Notes claim it has since Tiger), which breaks compilation of the action's main script. We don't call the function that uses that phantom parameter, anyway, so I fixed the problem by simply axing the function.","message":"Fix the Automator action. The \u201cin bundle with identifier\u201d parameter doesn't exist on my 10.5.5 machine (for some reason, even though the AppleScript Studio Release Notes claim it has since Tiger), which breaks compilation of the action's main script. We don't call the function that uses that phantom parameter, anyway, so I fixed the problem by simply axing the function.\n","lang":"AppleScript","license":"bsd-3-clause","repos":"PersonifyInc\/growl,PersonifyInc\/growl,incbee\/Growl,incbee\/Growl,PersonifyInc\/growl,incbee\/Growl,PersonifyInc\/growl,incbee\/Growl,PersonifyInc\/growl,incbee\/Growl"}
{"commit":"1f58ca688fd098222fd21d951ea7aa15e87cf0ea","old_file":"setup\/set-terminal-theme.applescript","new_file":"setup\/set-terminal-theme.applescript","old_contents":"(* This script is adapted from\n   https:\/\/github.com\/mathiasbynens\/dotfiles\/blob\/master\/.macos.\n\n   I have mainly added more explicit handling of the path to the custom theme\n   file and the ability to set the font. *)\n\ntell application \"Terminal\"\n\n    local allOpenedWindows\n    local initialOpenedWindows\n    local windowID\n\n    (* Set the fully qualified path to the .terminal file. We'll need to\n       refer to the theme name separately though. *)\n    set themeName to \"Solarized Dark\"\n    set themePath to (system attribute \"HOME\") & \"\/.config\/themes\/osx-terminal.app-colors-solarized\/\"\n    set themeFile to themePath & themeName & \".terminal\"\n\n    (* Set our desired font. *)\n    set fontName to \"SauceCodePowerline-Medium\"\n    set fontSize to 12\n\n    (* Store the IDs of all the open terminal windows. *)\n    set initialOpenedWindows to id of every window\n\n    (* Open the custom theme so that it gets added to the list of  available\n       terminal themes. Note: this will open an additional terminal window. *)\n    do shell script \"open '\" & themeFile & \"'\"\n\n    (* Wait a little bit to ensure that the custom theme is added. *)\n    delay 1\n\n    (* Modify the custom theme to set our desired font. *)\n    set font name of settings set themeName to fontName\n    set font size of settings set themeName to fontSize\n\n    (* Set the custom theme as the default terminal theme. *)\n    set default settings to settings set themeName\n\n    (* Get the IDs of all the currently opened terminal windows. *)\n    set allOpenedWindows to id of every window\n\n    repeat with windowID in allOpenedWindows\n\n        (* Close the additional windows that were opened in order to add the\n           custom theme to the list of terminal themes. *)\n        if initialOpenedWindows does not contain windowID then\n            close (every window whose id is windowID)\n\n        (* Change the theme for the initial opened terminal windows to remove\n           the need to close them in order for the custom theme to be applied. *)\n        else\n            set current settings of tabs of (every window whose id is windowID) to settings set themeName\n        end if\n    end repeat\nend tell\n","new_contents":"(* This script is adapted from\n   https:\/\/github.com\/mathiasbynens\/dotfiles\/blob\/master\/.macos.\n\n   I have mainly added more explicit handling of the path to the custom theme\n   file and the ability to set the font. *)\n\ntell application \"Terminal\"\n\n    local allOpenedWindows\n    local initialOpenedWindows\n    local windowID\n\n    (* Set the fully qualified path to the .terminal file. We'll need to\n       refer to the theme name separately though. *)\n    set themeName to \"Solarized Dark\"\n    set themePath to (system attribute \"HOME\") & \"\/.config\/themes\/osx-terminal.app-colors-solarized\/\"\n    set themeFile to themePath & themeName & \".terminal\"\n\n    (* Set our desired font. *)\n    set fontName to \"SourceCodePro-Regular\"\n    set fontSize to 12\n\n    (* Store the IDs of all the open terminal windows. *)\n    set initialOpenedWindows to id of every window\n\n    (* Open the custom theme so that it gets added to the list of  available\n       terminal themes. Note: this will open an additional terminal window. *)\n    do shell script \"open '\" & themeFile & \"'\"\n\n    (* Wait a little bit to ensure that the custom theme is added. *)\n    delay 1\n\n    (* Modify the custom theme to set our desired font. *)\n    set font name of settings set themeName to fontName\n    set font size of settings set themeName to fontSize\n\n    (* Set the custom theme as the default terminal theme. *)\n    set default settings to settings set themeName\n\n    (* Get the IDs of all the currently opened terminal windows. *)\n    set allOpenedWindows to id of every window\n\n    repeat with windowID in allOpenedWindows\n\n        (* Close the additional windows that were opened in order to add the\n           custom theme to the list of terminal themes. *)\n        if initialOpenedWindows does not contain windowID then\n            close (every window whose id is windowID)\n\n        (* Change the theme for the initial opened terminal windows to remove\n           the need to close them in order for the custom theme to be applied. *)\n        else\n            set current settings of tabs of (every window whose id is windowID) to settings set themeName\n        end if\n    end repeat\nend tell\n","subject":"Set terminal font to source code pro.","message":"Set terminal font to source code pro.\n","lang":"AppleScript","license":"mit","repos":"adriantrunzo\/dotfiles"}
{"commit":"285dc3ae01f3c7aba05dd03136b0520a227a6964","old_file":"iTerm2FinderButton.app\/Contents\/Resources\/Scripts\/main.scpt","new_file":"iTerm2FinderButton.app\/Contents\/Resources\/Scripts\/main.scpt","old_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0002i\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0007\u0000\b\r\u0000\u0007\u0000\u0003I\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u000b\u0000\u001a0\u0000\u000bopeniniterm\u0000\u000bopenIniTerm\u0002\u0000\t\u0000\u0002\u0000\n\r\u0000\n\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\tthefolder\u0000\ttheFolder\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\b\u0000\u0002O\u0000\u0000\u0000\u0000\u0000)\u0000\u000b\u0000\f\r\u0000\u000b\u0000\u0001k\u0000\u0000\u0000\u0004\u0000(\u0000\r\u0002\u0000\r\u0000\u0002\u0000\u000e\u0000\u000f\r\u0000\u000e\u0000\u0002r\u0000\u0000\u0000\u0004\u0000\u000b\u0000\u0010\u0000\u0011\r\u0000\u0010\u0000\u0003I\u0000\u0002\u0000\u0004\u0000\t\n\u0000\u0018.Itrmnwwnnull\u0000\u0000null\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000\u0011\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00050\u0000\u0001t\u0000\u0000\u0002\u0000\u000f\u0000\u0002\u0000\u0012\u0000\u0013\r\u0000\u0012\u0000\u0003l\u0000\u0002\u0000\f\u0000\f\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0013\u0000\u0002\u0000\u0014\u0000\u0015\r\u0000\u0014\u0000\u0002O\u0000\u0000\u0000\f\u0000\"\u0000\u0016\u0000\u0017\r\u0000\u0016\u0000\u0003I\u0000\u0002\u0000\u0012\u0000!\u0000\u0018\n\u0000\u0018.Itrmsntxnull\u0000\u0000\u0000\u0000\u0000obj \u0001\u0000\u0000\u0006\u0000\u0018\u0000\u0003\u0000\u0019\n\u0000\u0004\nText\r\u0000\u0019\u0000\u0002b\u0000\u0000\u0000\u0014\u0000\u001d\u0000\u001a\u0000\u001b\r\u0000\u001a\u0000\u0002b\u0000\u0000\u0000\u0014\u0000\u001b\u0000\u001c\u0000\u001d\r\u0000\u001c\u0000\u0001m\u0000\u0000\u0000\u0014\u0000\u0015\u0000\u001e\u000e\u0000\u001e\u0000\u0001\u0000\u001f\u0011\u0000\u001f\u0000\u0006\u0000c\u0000d\u0000 \r\u0000\u001d\u0000\u0002n\u0000\u0000\u0000\u0015\u0000\u001a\u0000 \u0000!\r\u0000 \u0000\u00011\u0000\u0000\u0000\u0018\u0000\u001a\n\u0000\u0004\nstrq\r\u0000!\u0000\u0002n\u0000\u0000\u0000\u0015\u0000\u0018\u0000\"\u0000#\r\u0000\"\u0000\u00011\u0000\u0000\u0000\u0016\u0000\u0018\n\u0000\u0004\npsxp\r\u0000#\u0000\u0001o\u0000\u0000\u0000\u0015\u0000\u0016\u000b\u0000\u00160\u0000\tthefolder\u0000\ttheFolder\r\u0000\u001b\u0000\u0001m\u0000\u0000\u0000\u001b\u0000\u001c\u0000$\u000e\u0000$\u0000\u0001\u0000%\u0011\u0000%\u0000\u000e\u0000;\u0000c\u0000l\u0000e\u0000a\u0000r\u0000;\u0006\u0000\u0000\r\u0000\u0017\u0000\u0003l\u0001\u0000\u0000\f\u0000\u000f\u0000&\r\u0000&\u0000\u0002n\u0000\u0000\u0000\f\u0000\u000f\u0000'\u0000(\r\u0000'\u0000\u00011\u0000\u0000\u0000\r\u0000\u000f\n\u0000\u0004\nWcsn\r\u0000(\u0000\u0001o\u0000\u0000\u0000\f\u0000\r\u000b\u0000\u00050\u0000\u0001t\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0015\u0000\u0002\u0000)\r\u0000)\u0000\u0003I\u0000\u0002\u0000#\u0000(\n\u0000\u0018.miscactvnull\u0000\u0000null\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\f\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0000*\u000f\u0000*\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000ITRM\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001H\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\\H+\u0000\u0000\u0006\u000e\tiTerm.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004b\u0005nA\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fApplications\u0000\u0010\u0000\b\u0000\u0000\\Ag\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0004\u0006\u000e\u0000\u0002\u0000$Macintosh HD:Applications:\u0000iTerm.app\u0000\u000e\u0000\u0014\u0000\t\u0000i\u0000T\u0000e\u0000r\u0000m\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000\u0016Applications\/iTerm.app\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000+\u0000,\r\u0000+\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000,\u0000\u0002\u0000-\r\u0000-\u0000\u0002i\u0000\u0000\u0000\u0004\u0000\u0007\u0000.\u0000\/\r\u0000.\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0000\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000\/\u0000\u0001k\u0000\u0000\u0000\u0000\u0000*\u00000\u0002\u00000\u0000\u0002\u00001\u00002\r\u00001\u0000\u0002O\u0000\u0000\u0000\u0000\u0000#\u00003\u00004\r\u00003\u0000\u0003Q\u0000\u0000\u0000\u0004\u0000\"\u00005\u00006\u00007\r\u00005\u0000\u0002r\u0000\u0000\u0000\u0007\u0000\u0011\u00008\u00009\r\u00008\u0000\u0003l\u0000\u0005\u0000\u0007\u0000\u000f\u0000:\r\u0000:\u0000\u0002c\u0000\u0000\u0000\u0007\u0000\u000f\u0000;\u0000<\r\u0000;\u0000\u0002n\u0000\u0000\u0000\u0007\u0000\r\u0000=\u0000>\r\u0000=\u0000\u0001m\u0000\u0000\u0000\u000b\u0000\r\n\u0000\u0004\ncfol\r\u0000>\u0000\u0003l\u0001\u0000\u0000\u0007\u0000\u000b\u0000?\r\u0000?\u0000\u00024\u0001\u0000\u0000\u0007\u0000\u000b\u0000@\n\u0000\u0004\ncwin\r\u0000@\u0000\u0001m\u0000\u0000\u0000\t\u0000\n\u0003\u0000\u0001\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000<\u0000\u0001m\u0000\u0000\u0000\r\u0000\u000e\n\u0000\u0004\nalis\u0001\u0000\u0000\u0001\u0000\u0000\r\u00009\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\tthefolder\u0000\ttheFolder\r\u00006\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\r\u00007\u0000\u0002r\u0000\u0000\u0000\u0019\u0000\"\u0000A\u0000B\r\u0000A\u0000\u0003l\u0000\u0005\u0000\u0019\u0000 \u0000C\r\u0000C\u0000\u0003I\u0000\u0002\u0000\u0019\u0000 \u0000D\u0000E\n\u0000\u0018.earsffdralis\u0000\u0000\u0000\u0000\u0000\u0000 \u0000afdr\r\u0000D\u0000\u0001m\u0000\u0000\u0000\u0019\u0000\u001a\n\u0000\b\u000bafdmdesk\u0006\u0000E\u0000\u0003\u0000F\n\u0000\u0004\nrtyp\r\u0000F\u0000\u0001m\u0000\u0000\u0000\u001b\u0000\u001c\n\u0000\u0004\nalis\u0006\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000B\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\tthefolder\u0000\ttheFolder\r\u00004\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0000G\u000f\u0000G\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000MACS\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001t\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\\H+\u0000\u0000\u0006\u000e\nFinder.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0006w\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u0000\\Ag\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000vn\u0000\u0000\u0000\u0001\u0000\f\u0006\u000e\u0006\u000e\u0006\u000e\u0000\u0002\u00006Macintosh HD:System:\u0000Library:\u0000CoreServices:\u0000Finder.app\u0000\u000e\u0000\u0016\u0000\n\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000&System\/Library\/CoreServices\/Finder.app\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u00002\u0000\u0002\u0000H\r\u0000H\u0000\u0003I\u0000\u0000\u0000$\u0000*\u0000I\u000b\u0000\u001a0\u0000\u000bopeniniterm\u0000\u000bopenIniTerm\u0002\u0000I\u0000\u0002\u0000J\r\u0000J\u0000\u0001o\u0000\u0000\u0000%\u0000&\u000b\u0000\u00160\u0000\tthefolder\u0000\ttheFolder\u0002\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0006\u0000K\u0000L\u0000M\u0000N\u0001\u0000\u0000\u0010\u0000K\u0000\u0004\u000b\u0000\u001a0\u0000\u000bopeniniterm\u0000\u000bopenIniTerm\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000b\u0000\u00160\u0000\tthefolder\u0000\ttheFolder\u0001\u0000\u0000\u000e\u0000L\u0000\u0007\u0010\u0000\b\u0000O\u0000P\u000b\u0000\u001a0\u0000\u000bopeniniterm\u0000\u000bopenIniTerm\u000e\u0000\u0002\u0004\u0000Q\u0003\u0000\u0001\u000e\u0000Q\u0000\u0001\u0000\u000b\u0000\u00160\u0000\tthefolder\u0000\ttheFolder\u0002\u0000\u0000\u0010\u0000O\u0000\u0002\u000b\u0000\u00160\u0000\tthefolder\u0000\ttheFolder\u000b\u0000\u00050\u0000\u0001t\u0000\u0000\u0010\u0000P\u0000\n\u0000*\u0000\u001e\u0000$\n\u0000\u0018.Itrmnwwnnull\u0000\u0000null\n\u0000\u0004\nWcsn\n\u0000\u0004\nText\n\u0000\u0004\npsxp\n\u0000\u0004\nstrq\n\u0000\u0018.Itrmsntxnull\u0000\u0000\u0000\u0000\u0000obj \n\u0000\u0018.miscactvnull\u0000\u0000null\u0011\u0000*\u0012\u0000&*j\f\u0000\u0001EO,\u0012\u0000\u0011*,,%%l\f\u0000\bUO*j\f\u0000\tU\u000f\u000e\u0000M\u0000\u0007\u0010\u0000\/\u0000R\u0000S\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000R\u0000\u0000\u0010\u0000S\u0000\u000b\u0000G\n\u0000\u0004\ncwin\n\u0000\u0004\ncfol\n\u0000\u0004\nalis\u000b\u0000\u00160\u0000\tthefolder\u0000\ttheFolder\u0001\u0000\u0000\u0002\u0000\u0000\n\u0000\b\u000bafdmdesk\n\u0000\u0004\nrtyp\n\u0000\u0018.earsffdralis\u0000\u0000\u0000\u0000\u0000\u0000 \u0000afdr\u000b\u0000\u001a0\u0000\u000bopeniniterm\u0000\u000bopenIniTerm\u0011\u0000+\u0012\u0000 \u0014\u0000\u000f*k\/,&EW\u0000\u0010X\u0000\u0005\u0000\u0006l\f\u0000\tEUO*k+\u0000\n\u000f\u000f\u0000N\u0001d\ralis\u0000\u0000\u0000\u0000\u0001`\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\\H+\u0000\u0000\u0006\u0005\tzus_parse\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0007[\u056a\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0007Desktop\u0000\u0000\u0010\u0000\b\u0000\u0000\\Ag\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000[e*\u0000\u0000\u0000\u0001\u0000\f\u0006\u0005\u0000\tCg\u0000\u0002\u0000\u0002\u0000+Macintosh HD:Users:\u0000lex:\u0000Desktop:\u0000zus_parse\u0000\u0000\u000e\u0000\u0014\u0000\t\u0000z\u0000u\u0000s\u0000_\u0000p\u0000a\u0000r\u0000s\u0000e\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000\u001bUsers\/lex\/Desktop\/zus_parse\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0015\u0000\u0002\u0000\n\u0000\u0000\u0001\u0000\u0000ascr\u0000\u0001\u0000\f\u07ad","new_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0002i\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0007\u0000\b\r\u0000\u0007\u0000\u0003I\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u000b\u0000\u001a0\u0000\u000bopeniniterm\u0000\u000bopenIniTerm\u0002\u0000\t\u0000\u0002\u0000\n\r\u0000\n\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\tthefolder\u0000\ttheFolder\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\b\u0000\u0002O\u0000\u0000\u0000\u0000\u0000H\u0000\u000b\u0000\f\r\u0000\u000b\u0000\u0001k\u0000\u0000\u0000\u0004\u0000G\u0000\r\u0002\u0000\r\u0000\u0002\u0000\u000e\u0000\u000f\r\u0000\u000e\u0000\u0002r\u0000\u0000\u0000\u0004\u0000\t\u0000\u0010\u0000\u0011\r\u0000\u0010\u0000\u00011\u0000\u0000\u0000\u0004\u0000\u0007\n\u0000\u0004\nCrwn\r\u0000\u0011\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00050\u0000\u0001t\u0000\u0000\u0002\u0000\u000f\u0000\u0002\u0000\u0012\u0000\u0013\r\u0000\u0012\u0000\u0003Q\u0000\u0000\u0000\n\u0000*\u0000\u0014\u0000\u0015\u0000\u0016\r\u0000\u0014\u0000\u0002O\u0000\u0000\u0000\r\u0000\u001b\u0000\u0017\u0000\u0018\r\u0000\u0017\u0000\u0003I\u0000\u0002\u0000\u0013\u0000\u001a\u0000\u0019\n\u0000\u0018.Itrmntwpnull\u0000\u0000\u0000\u0000\u0000obj \u0001\u0000\u0000\u0006\u0000\u0019\u0000\u0003\u0000\u001a\n\u0000\u0004\nNtwp\r\u0000\u001a\u0000\u0001m\u0000\u0000\u0000\u0015\u0000\u0016\u0000\u001b\u000e\u0000\u001b\u0000\u0001\u0000\u001c\u0011\u0000\u001c\u0000\u000e\u0000D\u0000e\u0000f\u0000a\u0000u\u0000l\u0000t\u0006\u0000\u0000\r\u0000\u0018\u0000\u0003l\u0001\u0000\u0000\r\u0000\u0010\u0000\u001d\r\u0000\u001d\u0000\u00011\u0000\u0000\u0000\r\u0000\u0010\n\u0000\u0004\nCrwn\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000\u0015\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u001e\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000\u001e\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00060\u0000\u0002mg\u0000\u0000\u0002\u0000\u0000\r\u0000\u0016\u0000\u0002r\u0000\u0000\u0000#\u0000*\u0000\u001f\u0000 \r\u0000\u001f\u0000\u0003I\u0000\u0002\u0000#\u0000(\n\u0000\u0018.Itrmnwwnnull\u0000\u0000null\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000 \u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00050\u0000\u0001t\u0000\u0000\u0002\u0000\u0013\u0000\u0002\u0000!\u0000\"\r\u0000!\u0000\u0002O\u0000\u0000\u0000+\u0000A\u0000#\u0000$\r\u0000#\u0000\u0003I\u0000\u0002\u00001\u0000@\u0000%\n\u0000\u0018.Itrmsntxnull\u0000\u0000\u0000\u0000\u0000obj \u0001\u0000\u0000\u0006\u0000%\u0000\u0003\u0000&\n\u0000\u0004\nText\r\u0000&\u0000\u0002b\u0000\u0000\u00003\u0000<\u0000'\u0000(\r\u0000'\u0000\u0002b\u0000\u0000\u00003\u0000:\u0000)\u0000*\r\u0000)\u0000\u0001m\u0000\u0000\u00003\u00004\u0000+\u000e\u0000+\u0000\u0001\u0000,\u0011\u0000,\u0000\u0006\u0000c\u0000d\u0000 \r\u0000*\u0000\u0002n\u0000\u0000\u00004\u00009\u0000-\u0000.\r\u0000-\u0000\u00011\u0000\u0000\u00007\u00009\n\u0000\u0004\nstrq\r\u0000.\u0000\u0002n\u0000\u0000\u00004\u00007\u0000\/\u00000\r\u0000\/\u0000\u00011\u0000\u0000\u00005\u00007\n\u0000\u0004\npsxp\r\u00000\u0000\u0001o\u0000\u0000\u00004\u00005\u000b\u0000\u00160\u0000\tthefolder\u0000\ttheFolder\r\u0000(\u0000\u0001m\u0000\u0000\u0000:\u0000;\u00001\u000e\u00001\u0000\u0001\u00002\u0011\u00002\u0000\u000e\u0000;\u0000c\u0000l\u0000e\u0000a\u0000r\u0000;\u0006\u0000\u0000\r\u0000$\u0000\u0003l\u0001\u0000\u0000+\u0000.\u00003\r\u00003\u0000\u0002n\u0000\u0000\u0000+\u0000.\u00004\u00005\r\u00004\u0000\u00011\u0000\u0000\u0000,\u0000.\n\u0000\u0004\nWcsn\r\u00005\u0000\u0001o\u0000\u0000\u0000+\u0000,\u000b\u0000\u00050\u0000\u0001t\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\"\u0000\u0002\u00006\r\u00006\u0000\u0003I\u0000\u0002\u0000B\u0000G\n\u0000\u0018.miscactvnull\u0000\u0000null\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\f\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u00007\u000f\u00007\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000ITRM\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001H\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\n\u0002|H+\u0000\u0000\u0000\u0000\u0000G\tiTerm.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u001f5q\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fApplications\u0000\u0010\u0000\b\u0000\u0000\t\u0000\u0000\u0000\u0011\u0000\b\u0000\u00005\u0001F\u0000\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000G\u0000\u0002\u0000$Macintosh HD:Applications:\u0000iTerm.app\u0000\u000e\u0000\u0014\u0000\t\u0000i\u0000T\u0000e\u0000r\u0000m\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000\u0016Applications\/iTerm.app\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u00008\u00009\r\u00008\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u00009\u0000\u0002\u0000:\r\u0000:\u0000\u0002i\u0000\u0000\u0000\u0004\u0000\u0007\u0000;\u0000<\r\u0000;\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0000\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000<\u0000\u0001k\u0000\u0000\u0000\u0000\u0000*\u0000=\u0002\u0000=\u0000\u0002\u0000>\u0000?\r\u0000>\u0000\u0002O\u0000\u0000\u0000\u0000\u0000#\u0000@\u0000A\r\u0000@\u0000\u0003Q\u0000\u0000\u0000\u0004\u0000\"\u0000B\u0000C\u0000D\r\u0000B\u0000\u0002r\u0000\u0000\u0000\u0007\u0000\u0011\u0000E\u0000F\r\u0000E\u0000\u0003l\u0000\u0005\u0000\u0007\u0000\u000f\u0000G\r\u0000G\u0000\u0002c\u0000\u0000\u0000\u0007\u0000\u000f\u0000H\u0000I\r\u0000H\u0000\u0002n\u0000\u0000\u0000\u0007\u0000\r\u0000J\u0000K\r\u0000J\u0000\u0001m\u0000\u0000\u0000\u000b\u0000\r\n\u0000\u0004\ncfol\r\u0000K\u0000\u0003l\u0001\u0000\u0000\u0007\u0000\u000b\u0000L\r\u0000L\u0000\u00024\u0001\u0000\u0000\u0007\u0000\u000b\u0000M\n\u0000\u0004\ncwin\r\u0000M\u0000\u0001m\u0000\u0000\u0000\t\u0000\n\u0003\u0000\u0001\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000I\u0000\u0001m\u0000\u0000\u0000\r\u0000\u000e\n\u0000\u0004\nalis\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000F\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\tthefolder\u0000\ttheFolder\r\u0000C\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000D\u0000\u0002r\u0000\u0000\u0000\u0019\u0000\"\u0000N\u0000O\r\u0000N\u0000\u0003l\u0000\u0005\u0000\u0019\u0000 \u0000P\r\u0000P\u0000\u0003I\u0000\u0002\u0000\u0019\u0000 \u0000Q\u0000R\n\u0000\u0018.earsffdralis\u0000\u0000\u0000\u0000\u0000\u0000 \u0000afdr\r\u0000Q\u0000\u0001m\u0000\u0000\u0000\u0019\u0000\u001a\n\u0000\b\u000bafdmdesk\u0006\u0000R\u0000\u0003\u0000S\n\u0000\u0004\nrtyp\r\u0000S\u0000\u0001m\u0000\u0000\u0000\u001b\u0000\u001c\n\u0000\u0004\nalis\u0006\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000O\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\tthefolder\u0000\ttheFolder\r\u0000A\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0000T\u000f\u0000T\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000MACS\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001t\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\n\u0002|H+\u0000\u0000\u0000\u0000\u0000'\nFinder.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002w\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u0000\t\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000o\u0000\u0000\u0000\u0001\u0000\f\u0000\u0000\u0000'\u0000\u0000\u0000&\u0000\u0000\u0000%\u0000\u0002\u00006Macintosh HD:System:\u0000Library:\u0000CoreServices:\u0000Finder.app\u0000\u000e\u0000\u0016\u0000\n\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000&System\/Library\/CoreServices\/Finder.app\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u0000?\u0000\u0002\u0000U\r\u0000U\u0000\u0003I\u0000\u0000\u0000$\u0000*\u0000V\u000b\u0000\u001a0\u0000\u000bopeniniterm\u0000\u000bopenIniTerm\u0002\u0000V\u0000\u0002\u0000W\r\u0000W\u0000\u0001o\u0000\u0000\u0000%\u0000&\u000b\u0000\u00160\u0000\tthefolder\u0000\ttheFolder\u0002\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0004\u0000X\u0000Y\u0000Z\u0001\u0000\u0000\u0010\u0000X\u0000\u0002\u000b\u0000\u001a0\u0000\u000bopeniniterm\u0000\u000bopenIniTerm\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000e\u0000Y\u0000\u0007\u0010\u0000\b\u0000[\u0000\\\u000b\u0000\u001a0\u0000\u000bopeniniterm\u0000\u000bopenIniTerm\u000e\u0000\u0002\u0004\u0000]\u0003\u0000\u0001\u000e\u0000]\u0000\u0001\u0000\u000b\u0000\u00160\u0000\tthefolder\u0000\ttheFolder\u0002\u0000\u0000\u0010\u0000[\u0000\u0003\u000b\u0000\u00160\u0000\tthefolder\u0000\ttheFolder\u000b\u0000\u00050\u0000\u0001t\u0000\u0000\u000b\u0000\u00060\u0000\u0002mg\u0000\u0000\u0010\u0000\\\u0000\u0010\u00007\u0000\u001b\u0000+\u00001\n\u0000\u0004\nCrwn\n\u0000\u0004\nNtwp\n\u0000\u0018.Itrmntwpnull\u0000\u0000\u0000\u0000\u0000obj \u000b\u0000\u00060\u0000\u0002mg\u0000\u0000\u0002\u0000\u0000\n\u0000\u0018.Itrmnwwnnull\u0000\u0000null\n\u0000\u0004\nWcsn\n\u0000\u0004\nText\n\u0000\u0004\npsxp\n\u0000\u0004\nstrq\n\u0000\u0018.Itrmsntxnull\u0000\u0000\u0000\u0000\u0000obj \n\u0000\u0018.miscactvnull\u0000\u0000null\u0011\u0000I\u0012\u0000E*,EO\u0014\u0000\u0013*,\u0012\u0000\t*l\f\u0000\u0004UW\u0000\u000eX\u0000\u0005\u0000\u0006*j\f\u0000\u0007EO,\u0012\u0000\u0011*,,%%l\f\u0000\u000eUO*j\f\u0000\u000fU\u000f\u000e\u0000Z\u0000\u0007\u0010\u0000<\u0000^\u0000_\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000^\u0000\u0000\u0010\u0000_\u0000\u000b\u0000T\n\u0000\u0004\ncwin\n\u0000\u0004\ncfol\n\u0000\u0004\nalis\u000b\u0000\u00160\u0000\tthefolder\u0000\ttheFolder\u0001\u0000\u0000\u0002\u0000\u0000\n\u0000\b\u000bafdmdesk\n\u0000\u0004\nrtyp\n\u0000\u0018.earsffdralis\u0000\u0000\u0000\u0000\u0000\u0000 \u0000afdr\u000b\u0000\u001a0\u0000\u000bopeniniterm\u0000\u000bopenIniTerm\u0011\u0000+\u0012\u0000 \u0014\u0000\u000f*k\/,&EW\u0000\u0010X\u0000\u0005\u0000\u0006l\f\u0000\tEUO*k+\u0000\n\u000f\u0000ascr\u0000\u0001\u0000\r\u07ad","subject":"Create a new tab when iTerm already has a window, otherwise create a new window","message":"Create a new tab when iTerm already has a window, otherwise create a new window\n","lang":"AppleScript","license":"mit","repos":"lexrus\/LTFinderButtons"}
{"commit":"e33f82284f6d4740d517ad38c162de971f99a918","old_file":"Uninstall.applescript","new_file":"Uninstall.applescript","old_contents":"property stdout : \"\"\non run\n\tset newline to ASCII character 10\n\t\n\tset stdout to stdout & \"  shutdown TotalFinderCrashWatcher ...\" & newline\n\ttry\n\t\tdo shell script \"killall -SIGINT TotalFinderCrashWatcher\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    TotalFinderCrashWatcher.com not running\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  shutdown Finder ...\" & newline\n\ttry\n\t\ttell application \"Finder\" to quit\n\ton error\n\t\tset stdout to stdout & \"    Finder was not running prior uninstallation\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.app from login items ...\" & newline\n\ttry\n\t\ttell application \"System Events\"\n\t\t\tget the name of every login item\n\t\t\tif login item \"TotalFinder.app\" exists then\n\t\t\t\tdelete login item \"TotalFinder.app\"\n\t\t\tend if\n\t\tend tell\n\ton error\n\t\tset stdout to stdout & \"    Encountered problems when removing TotalFinder.app from login items\"\n\tend try\n\t\n\t-- old version\n\tset stdout to stdout & \"  removing the old TotalFinder files (0.8.2 and earlier) ...\" & newline\n\ttry\n\t\tdo shell script \"sudo launchctl unload -w \\\"\/Library\/LaunchDaemons\/com.binaryage.echelon.launcher.plist\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -f \\\"\/Library\/LaunchDaemons\/com.binaryage.echelon.launcher.plist\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo kextunload \\\"\/System\/Library\/Extensions\/echelon.kext\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/System\/Library\/Extensions\/echelon.kext\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Library\/Application Support\/SIMBL\/Plugins\/TotalFinder.bundle\\\"\" with administrator privileges\n\tend try\n\t\n\t\n\t-- new version\n\tset stdout to stdout & \"  unload TotalFinder.kext ...\" & newline\n\ttry\n\t\tdo shell script \"sudo kextunload \\\"\/System\/Library\/Extensions\/TotalFinder.kext\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    TotalFinder.kext not loaded\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.app ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Applications\/TotalFinder.app\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Applications\/TotalFinder.app\" & newline\n\tend try\n\t\n\t\n\tset stdout to stdout & \"  remove TotalFinder.kext ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/System\/Library\/Extensions\/TotalFinder.kext\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/System\/Library\/Extensions\/TotalFinder.kext\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.osax ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Library\/ScriptingAdditions\/TotalFinder.osax\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Library\/ScriptingAdditions\/TotalFinder.osax\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  enable Finder animations again ...\" & newline\n\ttry\n\t\tdo shell script \"defaults write com.apple.finder DisableAllAnimations -bool false\" with administrator privileges\n\t\tdo shell script \"defaults write com.apple.finder AnimateWindowZoom -bool true\" with administrator privileges\n\t\tdo shell script \"defaults write com.apple.finder FXDisableFancyWindowTransition -bool false\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to enable animations back\" & newline\n\tend try\n\n\tset stdout to stdout & \"  hide system files in Finder again ...\" & newline\n\ttry\n\t\tdo shell script \"defaults write com.apple.finder AppleShowAllFiles -bool false\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    hide system files in Finder back\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  relaunch Finder ...\" & newline\n\ttry\n\t\ttell application \"Finder\" to launch\n\ton error\n\t\tset stdout to stdout & \"    failed to relaunch Finder\" & newline\n\tend try\n\t\n\t-- at this point Finder should start cleanly and with no signs of TotalFinder\n\t-- you may check Events\/Replies tab to see if there were no issues with uninstallation\n\t\n\tstdout -- this is needed for platypus to display output in details window\nend run","new_contents":"property stdout : \"\"\non run\n\tset newline to ASCII character 10\n\t\n\tset stdout to stdout & \"  shutdown TotalFinderCrashWatcher ...\" & newline\n\ttry\n\t\tdo shell script \"killall -SIGINT TotalFinderCrashWatcher\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    TotalFinderCrashWatcher not running\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  shutdown Finder ...\" & newline\n\ttry\n\t\ttell application \"Finder\" to quit\n\ton error\n\t\tset stdout to stdout & \"    Finder was not running prior uninstallation\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.app from login items ...\" & newline\n\ttry\n\t\ttell application \"System Events\"\n\t\t\tget the name of every login item\n\t\t\tif login item \"TotalFinder.app\" exists then\n\t\t\t\tdelete login item \"TotalFinder.app\"\n\t\t\tend if\n\t\tend tell\n\ton error\n\t\tset stdout to stdout & \"    Encountered problems when removing TotalFinder.app from login items\"\n\tend try\n\t\n\t-- old version\n\tset stdout to stdout & \"  removing the old TotalFinder files (0.8.2 and earlier) ...\" & newline\n\ttry\n\t\tdo shell script \"sudo launchctl unload -w \\\"\/Library\/LaunchDaemons\/com.binaryage.echelon.launcher.plist\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -f \\\"\/Library\/LaunchDaemons\/com.binaryage.echelon.launcher.plist\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo kextunload \\\"\/System\/Library\/Extensions\/echelon.kext\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/System\/Library\/Extensions\/echelon.kext\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Library\/Application Support\/SIMBL\/Plugins\/TotalFinder.bundle\\\"\" with administrator privileges\n\tend try\n\t\n\t\n\t-- new version\n\tset stdout to stdout & \"  unload TotalFinder.kext ...\" & newline\n\ttry\n\t\tdo shell script \"sudo kextunload \\\"\/System\/Library\/Extensions\/TotalFinder.kext\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    TotalFinder.kext not loaded\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.app ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Applications\/TotalFinder.app\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Applications\/TotalFinder.app\" & newline\n\tend try\n\t\n\t\n\tset stdout to stdout & \"  remove TotalFinder.kext ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/System\/Library\/Extensions\/TotalFinder.kext\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/System\/Library\/Extensions\/TotalFinder.kext\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.osax ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Library\/ScriptingAdditions\/TotalFinder.osax\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Library\/ScriptingAdditions\/TotalFinder.osax\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  enable Finder animations again ...\" & newline\n\ttry\n\t\tdo shell script \"defaults write com.apple.finder DisableAllAnimations -bool false\" with administrator privileges\n\t\tdo shell script \"defaults write com.apple.finder AnimateWindowZoom -bool true\" with administrator privileges\n\t\tdo shell script \"defaults write com.apple.finder FXDisableFancyWindowTransition -bool false\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to enable animations back\" & newline\n\tend try\n\n\tset stdout to stdout & \"  hide system files in Finder again ...\" & newline\n\ttry\n\t\tdo shell script \"defaults write com.apple.finder AppleShowAllFiles -bool false\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    hide system files in Finder back\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  relaunch Finder ...\" & newline\n\ttry\n\t\ttell application \"Finder\" to launch\n\ton error\n\t\tset stdout to stdout & \"    failed to relaunch Finder\" & newline\n\tend try\n\t\n\t-- at this point Finder should start cleanly and with no signs of TotalFinder\n\t-- you may check Events\/Replies tab to see if there were no issues with uninstallation\n\t\n\tstdout -- this is needed for platypus to display output in details window\nend run","subject":"fix a typo in uninstaller message","message":"fix a typo in uninstaller message\n","lang":"AppleScript","license":"bsd-3-clause","repos":"binaryage\/totalfinder-installer"}
{"commit":"9da6f2fe6e6562bae4cc99de5a6dad09be1c591f","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is not greater than 1 then\n\t\t\treturn theSongsSorted\n\t\tend if\n\n\t\tset trackCount to track count of (item 1 of theSongs)\n\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\tif trackCount is 0 or discCount is 0 then\n\t\t\treturn theSongsSorted\n\t\tend if\n\n\t\tset theSongsSorted to {} as list\n\n\t\trepeat with discIndex from 1 to discCount\n\n\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\tif (disc number of theSong is discIndex or (disc number of theSong is 0 and discIndex is 1)) and track number of theSong is songIndex then\n\n\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\tend if\n\n\t\t\t\tend repeat\n\n\t\t\tend repeat\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tif length of theSongs is not greater than 1 then\n\t\t\treturn theSongs\n\t\tend if\n\n\t\tset trackCount to track count of (item 1 of theSongs)\n\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\tif trackCount is 0 or discCount is 0 then\n\t\t\treturn theSongs\n\t\tend if\n\n\t\tset theSongsSorted to {} as list\n\n\t\trepeat with discIndex from 1 to discCount\n\n\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\tif (disc number of theSong is discIndex or (disc number of theSong is 0 and discIndex is 1)) and track number of theSong is songIndex then\n\n\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\tend if\n\n\t\t\t\tend repeat\n\n\t\t\tend repeat\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","subject":"Simplify return statements in sorting function","message":"Simplify return statements in sorting function\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"9a8739087010687b52bbbcb65d3c63944973699e","old_file":"org.hidetake.osx-go-to-bed.applescript","new_file":"org.hidetake.osx-go-to-bed.applescript","old_contents":"#!\/usr\/bin\/osascript\n\nset awake_time to date \"08:00:00\"\nset title_head to \"Remaining\"\nset description to \"You can sleep only\"\n\nset remain_time to date \"0:0\" + (awake_time - current date)\ndisplay notification description with title title_head & \" \" & time string of remain_time\n","new_contents":"#!\/usr\/bin\/osascript\n\nset awakeTime to date \"8:00:00\"\n\nset {hours: remainHours, minutes: remainMinutes} to (date \"0:0\") + (awakeTime - (current date))\nset messageTitle to \"Remaining \" & remainHours & \" hours \" & remainMinutes & \" minutes\"\nset messageDescription to \"now \" & time string of (current date)\n\ndisplay notification messageDescription with title messageTitle\n","subject":"Improve message","message":"Improve message\n","lang":"AppleScript","license":"apache-2.0","repos":"int128\/osx-go-to-bed"}
{"commit":"f1f26a784aa41da91240b4f36879b96c6905fe21","old_file":"src\/call_with_finder_selection.applescript","new_file":"src\/call_with_finder_selection.applescript","old_contents":"(*\n\tGet images in Finder selection, then call the workflow again with\n\tthe first selected image.\n\n\tIf no images are selected, return an error message, which\n\tcan be passed to a Post Notification action.\n*)\n\n-- The filetypes understood by Google Image Search\nset imageExtensions to {\"jpg\", \"jpeg\", \"bmp\", \"gif\", \"png\"}\n\n-- Return list of files selected in Finder whose extensions are\n-- in imageExtensions\non selectedImages()\n\tset theImages to {}\n\ttell application \"Finder\"\n\t\tset theSelection to the selection\n\t\tif (the count of theSelection) is greater than 0 then\n\t\t\trepeat with theFile in theSelection\n\t\t\t\tif the name extension of theFile is in my imageExtensions then\n\t\t\t\t\tset the end of theImages to (theFile as alias)\n\t\t\t\tend if\n\t\t\tend repeat\n\t\tend if\n\t\tlog ((the count of theImages) as text) & \" image(s) selected\"\n\tend tell\n\treturn theImages\nend selectedImages\n\nset theImages to my selectedImages()\nif (count of theImages) is greater than 0 then\n\tset theImage to item 1 of theImages\n\tset thePath to POSIX path of theImage\n\n\t-- Use the workflow's own external trigger\n\ttell application \"Alfred 3\" to run trigger \"Find Similar Images\" in workflow \"net.deanishe.alfred-google-similar-images\" with argument thePath\nelse\n\treturn \"No images selected\"\nend if\n","new_contents":"(*\n\tGet images in Finder selection, then call the workflow again with\n\tthe first selected image.\n\n\tIf no images are selected, return an error message, which\n\tcan be passed to a Post Notification action.\n*)\n\n-- The filetypes understood by Google Image Search\nset imageExtensions to {\"jpg\", \"jpeg\", \"bmp\", \"gif\", \"png\"}\n\n-- Return list of files selected in Finder whose extensions are\n-- in imageExtensions\non selectedImages()\n\tset theImages to {}\n\ttell application \"Finder\"\n\t\tset theSelection to the selection\n\t\tif (the count of theSelection) is greater than 0 then\n\t\t\trepeat with theFile in theSelection\n\t\t\t\tif the name extension of theFile is in my imageExtensions then\n\t\t\t\t\tset the end of theImages to (theFile as alias)\n\t\t\t\tend if\n\t\t\tend repeat\n\t\tend if\n\t\tlog ((the count of theImages) as text) & \" image(s) selected\"\n\tend tell\n\treturn theImages\nend selectedImages\n\nset theImages to my selectedImages()\nif (count of theImages) is greater than 0 then\n\tset theImage to item 1 of theImages\n\tset thePath to POSIX path of theImage\n\n\t-- Use the workflow's own external trigger\n\ttell application \"Alfred 4\" to run trigger \"Find Similar Images\" in workflow \"net.deanishe.alfred-google-similar-images\" with argument thePath\nelse\n\treturn \"No images selected\"\nend if\n","subject":"Update call_with_finder_selection.applescript","message":"Update call_with_finder_selection.applescript","lang":"AppleScript","license":"mit","repos":"deanishe\/alfred-similar-image-search"}
{"commit":"fe5d7c99a2c3280f665d030d1b58e9d1c724f6da","old_file":"lib\/nehm\/applescripts\/list_of_playlists.applescript","new_file":"lib\/nehm\/applescripts\/list_of_playlists.applescript","old_contents":"tell application \"iTunes\"\n  get name of playlists\nend tell","new_contents":"tell application \"iTunes\"\n  get name of playlists\nend tell\n","subject":"Add newline in list_of_playlists","message":"Add newline in list_of_playlists\n","lang":"AppleScript","license":"mit","repos":"bogem\/nehm"}
{"commit":"e866d8e1cf220f51469dbb52679e8931d69d0bcc","old_file":"tube\/autoload\/tube\/applescript\/iterm.applescript","new_file":"tube\/autoload\/tube\/applescript\/iterm.applescript","old_contents":"-- iterm.applescript\n---\n-- this script requires an argument that represent the command to execute\n\non run argv\n\n    set command to (item 1 of argv)\n\n    tell application \"iTerm\"\n\n        try\n            set mysession to current session of current terminal\n        on error\n            set myterm to (make new terminal)\n            tell myterm\n                launch session \"Default\"\n                set mysession to current session\n            end tell\n        end try\n\n        tell mysession\n            write text command\n        end tell\n\n    end tell\n\nend run\n","new_contents":"-- iterm.applescript\n---\n-- this script requires an argument that represent the command to execute\n\non run argv\n\n    set command to (item 1 of argv)\n\n    tell application iTerm2\n      tell current session of first window\n        write text command\n      end tell\n    end tell\nend run\n","subject":"Use new iTerm applescript","message":"Use new iTerm applescript\n","lang":"AppleScript","license":"mit","repos":"alisnic\/tube.vim"}
{"commit":"ce2d601d2b9e5efafdc3afce6fabbeaf2bd2e534","old_file":"autoload\/tube\/applescript\/iterm.applescript","new_file":"autoload\/tube\/applescript\/iterm.applescript","old_contents":"-- iterm.applescript\n---\n-- this script requires an argument that represent the command to execute\n\non run argv\n\n    set command to (item 1 of argv)\n\n    tell application \"iTerm\"\n\n        try\n            set mysession to current session of current terminal\n        on error\n            set myterm to (make new terminal)\n            tell myterm\n                launch session \"Default\"\n                set mysession to current session\n            end tell\n        end try\n\n        tell mysession\n            write text command\n        end tell\n\n    end tell\n\nend run\n","new_contents":"on run argv\n    set command to (item 1 of argv)\n\n    tell application iTerm2\n      set _window to (current window)\n\n      if _window is equal to missing value then\n        create window with default profile\n      end if\n\n      tell current window\n        tell current session\n          write text command\n        end tell\n      end tell\n    end tell\nend run\n","subject":"Update applescript","message":"Update applescript\n","lang":"AppleScript","license":"mit","repos":"alisnic\/tube.vim"}
{"commit":"bef22a8743b249a2c66e50049324982a6caddf14","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\n-- workflow folders\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\n\n-- album artwork folders\nproperty artworkDocsFolder : ((get path to library folder from user domain as text) & \"Containers:com.apple.AMPArtworkAgent:Data:Documents\")\nproperty artworkImageFolder : (artworkDocsFolder & \":artwork:\")\n\n-- the default icon used for search results without album artwork\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and convert from hexadecimal to decimal (base-10)\n\t\t\tset hexSongId to persistent ID of theSong\n\t\t\tset decSongId to (do shell script \"echo $((16#\" & hexSongId & \"))\")\n\n\t\t\t-- retrieve filename of cached artwork\n\t\t\tset artworkName to (do shell script (\"\/usr\/bin\/sqlite3 \" & (POSIX path of artworkDocsFolder) & \"\/artworkd.sqlite '\" & \u00ac\n\t\t\t\"select ZHASHSTRING, ZKIND from ZIMAGEINFO where Z_PK = (\" & \u00ac\n\t\t\t\"(select ZIMAGEINFO from ZSOURCEINFO where Z_PK = (\" & \u00ac\n\t\t\t\"select ZSOURCEINFO from ZDATABASEITEMINFO where ZPERSISTENTID = \" & \u00ac\n\t\t\tdecSongId & \")))' | \" & \u00ac\n\t\t\t\"awk '{split($0,a,\\\"|\\\"); print a[1] \\\"_sk_\\\" a[2] \\\"_cid_1.jpeg\\\"}'\"))\n\n\t\t\tset artworkPath to (artworkImageFolder & artworkName)\n\n\t\tend tell\n\n\t\treturn artworkPath\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"Music\"\n\n\t\tset genreSongs to every track of playlist 2 whose genre is genreName\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in genreSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset genreSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset genreSongs to genreSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn genreSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in artistSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset artistSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName)\n\t\t\tset artistSongs to artistSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\n-- workflow folders\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\n\n-- album artwork folders\nproperty artworkDocsFolder : ((get path to library folder from user domain as text) & \"Containers:com.apple.AMPArtworkAgent:Data:Documents\")\nproperty artworkImageFolder : (artworkDocsFolder & \":artwork:\")\n\n-- the default icon used for search results without album artwork\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and convert from hexadecimal to decimal (base-10)\n\t\t\tset hexSongId to persistent ID of theSong\n\t\t\tset decSongId to (do shell script \"echo $((16#\" & hexSongId & \"))\")\n\n\t\t\t-- retrieve filename of cached artwork (without extension)\n\t\t\tset artworkName to (do shell script (\"\/usr\/bin\/sqlite3 \" & (POSIX path of artworkDocsFolder) & \"\/artworkd.sqlite '\" & \u00ac\n\t\t\t\"select ZHASHSTRING, ZKIND from ZIMAGEINFO where Z_PK = (\" & \u00ac\n\t\t\t\"(select ZIMAGEINFO from ZSOURCEINFO where Z_PK = (\" & \u00ac\n\t\t\t\"select ZSOURCEINFO from ZDATABASEITEMINFO where ZPERSISTENTID = \" & \u00ac\n\t\t\tdecSongId & \")))' | \" & \u00ac\n\t\t\t\"awk '{split($0,a,\\\"|\\\"); print a[1] \\\"_sk_\\\" a[2] \\\"_cid_1\\\"}'\"))\n\n\t\t\tset artworkPath to (artworkImageFolder & artworkName)\n\n\t\tend tell\n\n\t\treturn selectFirstArtworkThatExists({ \u00ac\n\t\t\t(artworkImageFolder & artworkName & \".jpeg\"), \u00ac\n\t\t\t(artworkImageFolder & artworkName & \".png\")}) of me\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getSongArtworkPath\n\n-- select the first path (in the given set of artwork paths) that exists on the\n-- user's local system\non selectFirstArtworkThatExists(artworkPaths)\n\n\ttell application \"Finder\"\n\t\trepeat with artworkPath in artworkPaths\n\t\t\tif artworkPath exists then\n\t\t\t\treturn artworkPath as text\n\t\t\tend if\n\t\tend repeat\n\tend tell\n\n\treturn defaultIconName\n\nend selectFirstArtworkThatExists\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"Music\"\n\n\t\tset genreSongs to every track of playlist 2 whose genre is genreName\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in genreSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset genreSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset genreSongs to genreSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn genreSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in artistSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset artistSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName)\n\t\t\tset artistSongs to artistSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","subject":"Fix bug where some non-Apple Music songs were missing artwork","message":"Fix bug where some non-Apple Music songs were missing artwork\n\nThe original algorithm assumed that the file extension of every artwork\nimage was always jpeg. However, some songs (which I did not download\nfrom Apple Music, coincidentally) happened to have png artwork, and so\nthe algorithm would fail to return the correct artwork path for those\nsongs.\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"698772ca16b63f60ff287df21abeb88f15b2afe4","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\n-- workflow folders\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\n\n-- album artwork folders\nproperty artworkDocsFolder : ((get path to library folder from user domain as text) & \"Containers:com.apple.AMPArtworkAgent:Data:Documents\")\nproperty artworkImageFolder : (artworkDocsFolder & \":artwork:\")\n\n-- the default icon used for search results without album artwork\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and convert from hexadecimal to decimal (base-10)\n\t\t\tset hexSongId to persistent ID of theSong\n\t\t\tset decSongId to (do shell script \"echo $((16#\" & hexSongId & \"))\")\n\n\t\t\t-- retrieve filename of cached artwork\n\t\t\tset artworkName to (do shell script (\"\/usr\/bin\/sqlite3 \" & (POSIX path of artworkDocsFolder) & \"\/artworkd.sqlite '\" & \u00ac\n\t\t\t\"select ZHASHSTRING, ZKIND from ZIMAGEINFO where Z_PK = (\" & \u00ac\n\t\t\t\"(select ZIMAGEINFO from ZSOURCEINFO where Z_PK = (\" & \u00ac\n\t\t\t\"select ZSOURCEINFO from ZDATABASEITEMINFO where ZPERSISTENTID = \" & \u00ac\n\t\t\tdecSongId & \")))' | \" & \u00ac\n\t\t\t\"awk '{split($0,a,\\\"|\\\"); print a[1] \\\"_sk_\\\" a[2] \\\"_cid_1.jpeg\\\"}'\"))\n\n\t\t\tset artworkPath to (artworkImageFolder & artworkName)\n\n\t\tend tell\n\n\t\treturn artworkPath\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getNativeCachedArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"Music\"\n\n\t\tset genreSongs to every track of playlist 2 whose genre is genreName\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in genreSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset genreSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset genreSongs to genreSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn genreSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in artistSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset artistSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName)\n\t\t\tset artistSongs to artistSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\n-- workflow folders\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\n\n-- album artwork folders\nproperty artworkDocsFolder : ((get path to library folder from user domain as text) & \"Containers:com.apple.AMPArtworkAgent:Data:Documents\")\nproperty artworkImageFolder : (artworkDocsFolder & \":artwork:\")\n\n-- the default icon used for search results without album artwork\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and convert from hexadecimal to decimal (base-10)\n\t\t\tset hexSongId to persistent ID of theSong\n\t\t\tset decSongId to (do shell script \"echo $((16#\" & hexSongId & \"))\")\n\n\t\t\t-- retrieve filename of cached artwork\n\t\t\tset artworkName to (do shell script (\"\/usr\/bin\/sqlite3 \" & (POSIX path of artworkDocsFolder) & \"\/artworkd.sqlite '\" & \u00ac\n\t\t\t\"select ZHASHSTRING, ZKIND from ZIMAGEINFO where Z_PK = (\" & \u00ac\n\t\t\t\"(select ZIMAGEINFO from ZSOURCEINFO where Z_PK = (\" & \u00ac\n\t\t\t\"select ZSOURCEINFO from ZDATABASEITEMINFO where ZPERSISTENTID = \" & \u00ac\n\t\t\tdecSongId & \")))' | \" & \u00ac\n\t\t\t\"awk '{split($0,a,\\\"|\\\"); print a[1] \\\"_sk_\\\" a[2] \\\"_cid_1.jpeg\\\"}'\"))\n\n\t\t\tset artworkPath to (artworkImageFolder & artworkName)\n\n\t\tend tell\n\n\t\treturn artworkPath\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"Music\"\n\n\t\tset genreSongs to every track of playlist 2 whose genre is genreName\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in genreSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset genreSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset genreSongs to genreSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn genreSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in artistSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset artistSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName)\n\t\t\tset artistSongs to artistSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","subject":"Fix mismatched handler end tag","message":"Fix mismatched handler end tag\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"c01e12bb3bd74ab1a86cd428ea9eb35415c67c75","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif disc number of theSong is discIndex and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif (disc number of theSong is discIndex or (disc number of theSong is 0 and discIndex is 1)) and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","subject":"Fix bug where disc number-less songs would be excluded","message":"Fix bug where disc number-less songs would be excluded\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"d63b1f75ef971489a00339f4ec8af0e4f3113bad","old_file":"ports\/darwin_dmg\/adjust_installation_window.scpt","new_file":"ports\/darwin_dmg\/adjust_installation_window.scpt","old_contents":"tell application \"Finder\"\n    tell disk \"Rakudo_Star\"\n        open\n\n        set top_left_X     to 100\n        set top_left_Y     to 100\n        set bottom_right_X to 600\n        set bottom_right_Y to 500\n\n        tell container window\n            set current   view    to icon view\n            set toolbar   visible to false\n            set statusbar visible to false\n            set bounds            to { top_left_X, top_left_Y, bottom_right_X, bottom_right_Y }\n        end tell\n\n        make new alias file at container window to POSIX file \"\/Applications\" with properties { name:\"Applications\" }\n\n        set  opts to the icon view options of container window\n        tell opts\n            set icon size   to 128\n            set text size   to  16\n            set arrangement to not arranged\n        end tell\n\n        set position of item \"Rakudo_Star\"        to {120,  74}\n        set position of item \"Applications\"       to {360,  74}\n        set position of item \"HOW_TO_INSTALL.txt\" to {120, 264}\n\n        delay 5\n        close\n        delay 5\n        open\n        delay 5\n\n    end tell\nend tell\n","new_contents":"tell application \"Finder\"\n    tell disk \"Rakudo\"\n        open\n\n        set top_left_X     to 100\n        set top_left_Y     to 100\n        set bottom_right_X to 600\n        set bottom_right_Y to 500\n\n        tell container window\n            set current   view    to icon view\n            set toolbar   visible to false\n            set statusbar visible to false\n            set bounds            to { top_left_X, top_left_Y, bottom_right_X, bottom_right_Y }\n        end tell\n\n        make new alias file at container window to POSIX file \"\/Applications\" with properties { name:\"Applications\" }\n\n        set  opts to the icon view options of container window\n        tell opts\n            set icon size   to 128\n            set text size   to  16\n            set arrangement to not arranged\n        end tell\n\n        set position of item \"Rakudo\"        to {120,  74}\n        set position of item \"Applications\"       to {360,  74}\n        set position of item \"HOW_TO_INSTALL.txt\" to {120, 264}\n\n        delay 5\n        close\n        delay 5\n        open\n        delay 5\n\n    end tell\nend tell\n","subject":"use Rakudo in applescript too","message":"use Rakudo in applescript too\n","lang":"AppleScript","license":"artistic-2.0","repos":"stmuk\/star,rakudo\/star"}
{"commit":"bb1f289638bfe60cb9186d571be3619dd900dc2d","old_file":"library\/fmGUI_ManageSecurity\/fmGUI_ManageSecurity_Save.applescript","new_file":"library\/fmGUI_ManageSecurity\/fmGUI_ManageSecurity_Save.applescript","old_contents":"-- fmGUI_ManageSecurity_Save({fullAccessAccountName:null, fullAccessPassword:null})\n-- Daniel A. Shockley, NYHTC\n-- Close ( and save ) Manage Security\n\n\n(*\nHISTORY:\n\t1.5 - 2017-10-19 ( eshagdar ): sub-handlers: button clicks, window checks, authentication.\n\t1.4.2 - 2017-08-09 ( eshagdar ): instead of waiting for a set amount of time, wait until the frontmost window is not manage security ( it will either be the confirm full access window, or finished saving ).\n\t1.4.1 - 2017-08-07 ( eshagdar ): added windowWaitUntil handler to execute sample code\n\t1.4 - 2017-07-14 ( eshagdar ): renamed params: fullAccount -> fullAccessAccountName and fullPassword -> fullAccessPassword. wait until windows are gone.\n\t1.3 - 2016-07-20 ( eshagdar ): converted params from list to record\n\t1.2 - parameter as 'prefs' list for now, instead of two parameters.\n\t1.1 - \n\t1.0 - created\n\n\nREQUIRES:\n\tfmGUI_AppFrontMost\n\tfmGUI_AuthenticateDialog\n\tfmGUI_NameOfFrontmostWindow\n\tfmGUI_ObjectClick_OkButton\n\twindowWaitUntil*)\n\n\non run\n\tfmGUI_ManageSecurity_Save({fullAccessAccountName:\"admin\", fullAccessPassword:\"\"})\nend run\n\n--------------------\n-- START OF CODE\n--------------------\n\non fmGUI_ManageSecurity_Save(prefs)\n\t--version 1.5\n\t\n\tset defaulPrefs to {fullAccessAccountName:null, fullAccessPassword:null}\n\tset prefs to prefs & defaulPrefs\n\t\n\tset authWindowName to \"Confirm Full access Login\"\n\tset securityWindowName to \"Manage Security for\"\n\t\n\ttry\n\t\tfmGUI_AppFrontMost()\n\t\t\n\t\t-- save security changes\n\t\tfmGUI_ObjectClick_OkButton({})\n\t\t\n\t\t\n\t\t-- confirm with full access account\n\t\tif fmGUI_NameOfFrontmostWindow() is equal to authWindowName then fmGUI_AuthenticateDialog({accountName:fullAccessAccountName of prefs, pwd:fullAccessPassword of prefs, windowname:authWindowName})\n\t\t\n\t\t\n\t\t-- wait until window is gone\n\t\twindowWaitUntil({whichWindow:\"front\", windowNameTest:\"does not start with\", windowname:securityWindowName})\n\t\t\n\t\treturn true\n\ton error errMsg number errNum\n\t\terror \"Couldn't save Manage Security - \" & errMsg number errNum\n\tend try\n\t\nend fmGUI_ManageSecurity_Save\n\n--------------------\n-- END OF CODE\n--------------------\n\non fmGUI_AppFrontMost()\n\ttell application \"htcLib\" to fmGUI_AppFrontMost()\nend fmGUI_AppFrontMost\n\non fmGUI_AuthenticateDialog(prefs)\n\ttell application \"htcLib\" to fmGUI_AuthenticateDialog(prefs)\nend fmGUI_AuthenticateDialog\n\non fmGUI_NameOfFrontmostWindow()\n\ttell application \"htcLib\" to fmGUI_NameOfFrontmostWindow()\nend fmGUI_NameOfFrontmostWindow\n\non fmGUI_ObjectClick_OkButton(prefs)\n\ttell application \"htcLib\" to fmGUI_ObjectClick_OkButton(prefs)\nend fmGUI_ObjectClick_OkButton\n\non windowWaitUntil(prefs)\n\ttell application \"htcLib\" to windowWaitUntil(prefs)\nend windowWaitUntil\n","new_contents":"-- fmGUI_ManageSecurity_Save({fullAccessAccountName:null, fullAccessPassword:null})\n-- Daniel A. Shockley, NYHTC\n-- Close ( and save ) Manage Security\n\n\n(*\nHISTORY:\n\t1.5.1 - 2017-10-23 ( eshagdar ): FM16 renamed auth window name, so windw test is 'begins with' instead of 'is'\n\t1.5 - 2017-10-19 ( eshagdar ): sub-handlers: button clicks, window checks, authentication.\n\t1.4.2 - 2017-08-09 ( eshagdar ): instead of waiting for a set amount of time, wait until the frontmost window is not manage security ( it will either be the confirm full access window, or finished saving ).\n\t1.4.1 - 2017-08-07 ( eshagdar ): added windowWaitUntil handler to execute sample code\n\t1.4 - 2017-07-14 ( eshagdar ): renamed params: fullAccount -> fullAccessAccountName and fullPassword -> fullAccessPassword. wait until windows are gone.\n\t1.3 - 2016-07-20 ( eshagdar ): converted params from list to record\n\t1.2 - parameter as 'prefs' list for now, instead of two parameters.\n\t1.1 - \n\t1.0 - created\n\n\nREQUIRES:\n\tfmGUI_AppFrontMost\n\tfmGUI_AuthenticateDialog\n\tfmGUI_NameOfFrontmostWindow\n\tfmGUI_ObjectClick_OkButton\n\twindowWaitUntil*)\n\n\non run\n\tfmGUI_ManageSecurity_Save({fullAccessAccountName:\"admin\", fullAccessPassword:\"\"})\nend run\n\n--------------------\n-- START OF CODE\n--------------------\n\non fmGUI_ManageSecurity_Save(prefs)\n\t--version 1.5.1\n\t\n\tset defaulPrefs to {fullAccessAccountName:null, fullAccessPassword:null}\n\tset prefs to prefs & defaulPrefs\n\t\n\tset authWindowName to \"Confirm Full access\"\n\tset securityWindowName to \"Manage Security for\"\n\t\n\ttry\n\t\tfmGUI_AppFrontMost()\n\t\t\n\t\t-- save security changes\n\t\tfmGUI_ObjectClick_OkButton({})\n\t\t\n\t\t\n\t\t-- confirm with full access account\n\t\tif fmGUI_NameOfFrontmostWindow() begins with authWindowName then fmGUI_AuthenticateDialog({accountName:fullAccessAccountName of prefs, pwd:fullAccessPassword of prefs, windowname:authWindowName})\n\t\t\n\t\t\n\t\t-- wait until window is gone\n\t\twindowWaitUntil({whichWindow:\"front\", windowNameTest:\"does not start with\", windowname:securityWindowName})\n\t\t\n\t\treturn true\n\ton error errMsg number errNum\n\t\terror \"Couldn't save Manage Security - \" & errMsg number errNum\n\tend try\n\t\nend fmGUI_ManageSecurity_Save\n\n--------------------\n-- END OF CODE\n--------------------\n\non fmGUI_AppFrontMost()\n\ttell application \"htcLib\" to fmGUI_AppFrontMost()\nend fmGUI_AppFrontMost\n\non fmGUI_AuthenticateDialog(prefs)\n\ttell application \"htcLib\" to fmGUI_AuthenticateDialog(prefs)\nend fmGUI_AuthenticateDialog\n\non fmGUI_NameOfFrontmostWindow()\n\ttell application \"htcLib\" to fmGUI_NameOfFrontmostWindow()\nend fmGUI_NameOfFrontmostWindow\n\non fmGUI_ObjectClick_OkButton(prefs)\n\ttell application \"htcLib\" to fmGUI_ObjectClick_OkButton(prefs)\nend fmGUI_ObjectClick_OkButton\n\non windowWaitUntil(prefs)\n\ttell application \"htcLib\" to windowWaitUntil(prefs)\nend windowWaitUntil\n","subject":"save security dialog window name changed in fm16.","message":"save security dialog window name changed in fm16.\n","lang":"AppleScript","license":"mit","repos":"NYHTC\/applescript-fm-helper"}
{"commit":"ffeece1eb5445a75d34edf403f0268d86334516c","old_file":"TotalFinder.app\/Contents\/Resources\/Scripts\/main.applescript","new_file":"TotalFinder.app\/Contents\/Resources\/Scripts\/main.applescript","old_contents":"tell application \"Finder\"\n\tdelay 3 -- this delay is important to prevent random \"Connection is Invalid -609\" AppleScript errors \n\ttry\n\t\tevent BATFinit\n\ton error msg number num\n\t\tdisplay dialog \"\nUnable to launch TotalFinder.\n\t\t\n\" & msg & \" (\" & (num as text) & \")\" & \" \n\nYou may visit \nhttp:\/\/getsatisfaction.com\/binaryage \nto get support on this issue.\" with icon 0\n\tend try\nend tell","new_contents":"set lastErrMsg to \"Unable to inject TotalFinder\"\nset lastErrCode to -1\nset failed to yes\nset nextDelay to 1\n\ntell application \"Finder\"\n\tset startTime to current date\n\n\t-- under some conditions like system startup the system may be busy delivering apple events\n\t-- in this case we may get random \"Connection is Invalid -609\" AppleScript errors\n\t-- solution: we try it multiple times\n\trepeat\n\t\t-- increase the delay between individual trials\n\t\tlog \"delay \" & (nextDelay as text) & \"...\"\n\t\tdelay nextDelay\n\t\tset nextDelay to nextDelay + 1\n\t\t\n\t\t-- try injection\n\t\ttry\n\t\t\tevent BATFinit\n\t\t\tset failed to no\n\t\t\texit repeat\n\t\ton error msg number code\n\t\t\tlog \"error: \" & msg & \"(\" & (code as text) & \")\"\n\t\t\tset lastErrMsg to msg\n\t\t\tset lastErrCode to code\n\t\tend try\n\t\t\n\t\t-- make sure we don't repeat this forever, two minutes should be enough\n\t\tif (current date) - startTime is greater than (2 * 60) then exit repeat\n\t\t\n\tend repeat\n\t\n\tif failed is yes then\n\t\tdisplay dialog \"\nUnable to launch TotalFinder.\n\t\t\n\" & lastErrMsg & \" (\" & (lastErrCode as text) & \")\" & \" \n\nPlease email support@binaryage.com to get support on this issue.\" with icon 0 giving up after 30\n\tend if\n\t\nend tell","subject":"make the injector script more robust => repeat injection trials to overcome -609 errors","message":"make the injector script more robust => repeat injection trials to overcome -609 errors\n","lang":"AppleScript","license":"bsd-3-clause","repos":"binaryage\/totalfinder-installer"}
{"commit":"56f1069b73f9074b934b403c8068dde1b5efe282","old_file":"AppleScript\/openQnA.scpt","new_file":"AppleScript\/openQnA.scpt","old_contents":"-- http:\/\/www-01.ibm.com\/support\/docview.wss?uid=swg21506026\n-- https:\/\/github.com\/jgstew\/tools\/blob\/master\/bash\/openQnA.sh\n-- http:\/\/alvinalexander.com\/blog\/post\/mac-os-x\/applescript-use-comments\ntell application \"Terminal\"\n\tif not (exists window 1) then reopen\n\tactivate\n\tdo script \"\/Library\/BESAgent\/BESAgent.app\/Contents\/MacOS\/QnA -showtypes\" in window 1\nend tell\n","new_contents":"-- http:\/\/www-01.ibm.com\/support\/docview.wss?uid=swg21506026\n-- https:\/\/github.com\/jgstew\/tools\/blob\/master\/bash\/openQnA.sh\n-- http:\/\/alvinalexander.com\/blog\/post\/mac-os-x\/applescript-use-comments\ntell application \"Terminal\"\n\tif not (exists window 1) then reopen\n\tactivate\n\tdo script \"\/Library\/BESAgent\/BESAgent.app\/Contents\/MacOS\/QnA -showtypes\" in window 1\nend tell\n\n-- http:\/\/stackoverflow.com\/questions\/5288161\/converting-to-one-line-applescript\n-- osascript -e 'tell application \"Terminal\"' -e 'if not (exists window 1) then reopen' -e 'activate' -e 'do script \"\/Library\/BESAgent\/BESAgent.app\/Contents\/MacOS\/QnA -showtypes\" in window 1' -e 'end tell'\n","subject":"Update openQnA.scpt","message":"Update openQnA.scpt","lang":"AppleScript","license":"mit","repos":"jgstew\/tools,jgstew\/tools,jgstew\/tools,jgstew\/tools"}
{"commit":"e05c2c648a2b215c84cd1832023d8368bb31349c","old_file":"TotalFinder.app\/Contents\/Resources\/Scripts\/main.applescript","new_file":"TotalFinder.app\/Contents\/Resources\/Scripts\/main.applescript","old_contents":"tell application \"Finder\"\n\tdelay 1 -- this delay is important to prevent random \"Connection is Invalid -609\" AppleScript errors \n\ttry\n\t\tevent BATFinit\n\ton error msg number num\n\t\tdisplay dialog \"\nUnable to launch TotalFinder.\n\t\t\n\" & msg & \" (\" & (num as text) & \")\" & \" \n\nYou may visit \nhttp:\/\/getsatisfaction.com\/binaryage \nto get support on this issue.\" with icon 0\n\tend try\nend tell","new_contents":"tell application \"Finder\"\n\tdelay 3 -- this delay is important to prevent random \"Connection is Invalid -609\" AppleScript errors \n\ttry\n\t\tevent BATFinit\n\ton error msg number num\n\t\tdisplay dialog \"\nUnable to launch TotalFinder.\n\t\t\n\" & msg & \" (\" & (num as text) & \")\" & \" \n\nYou may visit \nhttp:\/\/getsatisfaction.com\/binaryage \nto get support on this issue.\" with icon 0\n\tend try\nend tell","subject":"increase delay before injection from 1s to 3s this could help some slower systems during system startup","message":"increase delay before injection from 1s to 3s\nthis could help some slower systems during system startup\n","lang":"AppleScript","license":"bsd-3-clause","repos":"binaryage\/totalfinder-installer"}
{"commit":"2b6069f41f0ecc505e5690153cc990ae6d7de5ad","old_file":"autoload\/applescript\/iterm.scpt","new_file":"autoload\/applescript\/iterm.scpt","old_contents":"-- execute_iterm.scpt\n-- last change: 19 Jan 2013\n---\n-- this script require an argument that represent the command to execute\n\non run argv\n\n    set command to (item 1 of argv)\n\n    tell application \"iTerm\"\n\n        try\n            set mysession to current session of current terminal\n        on error\n            set myterm to (make new terminal)\n            tell myterm\n                launch session \"rspec\"\n                set mysession to current session\n            end tell\n        end try\n\n        -- execute the command\n        tell mysession\n            write text command\n        end tell\n\n    end tell\n\nend run\n","new_contents":"-- execute_iterm.scpt\n-- last change: 19 Jan 2013\n---\n-- this script require an argument that represent the command to execute\n\non run argv\n\n    set command to (item 1 of argv)\n    tell application \"iTerm\"\n      repeat with _terminal in terminals\n        repeat with _session in (every session of _terminal whose name contains \"rspec\")\n          tell the _session\n            write text command\n          end tell\n        end repeat\n      end repeat\n    end tell\nend run\n","subject":"Change script for rspec command only","message":"Change script for rspec command only\n","lang":"AppleScript","license":"mit","repos":"chautoni\/tube.vim"}
{"commit":"abf78aefb0e57c7fc50194bc0e5b219c6bff32db","old_file":"filters\/playplaylist.applescript","new_file":"filters\/playplaylist.applescript","old_contents":"-- playplaylist filter --\n\non loadConfig()\n\n\tdo shell script \".\/compile-config.sh\"\n\tset config to load script alias ((path to library folder from user domain as text) & \"Caches:com.runningwithcrayons.Alfred-3:Workflow Data:com.calebevans.playsong:config.scpt\")\n\treturn config\n\nend loadConfig\n\non getPlaylistResultListFeedback(query)\n\n\tglobal config\n\n\tset query to trimWhitespace(query) of config\n\n\ttell application \"iTunes\"\n\n\t\t-- retrieve list of playlists matching query (ordered by relevance)\n\t\tset thePlaylists to (get user playlists whose name starts with query and name is not config's workflowPlaylistName and special kind is none and size is not 0)\n\n\t\tif length of thePlaylists < config's resultLimit then\n\n\t\t\tset thePlaylists to thePlaylists & (get user playlists whose name contains (space & query) and name does not start with query and name is not config's workflowPlaylistName and special kind is none and size is not 0)\n\n\t\tend if\n\n\t\tif length of thePlaylists < config's resultLimit then\n\n\t\t\tset thePlaylists to thePlaylists & (get user playlists whose name contains query and name does not start with query and name does not contain (space & query) and name is not config's workflowPlaylistName and special kind is none and size is not 0)\n\n\t\tend if\n\n\t\tif length of thePlaylists > config's resultLimit then\n\n\t\t\tset thePlaylists to items 1 thru (config's resultLimit) of thePlaylists\n\n\t\tend if\n\n\t\trepeat with thePlaylist in thePlaylists\n\n\t\t\tset playlistName to name of thePlaylist\n\t\t\tset playlistId to id of thePlaylist\n\t\t\tset songCount to number of tracks in thePlaylist\n\t\t\tset playlistDuration to time of thePlaylist\n\n\t\t\tset theSong to (first track in user playlist playlistName whose kind contains (songDescriptor of config))\n\t\t\tset songArtworkPath to getSongArtworkPath(theSong) of config\n\n\t\t\tset itemSubtitle to (quantifyNumber(songCount, \"song\", \"songs\") of config) & \", \" & playlistDuration & \" in length\"\n\n\t\t\taddResult({uid:(\"playlist-\" & playlistId) as text, valid:\"yes\", title:playlistName, subtitle:itemSubtitle, icon:songArtworkPath}) of config\n\n\t\tend repeat\n\n\t\tif config's resultListIsEmpty() then\n\n\t\t\taddNoResultsItem(query, \"playlist\") of config\n\n\t\tend if\n\n\tend tell\n\n\treturn getResultListFeedback() of config\n\nend getPlaylistResultListFeedback\n\nset config to loadConfig()\ngetPlaylistResultListFeedback(\"{query}\")\n","new_contents":"-- playplaylist filter --\n\non loadConfig()\n\n\tdo shell script \".\/compile-config.sh\"\n\tset config to load script alias ((path to library folder from user domain as text) & \"Caches:com.runningwithcrayons.Alfred-3:Workflow Data:com.calebevans.playsong:config.scpt\")\n\treturn config\n\nend loadConfig\n\non getPlaylistResultListFeedback(query)\n\n\tglobal config\n\n\tset query to trimWhitespace(query) of config\n\n\ttell application \"iTunes\"\n\n\t\t-- retrieve list of playlists matching query (ordered by relevance)\n\t\tset thePlaylists to (get user playlists whose name starts with query and name is not config's workflowPlaylistName and special kind is none and size is not 0)\n\n\t\tif length of thePlaylists < config's resultLimit then\n\n\t\t\tset thePlaylists to thePlaylists & (get user playlists whose name contains (space & query) and name does not start with query and name is not config's workflowPlaylistName and special kind is none and size is not 0)\n\n\t\tend if\n\n\t\tif length of thePlaylists < config's resultLimit then\n\n\t\t\tset thePlaylists to thePlaylists & (get user playlists whose name contains query and name does not start with query and name does not contain (space & query) and name is not config's workflowPlaylistName and special kind is none and size is not 0)\n\n\t\tend if\n\n\t\tif length of thePlaylists > config's resultLimit then\n\n\t\t\tset thePlaylists to items 1 thru (config's resultLimit) of thePlaylists\n\n\t\tend if\n\n\t\trepeat with thePlaylist in thePlaylists\n\n\t\t\tset playlistName to name of thePlaylist\n\t\t\tset playlistId to id of thePlaylist\n\t\t\tset songCount to number of tracks in thePlaylist\n\t\t\tset playlistDuration to time of thePlaylist\n\n\t\t\ttry\n\t\t\t\tset theSong to (first track in user playlist playlistName whose kind contains (songDescriptor of config))\n\t\t\t\tset songArtworkPath to getSongArtworkPath(theSong) of config\n\n\t\t\t\tset itemSubtitle to (quantifyNumber(songCount, \"track\", \"tracks\") of config) & \", \" & playlistDuration & \" in length\"\n\n\t\t\t\taddResult({uid:(\"playlist-\" & playlistId) as text, valid:\"yes\", title:playlistName, subtitle:itemSubtitle, icon:songArtworkPath}) of config\n\t\t\ton error number -1728\n\t\t\tend try\n\n\t\tend repeat\n\n\t\tif config's resultListIsEmpty() then\n\n\t\t\taddNoResultsItem(query, \"playlist\") of config\n\n\t\tend if\n\n\tend tell\n\n\treturn getResultListFeedback() of config\n\nend getPlaylistResultListFeedback\n\nset config to loadConfig()\ngetPlaylistResultListFeedback(\"{query}\")\n","subject":"Fix error when encountering non-music playlists","message":"Fix error when encountering non-music playlists\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"e48fd9cf6cc7ceba954a64ecebc7d9eae378b05d","old_file":"scripts\/itermcolors.applescript","new_file":"scripts\/itermcolors.applescript","old_contents":"set dateFormat to \"%H\"\nset hour to do shell script \"date +\" & (quoted form of dateFormat)\n\nif hour > 7 and hour < 19 then\n\tset tint to \"light\"\nelse\n\tset tint to \"dark\"\nend if\n\ntell application \"iTerm\"\n\tset t to current terminal\n\ttell t\n\t\tset s to current session\n\t\ttell s\n\t\t\tif tint is equal to \"light\" then\n\t\t\t\tset ansiWhiteColor to {6.003730859375E+4, 5.83269609375E+4, 5.2284546875E+4}\n\t\t\t\tset selected text color to {1.813483984375E+4, 2.337368359375E+4, 2.50989140625E+4}\n\t\t\t\tset cursor_text color to {6.003730859375E+4, 5.83269609375E+4, 5.2284546875E+4}\n\t\t\t\tset ansiBrightWhiteColor to {6.48425703125E+4, 6.277885546875E+4, 5.662616015625E+4}\n\t\t\t\tset ansiGreenColor to {2.9475974609375E+4, 3.54645859375E+4, 1324.3807373047}\n\t\t\t\tset ansiBrightBlackColor to {0.0, 7722.3891601562, 9941.8388671875}\n\t\t\t\tset ansiBrightYellowColor to {2.1257337890625E+4, 2.6684328125E+4, 2.8737466796875E+4}\n\t\t\t\tset bold color to {1.813483984375E+4, 2.337368359375E+4, 2.50989140625E+4}\n\t\t\t\tset ansiYellowColor to {4.24316015625E+4, 3.0638546875E+4, 1539.0771484375}\n\t\t\t\tset ansiBrightRedColor to {4.861141015625E+4, 1.39755361328125E+4, 4818.8168945312}\n\t\t\t\tset ansiBrightCyanColor to {3.31601796875E+4, 3.70179921875E+4, 3.6937921875E+4}\n\t\t\t\tset background color to {6.48425703125E+4, 6.277885546875E+4, 5.662616015625E+4}\n\t\t\t\tset ansiBrightGreenColor to {1.813483984375E+4, 2.337368359375E+4, 2.50989140625E+4}\n\t\t\t\tset ansiBlueColor to {8358.9130859375, 3.0320388671875E+4, 5.12689609375E+4}\n\t\t\t\tset cursor color to {2.1257337890625E+4, 2.6684328125E+4, 2.8737466796875E+4}\n\t\t\t\tset ansiBrightMagentaColor to {2.280528515625E+4, 2.22139375E+4, 4.778054296875E+4}\n\t\t\t\tset ansiMagentaColor to {5.094621484375E+4, 7079.39453125, 2.8518626953125E+4}\n\t\t\t\tset AnsiBlackColor to {0.0, 1.020768359375E+4, 1.2694220703125E+4}\n\t\t\t\tset ansiCyanColor to {9620.2333984375, 3.740892578125E+4, 3.44073671875E+4}\n\t\t\t\tset selection color to {6.003730859375E+4, 5.83269609375E+4, 5.2284546875E+4}\n\t\t\t\tset ansiBrightBlueColor to {2.887342578125E+4, 3.339855859375E+4, 3.38722890625E+4}\n\t\t\t\tset foreground color to {2.1257337890625E+4, 2.6684328125E+4, 2.8737466796875E+4}\n\t\t\t\tset ansiRedColor to {5.369084765625E+4, 7104.4169921875, 9270.392578125}\n\t\t\telse\n\t\t\t\tset ansiWhiteColor to {6.003730859375E+4, 5.83269609375E+4, 5.2284546875E+4}\n\t\t\t\tset selected text color to {3.31601796875E+4, 3.70179921875E+4, 3.6937921875E+4}\n\t\t\t\tset cursor_text color to {0.0, 1.020768359375E+4, 1.2694220703125E+4}\n\t\t\t\tset ansiBrightWhiteColor to {6.48425703125E+4, 6.277885546875E+4, 5.662616015625E+4}\n\t\t\t\tset ansiGreenColor to {2.9475974609375E+4, 3.54645859375E+4, 1324.3807373047}\n\t\t\t\tset ansiBrightBlackColor to {0.0, 7722.3891601562, 9941.8388671875}\n\t\t\t\tset ansiBrightYellowColor to {2.1257337890625E+4, 2.6684328125E+4, 2.8737466796875E+4}\n\t\t\t\tset bold color to {3.31601796875E+4, 3.70179921875E+4, 3.6937921875E+4}\n\t\t\t\tset ansiYellowColor to {4.24316015625E+4, 3.0638546875E+4, 1539.0771484375}\n\t\t\t\tset ansiBrightRedColor to {4.861141015625E+4, 1.39755361328125E+4, 4818.8168945312}\n\t\t\t\tset ansiBrightCyanColor to {3.31601796875E+4, 3.70179921875E+4, 3.6937921875E+4}\n\t\t\t\tset background color to {0.0, 7722.3891601562, 9941.8388671875}\n\t\t\t\tset ansiBrightGreenColor to {1.813483984375E+4, 2.337368359375E+4, 2.50989140625E+4}\n\t\t\t\tset ansiBlueColor to {8358.9130859375, 3.0320388671875E+4, 5.12689609375E+4}\n\t\t\t\tset cursor color to {2.887342578125E+4, 3.339855859375E+4, 3.38722890625E+4}\n\t\t\t\tset ansiBrightMagentaColor to {2.280528515625E+4, 2.22139375E+4, 4.778054296875E+4}\n\t\t\t\tset ansiMagentaColor to {5.094621484375E+4, 7079.39453125, 2.8518626953125E+4}\n\t\t\t\tset AnsiBlackColor to {0.0, 1.020768359375E+4, 1.2694220703125E+4}\n\t\t\t\tset ansiCyanColor to {9620.2333984375, 3.740892578125E+4, 3.44073671875E+4}\n\t\t\t\tset selection color to {0.0, 1.020768359375E+4, 1.2694220703125E+4}\n\t\t\t\tset ansiBrightBlueColor to {2.887342578125E+4, 3.339855859375E+4, 3.38722890625E+4}\n\t\t\t\tset foreground color to {2.887342578125E+4, 3.339855859375E+4, 3.38722890625E+4}\n\t\t\t\tset ansiRedColor to {5.369084375E+4, 7104.4233398438, 9270.3935546875}\n\t\t\tend if\n\t\tend tell\n\tend tell\nend tell\n\nreturn\n\n","new_contents":"set h to hours of (current date)\nif (h > 7) and (h < 19) then\n\tset tint to \"light\"\nelse\n\tset tint to \"dark\"\nend if\n\ntell application \"iTerm\"\n\tset t to current terminal\n\ttell t\n\t\tset s to current session\n\t\ttell s\n\t\t\tif tint is \"light\" then\n\t\t\t\tset ansiWhiteColor to {6.003730859375E+4, 5.83269609375E+4, 5.2284546875E+4}\n\t\t\t\tset selected text color to {1.813483984375E+4, 2.337368359375E+4, 2.50989140625E+4}\n\t\t\t\tset cursor_text color to {6.003730859375E+4, 5.83269609375E+4, 5.2284546875E+4}\n\t\t\t\tset ansiBrightWhiteColor to {6.48425703125E+4, 6.277885546875E+4, 5.662616015625E+4}\n\t\t\t\tset ansiGreenColor to {2.9475974609375E+4, 3.54645859375E+4, 1324.3807373047}\n\t\t\t\tset ansiBrightBlackColor to {0.0, 7722.3891601562, 9941.8388671875}\n\t\t\t\tset ansiBrightYellowColor to {2.1257337890625E+4, 2.6684328125E+4, 2.8737466796875E+4}\n\t\t\t\tset bold color to {1.813483984375E+4, 2.337368359375E+4, 2.50989140625E+4}\n\t\t\t\tset ansiYellowColor to {4.24316015625E+4, 3.0638546875E+4, 1539.0771484375}\n\t\t\t\tset ansiBrightRedColor to {4.861141015625E+4, 1.39755361328125E+4, 4818.8168945312}\n\t\t\t\tset ansiBrightCyanColor to {3.31601796875E+4, 3.70179921875E+4, 3.6937921875E+4}\n\t\t\t\tset background color to {6.48425703125E+4, 6.277885546875E+4, 5.662616015625E+4}\n\t\t\t\tset ansiBrightGreenColor to {1.813483984375E+4, 2.337368359375E+4, 2.50989140625E+4}\n\t\t\t\tset ansiBlueColor to {8358.9130859375, 3.0320388671875E+4, 5.12689609375E+4}\n\t\t\t\tset cursor color to {2.1257337890625E+4, 2.6684328125E+4, 2.8737466796875E+4}\n\t\t\t\tset ansiBrightMagentaColor to {2.280528515625E+4, 2.22139375E+4, 4.778054296875E+4}\n\t\t\t\tset ansiMagentaColor to {5.094621484375E+4, 7079.39453125, 2.8518626953125E+4}\n\t\t\t\tset AnsiBlackColor to {0.0, 1.020768359375E+4, 1.2694220703125E+4}\n\t\t\t\tset ansiCyanColor to {9620.2333984375, 3.740892578125E+4, 3.44073671875E+4}\n\t\t\t\tset selection color to {6.003730859375E+4, 5.83269609375E+4, 5.2284546875E+4}\n\t\t\t\tset ansiBrightBlueColor to {2.887342578125E+4, 3.339855859375E+4, 3.38722890625E+4}\n\t\t\t\tset foreground color to {2.1257337890625E+4, 2.6684328125E+4, 2.8737466796875E+4}\n\t\t\t\tset ansiRedColor to {5.369084765625E+4, 7104.4169921875, 9270.392578125}\n\t\t\telse\n\t\t\t\tset ansiWhiteColor to {6.003730859375E+4, 5.83269609375E+4, 5.2284546875E+4}\n\t\t\t\tset selected text color to {3.31601796875E+4, 3.70179921875E+4, 3.6937921875E+4}\n\t\t\t\tset cursor_text color to {0.0, 1.020768359375E+4, 1.2694220703125E+4}\n\t\t\t\tset ansiBrightWhiteColor to {6.48425703125E+4, 6.277885546875E+4, 5.662616015625E+4}\n\t\t\t\tset ansiGreenColor to {2.9475974609375E+4, 3.54645859375E+4, 1324.3807373047}\n\t\t\t\tset ansiBrightBlackColor to {0.0, 7722.3891601562, 9941.8388671875}\n\t\t\t\tset ansiBrightYellowColor to {2.1257337890625E+4, 2.6684328125E+4, 2.8737466796875E+4}\n\t\t\t\tset bold color to {3.31601796875E+4, 3.70179921875E+4, 3.6937921875E+4}\n\t\t\t\tset ansiYellowColor to {4.24316015625E+4, 3.0638546875E+4, 1539.0771484375}\n\t\t\t\tset ansiBrightRedColor to {4.861141015625E+4, 1.39755361328125E+4, 4818.8168945312}\n\t\t\t\tset ansiBrightCyanColor to {3.31601796875E+4, 3.70179921875E+4, 3.6937921875E+4}\n\t\t\t\tset background color to {0.0, 7722.3891601562, 9941.8388671875}\n\t\t\t\tset ansiBrightGreenColor to {1.813483984375E+4, 2.337368359375E+4, 2.50989140625E+4}\n\t\t\t\tset ansiBlueColor to {8358.9130859375, 3.0320388671875E+4, 5.12689609375E+4}\n\t\t\t\tset cursor color to {2.887342578125E+4, 3.339855859375E+4, 3.38722890625E+4}\n\t\t\t\tset ansiBrightMagentaColor to {2.280528515625E+4, 2.22139375E+4, 4.778054296875E+4}\n\t\t\t\tset ansiMagentaColor to {5.094621484375E+4, 7079.39453125, 2.8518626953125E+4}\n\t\t\t\tset AnsiBlackColor to {0.0, 1.020768359375E+4, 1.2694220703125E+4}\n\t\t\t\tset ansiCyanColor to {9620.2333984375, 3.740892578125E+4, 3.44073671875E+4}\n\t\t\t\tset selection color to {0.0, 1.020768359375E+4, 1.2694220703125E+4}\n\t\t\t\tset ansiBrightBlueColor to {2.887342578125E+4, 3.339855859375E+4, 3.38722890625E+4}\n\t\t\t\tset foreground color to {2.887342578125E+4, 3.339855859375E+4, 3.38722890625E+4}\n\t\t\t\tset ansiRedColor to {5.369084375E+4, 7104.4233398438, 9270.3935546875}\n\t\t\tend if\n\t\tend tell\n\tend tell\nend tell\n\nreturn\n","subject":"Update iTerm script to fix time issue","message":"Update iTerm script to fix time issue\n","lang":"AppleScript","license":"mit","repos":"keith\/dotfiles,keith\/dotfiles,keith\/dotfiles,keith\/dotfiles,keith\/dotfiles,keith\/dotfiles"}
{"commit":"505a0489cbfbacc752a19b4be4d04a9e986994ce","old_file":"QuickStats\/QuickStats.applescript","new_file":"QuickStats\/QuickStats.applescript","old_contents":"property pTitle : \"OmniFocus: Quick Stats\"\nproperty pVersion : \"2.07.brett\"\n\nproperty pstrDBPath : \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/com.omnigroup.OmniFocus\/OmniFocusDatabase2\"\nproperty pstrMinOSX : \"10.9\"\n\nproperty pTimeOut : 20\n\n-- Original version: https:\/\/github.com\/RobTrew\/tree-tools\/blob\/master\/OmniFocus%20scripts\/Statistics\/QuickStats.applescript\n\n-- Copyright  2012, 2013, 2014 Robin Trew\n-- \n-- Permission is hereby granted, free of charge, \n-- to any person obtaining a copy of this software \n-- and associated documentation files (the \"Software\"), \n-- to deal in the Software without restriction, \n-- including without limitation the rights to use, copy, \n-- modify, merge, publish, distribute, sublicense, \n-- and\/or sell copies of the Software, and to permit persons \n-- to whom the Software is furnished to do so, \n-- subject to the following conditions:\n-- \n-- *******\n-- The above copyright notice and this permission notice \n-- shall be included in ALL copies \n-- or substantial portions of the Software.\n-- *******\n-- \n-- THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, \n-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES \n-- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \n-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \n-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, \n-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE \n-- OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n-- Ver 0.8 adds clipboard option to dialogue\n-- Ver 0.9 gives an error message if the cache schema has changed, leading to an SQL error in the script\n-- Ver 1.0 slight simplification of the code\n-- Ver 1.1 added count of Pending projects\n-- Ver 1.2 added a count of available actions\n-- Ver 1.3 added a break-down of unavailable actions\n-- Ver 1.4 added count of Current projects to complement Pending projects\n-- ver 1.5 replaced Applescript time function with SQL time expression\n-- Ver 1.7 Reorganizes menu, and attempts to enable access for .macappstore installations of OF\n--Ver 1.8 Adjusts handling of variant bundle identifiers generally\n-- Ver 2.00 Redraft of task breakdown, with progressive narrowing of criteria ...\n\nproperty pToClipboard : \"Copy list to clipboard\"\n\nif not FileExists(pstrDBPath) then set pstrDBPath to GetCachePath()\n\ntell application \"Finder\"\n\tif (version < pstrMinOSX) then\n\t\tdisplay dialog \"This script requires OSX \" & pstrMinOSX & \" or higher\" buttons {\"OK\"} default button 1 with title pTitle & \"Ver. \" & pVersion\n\t\treturn\n\tend if\nend tell\n\nif pstrDBPath  \"\" then\n\tset inbox_cmd to \"\n\tselect 'INBOX GROUPS & ACTIONS', count(*) from task where (inInbox=1);\n\tselect '    Inbox action groups', count(*) from task where (inInbox=1) and (childrenCount>0);\n\tselect '    Inbox actions', count(*) from task where (inInbox=1) and (childrenCount=0);\n\tselect null;\n\t\"\n\tset folders_cmd to \"\n\tselect 'FOLDERS'\t, count(*) from folder;\n\tselect '    Active folders', count(*) from folder where effectiveActive=1;\n\tselect '    Dropped folders', count(*) from folder where effectiveActive=0;\n\tselect null;\n\t\"\n\tset projects_cmd to \"\n\tselect 'PROJECTS', count(*) from projectInfo where containsSingletonActions=0;\n\tselect '    Active projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='active');\n\tselect '            Current projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart is null or t.dateToStart < (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '            Pending projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart > (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '    On-hold projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='inactive');\n\tselect '    Completed projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='done');\n\tselect '    Dropped projects', count(*) from projectInfo where (containsSingletonActions=0) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset lists_cmd to \"\n\tselect 'SINGLE ACTION LISTS', count(*) from projectInfo where containsSingletonActions=1;\n\tselect '    Active single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='active');\n\tselect '    On-hold single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='inactive');\n\tselect '    Completed single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='done');\n\tselect '    Dropped single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset contexts_cmd to \"\n\tselect 'CONTEXTS', count(*) from context;\n\tselect '    Active contexts', count(*) from context where (effectiveActive=1) and (allowsNextAction=1);\n\tselect '    On-hold contexts', count(*) from context where (effectiveActive=1) and allowsNextAction=0;\n\tselect '    Dropped contexts', count(*) from context where effectiveActive=0;\n\tselect null;\n\t\"\n\tset groups_cmd to \"\n\tselect 'ACTION GROUPS', count(*) from task where (projectinfo is null) and (childrenCount>0);\n\tselect '    Remaining action groups', count(*) from task where (projectinfo is null) and (dateCompleted is null) and (childrenCount>0);\n\tselect '    Completed action groups', count(dateCompleted) from task where (projectinfo is null) and (childrenCount>0);\n\tselect null;\n\t\"\n\tset actions_cmd to \"\n\tselect 'ACTIONS', count(*) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Completed actions', count(dateCompleted) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Dropped project actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp where (projectinfo is null) and (childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is not null and (tp.status='dropped' or tp.folderEffectiveActive=0));\n\tselect '    Dropped context actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand c.effectiveActive= 0;\n\tselect '    Remaining actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1);\n\tselect '        Actions in Projects on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is not null and tp.status='inactive');\n\tselect '        Actions in Contexts on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is not null and c.allowsNextAction=0);\n\tselect '        Blocked actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1;\n\tselect '        \tBlocked by future start date', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=1;\n\tselect '        \tSequentially blocked', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=0;\n\tselect '        Available actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=0;\n\tselect null;\n\t\"\n\tset summary_cmd to \"\n\tselect 'SUMMARY';\n\tselect '    Inbox available actions', count(*) from task where (inInbox=1) and (dateCompleted is null);\n\tselect '    Due in next week', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01');\n\tselect '    Flagged projects and actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand tp.effectiveFlagged;\n\tselect '    Due or Flagged', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand (tp.effectiveFlagged or (effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01')));\n\tselect null;\n\t\"\n\tset commands to inbox_cmd & folders_cmd & projects_cmd & lists_cmd & contexts_cmd & groups_cmd & actions_cmd & summary_cmd\n\tset strCmd to \"sqlite3 -separator ': ' \\\"\" & pstrDBPath & \"\\\" \" & quoted form of (commands)\n\t\n\t-- \t\ttry\n\tset strList to do shell script strCmd\n\t-- \t\ton error\n\t-- \t\t\tdisplay dialog \"The SQL schema for the OmniFocus cache may have changed in a recent update of OF.\" & return & return & \n\t-- \t\t\t\t\"Look on the OmniFocus user forums for an updated version of this script.\" buttons {\"OK\"} with title pTitle & \"Ver. \" & pVersion\n\t-- \t\t\treturn\n\t-- \t\tend try\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tif button returned of (display dialog strList buttons {pToClipboard, \"OK\"} default button \"OK\" giving up after pTimeOut with title pTitle & \" Ver. \" & pVersion) \n\t\t\tis pToClipboard then tell application id \"com.apple.finder\" to set the clipboard to strList\n\tend tell\nelse\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tdisplay dialog \"OmniFocus cache not found ...\" buttons {\"OK\"} default button 1 with title pTitle & \" Ver. \" & pVersion\n\tend tell\nend if\n\n\non FileExists(strPath)\n\t(do shell script \"test -e \" & strPath & \" ; echo $?\") = \"0\"\nend FileExists\n\non GetCachePath()\n\ttry\n\t\ttell application \"Finder\" to tell (application file id \"OFOC\") to \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/\" & its id & \"\/OmniFocusDatabase2\"\n\ton error\n\t\terror \"OmniFocus not installed ...\"\n\tend try\nend GetCachePath\n\n","new_contents":"property pTitle : \"OmniFocus: Quick Stats\"\nproperty pVersion : \"2.07.brett\"\n\nproperty pstrDBPath : \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/com.omnigroup.OmniFocus\/OmniFocusDatabase2\"\nproperty pstrMinOSX : \"10.9\"\n\nproperty pTimeOut : 20\n\n-- Original version: https:\/\/github.com\/RobTrew\/tree-tools\/blob\/master\/OmniFocus%20scripts\/Statistics\/QuickStats.applescript\n\n-- Copyright  2012, 2013, 2014 Robin Trew\n-- \n-- Permission is hereby granted, free of charge, \n-- to any person obtaining a copy of this software \n-- and associated documentation files (the \"Software\"), \n-- to deal in the Software without restriction, \n-- including without limitation the rights to use, copy, \n-- modify, merge, publish, distribute, sublicense, \n-- and\/or sell copies of the Software, and to permit persons \n-- to whom the Software is furnished to do so, \n-- subject to the following conditions:\n-- \n-- *******\n-- The above copyright notice and this permission notice \n-- shall be included in ALL copies \n-- or substantial portions of the Software.\n-- *******\n-- \n-- THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, \n-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES \n-- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \n-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \n-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, \n-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE \n-- OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n-- Ver 0.8 adds clipboard option to dialogue\n-- Ver 0.9 gives an error message if the cache schema has changed, leading to an SQL error in the script\n-- Ver 1.0 slight simplification of the code\n-- Ver 1.1 added count of Pending projects\n-- Ver 1.2 added a count of available actions\n-- Ver 1.3 added a break-down of unavailable actions\n-- Ver 1.4 added count of Current projects to complement Pending projects\n-- ver 1.5 replaced Applescript time function with SQL time expression\n-- Ver 1.7 Reorganizes menu, and attempts to enable access for .macappstore installations of OF\n--Ver 1.8 Adjusts handling of variant bundle identifiers generally\n-- Ver 2.00 Redraft of task breakdown, with progressive narrowing of criteria ...\n\nproperty pToClipboard : \"Copy list to clipboard\"\n\nif not FileExists(pstrDBPath) then set pstrDBPath to GetCachePath()\n\ntell application \"Finder\"\n\tif (version < pstrMinOSX) then\n\t\tdisplay dialog \"This script requires OSX \" & pstrMinOSX & \" or higher\" buttons {\"OK\"} default button 1 with title pTitle & \"Ver. \" & pVersion\n\t\treturn\n\tend if\nend tell\n\nif pstrDBPath  \"\" then\n\tset inbox_cmd to \"\n\tselect 'INBOX GROUPS & ACTIONS', count(*) from task where (inInbox=1);\n\tselect '    Inbox action groups', count(*) from task where (inInbox=1) and (childrenCount>0);\n\tselect '    Inbox actions', count(*) from task where (inInbox=1) and (childrenCount=0);\n\tselect null;\n\t\"\n\tset folders_cmd to \"\n\tselect 'FOLDERS'\t, count(*) from folder;\n\tselect '    Active folders', count(*) from folder where effectiveActive=1;\n\tselect '    Dropped folders', count(*) from folder where effectiveActive=0;\n\tselect null;\n\t\"\n\tset projects_cmd to \"\n\tselect 'PROJECTS', count(*) from projectInfo where containsSingletonActions=0;\n\tselect '    Active projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='active');\n\tselect '            Current projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart is null or t.dateToStart < (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '            Pending projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart > (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '    On-hold projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='inactive');\n\tselect '    Completed projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='done');\n\tselect '    Dropped projects', count(*) from projectInfo where (containsSingletonActions=0) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset lists_cmd to \"\n\tselect 'SINGLE ACTION LISTS', count(*) from projectInfo where containsSingletonActions=1;\n\tselect '    Active single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='active');\n\tselect '    On-hold single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='inactive');\n\tselect '    Completed single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='done');\n\tselect '    Dropped single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset contexts_cmd to \"\n\tselect 'CONTEXTS', count(*) from context;\n\tselect '    Active contexts', count(*) from context where (effectiveActive=1) and (allowsNextAction=1);\n\tselect '    On-hold contexts', count(*) from context where (effectiveActive=1) and allowsNextAction=0;\n\tselect '    Dropped contexts', count(*) from context where effectiveActive=0;\n\tselect null;\n\t\"\n\tset groups_cmd to \"\n\tselect 'ACTION GROUPS', count(*) from task where (projectinfo is null) and (childrenCount>0);\n\tselect '    Remaining action groups', count(*) from task where (projectinfo is null) and (dateCompleted is null) and (childrenCount>0);\n\tselect '    Completed action groups', count(dateCompleted) from task where (projectinfo is null) and (childrenCount>0);\n\tselect null;\n\t\"\n\tset tasks_cmd to \"\n\tselect 'ALL TASKS', count(*) from task;\n\tselect null;\n\t\"\n\tset actions_cmd to \"\n\tselect 'ACTIONS', count(*) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Completed actions', count(dateCompleted) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Dropped project actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp where (projectinfo is null) and (childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is not null and (tp.status='dropped' or tp.folderEffectiveActive=0));\n\tselect '    Dropped context actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand c.effectiveActive= 0;\n\tselect '    Remaining actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1);\n\tselect '        Actions in Projects on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is not null and tp.status='inactive');\n\tselect '        Actions in Contexts on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is not null and c.allowsNextAction=0);\n\tselect '        Blocked actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1;\n\tselect '        \tBlocked by future start date', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=1;\n\tselect '        \tSequentially blocked', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=0;\n\tselect '        Available actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=0;\n\tselect null;\n\t\"\n\tset summary_cmd to \"\n\tselect 'SUMMARY';\n\tselect '    Inbox available actions', count(*) from task where (inInbox=1) and (dateCompleted is null);\n\tselect '    Due in next week', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01');\n\tselect '    Flagged projects and actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand tp.effectiveFlagged;\n\tselect '    Due or Flagged', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand (tp.effectiveFlagged or (effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01')));\n\tselect null;\n\t\"\n\tset commands to inbox_cmd & folders_cmd & projects_cmd & lists_cmd & contexts_cmd & groups_cmd & actions_cmd & tasks_cmd & summary_cmd\n\tset strCmd to \"sqlite3 -separator ': ' \\\"\" & pstrDBPath & \"\\\" \" & quoted form of (commands)\n\t\n\t-- \t\ttry\n\tset strList to do shell script strCmd\n\t-- \t\ton error\n\t-- \t\t\tdisplay dialog \"The SQL schema for the OmniFocus cache may have changed in a recent update of OF.\" & return & return & \n\t-- \t\t\t\t\"Look on the OmniFocus user forums for an updated version of this script.\" buttons {\"OK\"} with title pTitle & \"Ver. \" & pVersion\n\t-- \t\t\treturn\n\t-- \t\tend try\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tif button returned of (display dialog strList buttons {pToClipboard, \"OK\"} default button \"OK\" giving up after pTimeOut with title pTitle & \" Ver. \" & pVersion) \n\t\t\tis pToClipboard then tell application id \"com.apple.finder\" to set the clipboard to strList\n\tend tell\nelse\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tdisplay dialog \"OmniFocus cache not found ...\" buttons {\"OK\"} default button 1 with title pTitle & \" Ver. \" & pVersion\n\tend tell\nend if\n\n\non FileExists(strPath)\n\t(do shell script \"test -e \" & strPath & \" ; echo $?\") = \"0\"\nend FileExists\n\non GetCachePath()\n\ttry\n\t\ttell application \"Finder\" to tell (application file id \"OFOC\") to \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/\" & its id & \"\/OmniFocusDatabase2\"\n\ton error\n\t\terror \"OmniFocus not installed ...\"\n\tend try\nend GetCachePath\n\n","subject":"add all tasks to stats","message":"add all tasks to stats\n","lang":"AppleScript","license":"apache-2.0","repos":"brettporter\/omnifocus-tools"}
{"commit":"da6f742cdf9d345cf699279bcd138ea533548221","old_file":"recall.applescript","new_file":"recall.applescript","old_contents":"#!\/usr\/bin\/env osascript\n\nset journal to \"~\/ia\/Journal\/Journal.md\"\ntell application \"Terminal\"\n\tset lineCount to (do shell script \"wc -l < \" & journal) as integer\n\tset randomLine to (random number from 1 to lineCount) as integer\n\tactivate\n\tdo script \"vim -c ':call ToggleBackground()' -c ':Goyo' -c '\" & randomLine & \"' \" & journal\n\ttell application \"System Events\" to keystroke \"f\" using {command down, control down}\nend tell\n","new_contents":"#!\/usr\/bin\/env osascript\n\nset journal to \"~\/ia\/Journal\/Journal.md\"\ntell application \"Terminal\"\n\tset lineCount to (do shell script \"wc -l < \" & journal) as integer\n\tset randomLine to (random number from 1 to lineCount) as integer\n\tactivate\n\tdo script \"vim -c ':Goyo' -c ':set bg=light' \" & journal & \":\" & randomLine\n\tset current settings of first window to settings set \"Solarized Light\"\n\ttell application \"System Events\" to keystroke \"f\" using {command down, control down}\nend tell\n","subject":"Fix recall script to set background more reliably","message":"Fix recall script to set background more reliably\n","lang":"AppleScript","license":"mit","repos":"mk12\/scripts,mk12\/scripts,mk12\/scripts,mk12\/scripts"}
{"commit":"54fd72486a414cd105d6654e7a8e73bd01fde75a","old_file":"connector-osx-kn.scpt","new_file":"connector-osx-kn.scpt","old_contents":"--\n--  slideshow -- Observe and Control Slideshow Applications\n--  Copyright (c) 2014 Ralf S. Engelschall <http:\/\/engelschall.com>\n--\n--  This Source Code Form is subject to the terms of the Mozilla Public\n--  License (MPL), version 2.0. If a copy of the MPL was not distributed\n--  with this file, You can obtain one at http:\/\/mozilla.org\/MPL\/2.0\/.\n--\n--  File:     connector-osx-keynote.js\n--  Purpose:  connector engine for Apple Keynote under Mac OS X\n--  Language: AppleScript\n--\n\n--  utility function\non offsetOf(theString, subString)\n    if theString does not contain subString then\n        return 0\n    end if\n    set stringCharacterCount    to (get count of characters in theString)\n    set substringCharacterCount to (get count of characters in subString)\n    set lastCharacter to (stringCharacterCount - substringCharacterCount + 1)\n    repeat with n from 1 to lastCharacter\n        set m to (n + substringCharacterCount) - 1\n        set currentSubstring to (get characters n thru m of theString) as string\n        if currentSubstring is subString then\n            return n\n        end if\n    end repeat\n    return 0\nend offsetOf\n\n--  get Apple Keynote current slide\non knGetCurSlide()\n    try\n        tell application \"Keynote\"\n            return (get slide number of current slide of front document)\n        end tell\n    on error errMsg\n        return 0\n    end try\nend knGetCurSlide\n\n--  get Apple Keynote maximum slide\non knGetMaxSlide()\n    try\n        tell application \"Keynote\"\n            return (get count of slides of front document)\n        end tell\n    on error errMsg\n        return 0\n    end try\nend knGetMaxSlide\n\n--  get Apple Keynote current slide\non knGetSlideInfo()\n    try\n        tell application \"Keynote\"\n            set thePresentation to front document\n            set slideCount to (get count of slides of thePresentation)\n            set slideInfo to \"[ \"\n            repeat with slideNum from 1 to slideCount\n                set theSlide to slide slideNum of thePresentation\n                set theNote to \"\"\n                repeat with theChars in (presenter notes of theSlide)\n                    set theText to (\"\" & (theChars as string) & \"\")\n                    set offStart to my offsetOf(theText, \"TK<\")\n                    if offStart is not 0 then\n                        set offStart to (offStart + 3)\n                        set tmp to (get characters offStart thru ((get count of characters in theText)) of theText) as string\n                        set offEnd to my offsetOf(tmp, \">\")\n                        if offEnd is not 0 and offENd is not 1 then\n                            set theNote to (get characters offStart thru (offStart + (offEnd - 1) - 1) of theText) as string\n                            exit repeat\n                        end if\n                    end if\n                end repeat\n                if slideInfo is \"[ \" then\n                    set slideInfo to (slideInfo & \"\\\"\" & theNote & \"\\\"\")\n                else\n                    set slideInfo to (slideInfo & \", \\\"\" & theNote & \"\\\"\")\n                end if\n            end repeat\n            set slideInfo to (slideInfo & \" ]\")\n            return slideInfo\n        end tell\n    on error errMsg\n        return \"[]\"\n    end try\nend knGetSlideInfo\n\n--  get Apple Keynote slide titles\non knGetSlideTitles()\n    -- try\n        tell application \"Keynote\"\n            set thePresentation to front document\n            set slideCount to (get count of slides of thePresentation)\n            set slideTitles to \"[ \"\n            repeat with slideNum from 1 to slideCount\n                set theSlide to slide slideNum of thePresentation\n                set theTitle to object text of default title item of theSlide\n                if slideTitles is \"[ \" then\n                    set slideTitles to (slideTitles & \"\\\"\" & theTitle & \"\\\"\")\n                else\n                    set slideTitles to (slideTitles & \", \\\"\" & theTitle & \"\\\"\")\n                end if\n            end repeat\n            set slideTitles to (slideTitles & \" ]\")\n            return slideTitles\n        end tell\n    -- on error errMsg\n        return 0\n    -- end try\nend knGetCurSlide\n\n--  control slide show\non knSlideShowControl(command, arg)\n    tell application \"Keynote\"\n        if command is \"START\" then\n            start (front document) from (slide 1 of front document)\n        else if command is \"NEXT\" then\n            show next\n        else if command is \"GOTO\" then\n            show slide (arg as integer) of front document\n        else if command is \"PREV\" then\n            show previous\n        else if command is \"STOP\" then\n            stop front document\n        end if\n    end tell\nend knSlideShowControl\n\n--  main procedure\non run argv\n    set cmd to item 1 of argv\n    set arg to \"\"\n    if count of argv is 2 then\n        set arg to item 2 of argv\n    end if\n    if cmd is \"STAT\" then\n        set curSlide to knGetCurSlide()\n        set maxSlide to knGetMaxSlide()\n        set output to (\"{ \\\"curSlide\\\": \" & curSlide & \", \\\"maxSlide\\\": \" & maxSlide & \" }\")\n    else if cmd is \"INFO\" then\n        set slideInfo to knGetSlideInfo()\n        set output to (\"{ \\\"slideInfo\\\": \" & slideInfo & \" }\")\n    else if cmd is \"TITLES\" then\n        set theTitles to knGetSlideTitles()\n        set output to (\"{ \\\"titles\\\": \" & theTitles & \" }\")\n    else if cmd is \"START\" or cmd is \"NEXT\" or cmd is \"GOTO\" or cmd is \"PREV\" or cmd is \"STOP\" then\n        my knSlideShowControl(cmd, arg)\n        set output to \"{}\"\n    end if\n    copy output to stdout\nend run\n\n","new_contents":"--\n--  slideshow -- Observe and Control Slideshow Applications\n--  Copyright (c) 2014 Ralf S. Engelschall <http:\/\/engelschall.com>\n--\n--  This Source Code Form is subject to the terms of the Mozilla Public\n--  License (MPL), version 2.0. If a copy of the MPL was not distributed\n--  with this file, You can obtain one at http:\/\/mozilla.org\/MPL\/2.0\/.\n--\n--  File:     connector-osx-kn.js\n--  Purpose:  connector engine for Apple Keynote 5 under Mac OS X\n--  Language: AppleScript\n--\n\n--  utility function\non filterText(this_text, allowed_chars)\n   set new_text to \"\"\n   repeat with this_char in this_text\n       set x to the offset of this_char in allowed_chars\n       if x is not 0 then\n           set new_text to (new_text & this_char) as string\n       end if\n   end repeat\n   return new_text\nend filterText\n\n--  utility function\non replaceText(this_text, search_string, replacement_string)\n   set AppleScript's text item delimiters to the search_string\n   set the item_list to every text item of this_text\n   set AppleScript's text item delimiters to the replacement_string\n   set this_text to the item_list as string\n   set AppleScript's text item delimiters to \"\"\n   return this_text\nend replace_chars\n\n--  utility function\non asciiCharset()\n    set charset to \" \\\"'!#$%()*+,-.\/:;<=>?@[\\\\]^_{|}~\"\n    set charset to (charset & \"0123456789\")\n    set charset to (charset & \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\")\n    set charset to (charset & \"abcdefghijklmnopqrstuvwxyz\")\n    return charset\nend asciiCharset\n\n--  get application state\non knGetState()\n    set state to \"closed\"\n    tell application \"System Events\"\n        set is_running to (exists (some process whose name is \"Keynote\"))\n    end tell\n    if is_running then\n       try\n            set state to \"running\"\n            tell application \"Keynote\"\n                if playing then\n                    set state to \"viewing\"\n                else if (get count of slides of front document) > 0 then\n                    set state to \"editing\"\n                end if\n            end tell\n        on error errMsg\n        end try\n    end if\n    return state\nend knGetState\n\n--  get Apple Keynote current slide\non knGetCurSlide()\n    try\n        tell application \"Keynote\"\n            if playing then\n                return (get slide number of current slide of front document)\n            else\n                return (get slide number of current slide of front document)\n            end if\n        end tell\n    on error errMsg\n        return 0\n    end try\nend knGetCurSlide\n\n--  get Apple Keynote maximum slide\non knGetMaxSlide()\n    try\n        tell application \"Keynote\"\n            return (get count of slides of front document)\n        end tell\n    on error errMsg\n        return 0\n    end try\nend knGetMaxSlide\n\n--  the STATE command\non cmdSTATE()\n    set state to knGetState()\n    if state is \"closed\" then\n        set position to 0\n        set slides to 0\n    else\n        set position to knGetCurSlide()\n        set slides to knGetMaxSlide()\n    end if\n    return (\"{ \\\"response\\\": { \" & \u00ac\n        \"\\\"state\\\": \\\"\" & state & \"\\\", \" & \u00ac\n        \"\\\"position\\\": \" & position & \", \" & \u00ac\n        \"\\\"slides\\\": \" & slides & \" \" & \u00ac\n    \"} }\")\nend cmdSTATE\n\n--  the INFO command\non cmdINFO()\n    set output to \"\"\n    if knGetMaxSlide() is 0 then\n        error \"still no active presentation\"\n    end if\n    tell application \"Keynote\"\n        set thePresentation to front document\n        set theTitles to \"\"\n        set theNotes to \"\"\n        set slideCount to (get count of slides of thePresentation)\n        repeat with slideNum from 1 to slideCount\n            set theSlide to slide slideNum of thePresentation\n\n            set theTitle to (title of theSlide) as string\n            if theTitles is not \"\" then\n                set theTitles to (theTitles & \", \")\n            end if\n            set theTitles to (theTitles & \"\\\"\" & (my replaceText(theTitle, \"\\\"\", \"\\\\\\\"\")) & \"\\\"\")\n\n            set theNote to (notes of theSlide) as string\n            set theNote to (my filterText(theNote, my asciiCharset()))\n            if theNotes is not \"\" then\n                set theNotes to (theNotes & \", \")\n            end if\n            set theNotes to (theNotes & \"\\\"\" & (my replaceText(theNote, \"\\\"\", \"\\\\\\\"\")) & \"\\\"\")\n\n        end repeat\n        set theTitles to (\"[ \" & theTitles & \" ]\")\n        set theNotes to (\"[ \" & theNotes & \" ]\")\n        set output to (\"{ \\\"response\\\": { \\\"titles\\\": \" & theTitles & \", \\\"notes\\\": \" & theNotes & \" } }\")\n    end tell\n    return output\nend cmdINFO\n\n--  the control commands\non cmdCTRL(command, arg)\n    set state to knGetState()\n    if command is \"BOOT\" then\n        if state is not \"closed\" then\n            error \"application already running\"\n        end if\n        tell application \"Keynote\"\n            activate\n        end tell\n    else if command is \"QUIT\" then\n        if state is \"closed\" then\n            error \"application already closed\"\n        end if\n        tell application \"Keynote\"\n            quit\n        end tell\n    else if command is \"OPEN\" then\n        if state is \"editing\" or state is \"viewing\" then\n            error \"active presentation already existing\"\n        end if\n        tell application \"Keynote\"\n            tell application \"Finder\" to set thePath to \u00ac\n                POSIX file (POSIX path of (container of (path to me) as string) & (arg)) as alias\n            open thePath\n        end tell\n    else if command is \"CLOSE\" then\n        if state is \"closed\" or state is \"running\" then\n            error \"still no active presentation\"\n        end if\n        tell application \"Keynote\"\n            close front document\n        end tell\n    else if command is \"START\" then\n        if state is \"closed\" or state is \"running\" then\n            error \"still no active presentation\"\n        end if\n        if state is \"viewing\" then\n            error \"active presentation already viewing\"\n        end if\n        tell application \"Keynote\"\n            start from (slide 1 of front document)\n        end tell\n    else if command is \"STOP\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            stop slideshow (slideshow 1)\n        end tell\n    else if command is \"PAUSE\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            activate\n            tell application \"System Events\" to keystroke \"b\"\n        end tell\n    else if command is \"RESUME\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            activate\n            tell application \"System Events\" to keystroke \"b\"\n        end tell\n    else if command is \"FIRST\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show (item 1 of slides of slideshow 1)\n        end tell\n    else if command is \"LAST\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show (item (get count of slides of slideshow 1) of slides of slideshow 1)\n        end tell\n    else if command is \"GOTO\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show (item (arg as integer) of slides of slideshow 1)\n        end tell\n    else if command is \"PREV\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show previous\n        end tell\n    else if command is \"NEXT\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show next\n        end tell\n    end if\n    return \"{ \\\"result\\\": \\\"OK\\\" }\"\nend cmdCTRL\n\n--  main procedure\non run argv\n    set cmd to item 1 of argv\n    set arg to \"\"\n    if count of argv is 2 then\n        set arg to item 2 of argv\n    end if\n    try\n        if cmd is \"STAT\" then\n            set output to cmdSTATE()\n        else if cmd is \"INFO\" then\n            set output to cmdINFO()\n        else if cmd is \"BOOT\" \u00ac\n            or cmd is \"QUIT\" \u00ac\n            or cmd is \"OPEN\" \u00ac\n            or cmd is \"CLOSE\" \u00ac\n            or cmd is \"START\" \u00ac\n            or cmd is \"STOP\" \u00ac\n            or cmd is \"PAUSE\" \u00ac\n            or cmd is \"RESUME\" \u00ac\n            or cmd is \"FIRST\" \u00ac\n            or cmd is \"LAST\" \u00ac\n            or cmd is \"GOTO\" \u00ac\n            or cmd is \"PREV\" \u00ac\n            or cmd is \"NEXT\" then\n            set output to cmdCTRL(cmd, arg)\n        else\n            set output to \"{ \\\"error\\\": \\\"invalid command\\\" }\"\n        end if\n    on error errMsg\n        set output to (\"{ \\\"error\\\": \\\"\" & errMsg & \"\\\" }\")\n    end try\n    copy output to stdout\nend run\n\n","subject":"align the Keynote (5) scripting to the PowerPoint variants","message":"align the Keynote (5) scripting to the PowerPoint variants\n","lang":"AppleScript","license":"mpl-2.0","repos":"rse\/slideshow,rse\/slideshow"}
{"commit":"77d69cb4ba40a92646584137acded2cb0f0752a2","old_file":"source\/Reminders\/RemindersNewItem.applescript","new_file":"source\/Reminders\/RemindersNewItem.applescript","old_contents":"on sortList(unsortedList)\n\tset oldDelimiters to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to (ASCII character 10)\n\tset sortedList to paragraphs of (do shell script \"echo \" & quoted form of (unsortedList as string) & \"| sort  -d -f\")\n\tset AppleScript's text item delimiters to oldDelimiters\n\treturn sortedList\nend sortList\n\n-- sort the list\ntell application \"Reminders\"\n\tactivate\n\tget the name of every account\n\tset theAccount to name of first account\n\ttell account theAccount\n\t\tset allLists to the name of every list\n\tend tell\nend tell\nset sortedList to sortList(allLists)\nset theList to first item of sortedList\n\ntell application \"Reminders\"\n\ttell account theAccount to set myReminder to (make new reminder at list theList with properties {name:\"{popclip text}\"})\nend tell","new_contents":"tell application \"Reminders\"\n\tactivate\n\tset theAccount to name of first account\n\ttell account theAccount\n\t\tset theList to name of first list\n\t\tset myReminder to (make new reminder at list theList with properties {name:\"{popclip text}\"})\n\tend tell\nend tell","subject":"revert reminders change","message":"revert reminders change\n","lang":"AppleScript","license":"mit","repos":"dreki\/PopClip-Extensions,a-b\/PopClip-Extensions,a-b\/PopClip-Extensions,Kapeli\/PopClip-Extensions,dreki\/PopClip-Extensions,Kapeli\/PopClip-Extensions,onecrayon\/PopClip-Extensions,bopo\/PopClip-Extensions,chenruixuan\/PopClip-Extensions,chenruixuan\/PopClip-Extensions,Kapeli\/PopClip-Extensions,bopo\/PopClip-Extensions,onecrayon\/PopClip-Extensions,chenruixuan\/PopClip-Extensions,bopo\/PopClip-Extensions,Kapeli\/PopClip-Extensions,bopo\/PopClip-Extensions,a-b\/PopClip-Extensions,dreki\/PopClip-Extensions,Kapeli\/PopClip-Extensions,dreki\/PopClip-Extensions,onecrayon\/PopClip-Extensions,Kapeli\/PopClip-Extensions,bopo\/PopClip-Extensions,onecrayon\/PopClip-Extensions,onecrayon\/PopClip-Extensions,onecrayon\/PopClip-Extensions,a-b\/PopClip-Extensions,chenruixuan\/PopClip-Extensions,a-b\/PopClip-Extensions,chenruixuan\/PopClip-Extensions,dreki\/PopClip-Extensions,chenruixuan\/PopClip-Extensions,bopo\/PopClip-Extensions,dreki\/PopClip-Extensions,a-b\/PopClip-Extensions"}
{"commit":"4f3a6101b7abad5e9052acaea45efb35ff1b21d2","old_file":"Scripts\/reset-simulator.applescript","new_file":"Scripts\/reset-simulator.applescript","old_contents":"tell application \"iPhone Simulator\"\n\tactivate\nend tell\n\ntell application \"System Events\"\n\ttell process \"iPhone Simulator\"\n\t\ttell menu bar 1\n\t\t\ttell menu bar item \"iOs Simulator\"\n\t\t\t\ttell menu \"iOs Simulator\"\n\t\t\t\t\tclick menu item \"Reset Content and Settings\u2026\"\n\t\t\t\tend tell\n\t\t\tend tell\n\t\tend tell\n\t\ttell window 1\n\t\t\tclick button \"Reset\"\n\t\tend tell\n\tend tell\nend tell","new_contents":"tell application \"iPhone Simulator\"\n\tactivate\nend tell\n\ntell application \"System Events\"\n\ttell process \"iPhone Simulator\"\n\t\ttell menu bar 1\n\t\t\ttell menu bar item \"iOs Simulator\"\n\t\t\t\ttell menu \"iOs Simulator\"\n\t\t\t\t\tclick menu item \"Reset Content and Settings\u2026\"\n\t\t\t\tend tell\n\t\t\tend tell\n\t\tend tell\n\t\ttell window 1\n\t\t\tclick button \"Reset\"\n\t\tend tell\n\tend tell\nend tell\n","subject":"Update Scripts\/reset-simulator.applescript","message":"Update Scripts\/reset-simulator.applescript\n\nadd ending new line","lang":"AppleScript","license":"mit","repos":"blazingcloud\/sealant,blazingcloud\/sealant,blazingcloud\/sealant,blazingcloud\/sealant"}
{"commit":"a4a75d63dfb60cbcb9568081cf922b90651d1a38","old_file":"keynote.applescript","new_file":"keynote.applescript","old_contents":"on newPresentation(themeName)\n\ttell application \"Keynote\"\n\t\tactivate\n\t\t-- FIXME: Make this selectable?\n\t\tset targetWidth to 1024 -- 1440 <-- higher resolution\n\t\tset targetHeight to 768 -- 1080 <-- higher resolution\n\n\t\tset props to {document theme:theme (themeName as string), width:targetWidth, height:targetHeight}\n\n\t\tset thisDocument to make new document with properties props\n\t\treturn name of thisDocument\n\tend tell\nend newPresentation\n\n\non savePresentation(docname, posixPath)\n\ttell application \"Keynote\"\n\t\tsave document named docname in POSIX file posixPath\n\tend tell\nend savePresentation\t\n\non createSlide(docname, masterSlideName, thisSlideTitle, thisSlideBody)\n\ttry\n\t\ttell application \"Keynote\"\n\t\t\ttell document named docname\n\t\t\t\tset thisSlide to make new slide with properties {base slide:master slide masterSlideName}\n\t\t\t\ttell thisSlide\n\t\t\t\t\t-- set the transition properties to {transition effect:dissolve, transition duration:defaultTransitionDuration, transition delay:defaultTransitionDelay, automatic transition:defaultAutomaticTransition}\n\t\t\t\t\tif title showing is true then\n\t\t\t\t\t\tset the object text of the default title item to thisSlideTitle\n\t\t\t\t\tend if\n\t\t\t\t\tif body showing is true then\n\t\t\t\t\t\tset the object text of the default body item to thisSlideBody\n\t\t\t\t\tend if\n\t\t\t\tend tell\n\t\t\tend tell\n\t  return thisSlide\n\t\tend tell\n\ton error\n\t\treturn 0\n\tend try\nend createSlide\n\non finalize(docname)\n\ttell application \"Keynote\"\n\t\ttell document named docname to delete slide 1\n\tend tell\nend finalize\n\non themeMasters(docname)\n\t--\t  tell application \"Keynote\" to get the name of every master slide of thisDocument\n\ttell application \"Keynote\"\n\t\tset names to the name of every master slide of document named docname\n\t\treturn names\n\tend tell\nend themeMasters\n\non addImage(docname, filepath)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n  tell application \"Keynote\"\n\ttell document named docname\n\t\ttell the current slide\n\t\t\t\n\t\t\t-- TO REPLACE A PLACEHOLDER OR EXISTING IMAGE:\n\t\t\tset thisPlaceholderImageItem to image 1\n\t\t\t-- change the value of the \u201cfile name\u201d property of the image to be an HFS file reference to the replacement image file\n\t\tset macPath to POSIX file filepath as Unicode text\n\t\t\tset file name of thisPlaceholderImageItem to \u00ac\n\t\t\t\talias macPath\n\t\t\t\n\t\tend tell\n\tend tell\n  end tell\nend addImage\n\n","new_contents":"on newPresentation(themeName)\n\ttell application \"Keynote\"\n\t\tactivate\n\t\t-- FIXME: Make this selectable?\n\t\tset targetWidth to 1024 -- 1440 <-- higher resolution\n\t\tset targetHeight to 768 -- 1080 <-- higher resolution\n\n\t\tset props to {document theme:theme (themeName as string), width:targetWidth, height:targetHeight}\n\n\t\tset thisDocument to make new document with properties props\n\t\treturn name of thisDocument\n\tend tell\nend newPresentation\n\n\non savePresentation(docname, posixPath)\n\ttell application \"Keynote\"\n\t\tsave document named docname in POSIX file posixPath\n\tend tell\nend savePresentation\t\n\non createSlide(docname, masterSlideName)\n\ttry\n\t\ttell application \"Keynote\"\n\t\t\ttell document named docname\n\t\t\t\tset thisSlide to make new slide with properties {base slide:master slide masterSlideName}\n\t\t\tend tell\n\t  return thisSlide\n\t\tend tell\n\ton error\n\t\treturn 0\n\tend try\nend createSlide\n\non finalize(docname)\n\ttell application \"Keynote\"\n\t\ttell document named docname to delete slide 1\n\tend tell\nend finalize\n\non themeMasters(docname)\n\t--\t  tell application \"Keynote\" to get the name of every master slide of thisDocument\n\ttell application \"Keynote\"\n\t\tset names to the name of every master slide of document named docname\n\t\treturn names\n\tend tell\nend themeMasters\n\non addImage(docname, filepath)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n  tell application \"Keynote\"\n\ttell document named docname\n\t\ttell the current slide\n\t\t\t\n\t\t\t-- TO REPLACE A PLACEHOLDER OR EXISTING IMAGE:\n\t\t\tset thisPlaceholderImageItem to image 1\n\t\t\t-- change the value of the \u201cfile name\u201d property of the image to be an HFS file reference to the replacement image file\n\t\tset macPath to POSIX file filepath as Unicode text\n\t\t\tset file name of thisPlaceholderImageItem to \u00ac\n\t\t\t\talias macPath\n\t\t\t\n\t\tend tell\n\tend tell\n  end tell\nend addImage\n\n\non addTitle(docname, thisSlideTitle)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n\ttell application \"Keynote\"\n\t\ttell document named docname\n\t\t\ttell the current slide\n\t\t\t\tif title showing is true then\n\t\t\t\t\tset the object text of the default title item to thisSlideTitle\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend tell\n\tend tell\nend addTitle\n\non addBody(docname, thisSlideBody)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n\ttell application \"Keynote\"\n\t\ttell document named docname\n\t\t\ttell the current slide\n\t\t\t\tif body showing is true then\n\t\t\t\t\tset the object text of the default body item to thisSlideBody\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend tell\n\tend tell\nend addTitle\n","subject":"Break up slide creation","message":"Break up slide creation\n","lang":"AppleScript","license":"mit","repos":"persquare\/md2keynote"}
{"commit":"03476f629ed575808c641045b0609f9c6378ff0a","old_file":"javascript\/safari-driver\/reinstall.scpt","new_file":"javascript\/safari-driver\/reinstall.scpt","old_contents":"#!\/usr\/bin\/osascript\n(*\nCopyright 2012 Software Freedom Conservancy. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*)\n\n(*\nThis script can be used to quickly re-install the SafariDriver extension\nduring development.\n\nRequirements:\n- The extension must be manually installed before use\n- This script must be run from the trunk.\n*)\n\n\n-- Keep this in sync with the name of the extension in the Info.plist\nset EXTENSION to \"WebDriver\"\n\ntell application \"System Events\"\n\tset ui_elements_enabled to UI elements enabled\nend tell\n\nif ui_elements_enabled is false then\n\ttell application \"System Preferences\"\n\t\tactivate\n\t\tset current pane to pane id \"com.apple.preference.universalaccess\"\n\t\tdisplay dialog \"Please \\\"Enable access for assistive devices\\\" \" & \u00ac\n\t\t    \"and try again...\"\n\t\terror number -128\n\tend tell\nend if\n\n\ntell application \"Safari\" to activate\n\ntell application \"System Events\"\n\ttell process \"Safari\"\n\t\ttell menu bar 1\n\t\t\ttell menu \"Develop\"\n\t\t\t\tclick menu item \"Show Extension Builder\"\n\t\t\t\tdelay 1\n\t\t\tend tell\n\t\tend tell\n\t\t\n\t\t-- https:\/\/discussions.apple.com\/thread\/2726674?start=0&tstart=0\n\t\ttell UI element 1 of scroll area 1 of window \"Extension Builder\"\n\t\t\tset found_extension to false\n\t\t\tset tc to (count (groups whose its images is not {}))\n\t\t\trepeat with i from 1 to tc\n\t\t\t\tif exists (static text 1 of group i) then\n\t\t\t\t\tset t_name to name of static text 1 of group i\n\t\t\t\t\tif t_name is EXTENSION then\n\t\t\t\t\t\tset found_extension to true\n\t\t\t\t\t\tclick button \"Reload\" of UI element (\"ReloadUninstall\" & t_name)\n\t\t\t\t\t\texit repeat\n\t\t\t\t\tend if\n\t\t\t\tend if\n\t\t\t\tkeystroke (character id 31)\n\t\t\t\tdelay 0.2\n\t\t\tend repeat\n\t\t\t\n\t\t\tif found_extension is false then\n\t\t\t\tdisplay dialog \"Was unable to locate the extension \\\"\" & EXTENSION \u00ac\n\t\t\t\t    & \"\\\"\" & return & return \u00ac\n\t\t\t\t    & \"It must be manually installed before this script may be used.\"\n\t\t\t\terror number -128\n\t\t\tend if\n\t\tend tell\n\tend tell\nend tell\n\ntell application \"Safari\" to quit\n","new_contents":"#!\/usr\/bin\/osascript\n(*\nCopyright 2012 Software Freedom Conservancy. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*)\n\n(*\nThis script can be used to quickly re-install the SafariDriver extension\nduring development.\n\nRequirements:\n- The extension must be manually installed before use\n- This script must be run from the trunk.\n*)\n\n\n-- Keep this in sync with the name of the extension in the Info.plist\nset EXTENSION to \"WebDriver\"\n\ntell application \"System Events\"\n\tset ui_elements_enabled to UI elements enabled\nend tell\n\nif ui_elements_enabled is false then\n\ttell application \"System Preferences\"\n\t\tactivate\n\t\tset current pane to pane id \"com.apple.preference.universalaccess\"\n\t\tdisplay dialog \"Please \\\"Enable access for assistive devices\\\" \" & \u00ac\n\t\t\t\"and try again...\"\n\t\terror number -128\n\tend tell\nend if\n\ntell application \"Safari\" to activate\n\ntell application \"System Events\"\n\ttell process \"Safari\"\n\t\ttell menu bar 1\n\t\t\t-- tell menu \"Develop\"\n\t\t\ttell menu bar item 8\n\t\t\t\ttell menu 1\n\t\t\t\t\t-- click menu item \"Show Extension Builder\"\n\t\t\t\t\tclick menu item 7\n\t\t\t\tend tell\n\t\t\tend tell\n\t\tend tell\n\t\t\n\t\tdelay 0.2\n\t\t\n\t\t-- https:\/\/discussions.apple.com\/thread\/2726674?start=0&tstart=0\n\t\t-- tell UI element 1 of scroll area 1 of window \"Extension Builder\"\n\t\ttell UI element 1 of scroll area 1 of window 1\n\t\t\tset found_extension to false\n\t\t\tset tc to (count (groups whose its images is not {}))\n\t\t\trepeat with i from 1 to tc\n\t\t\t\tif exists (static text 1 of group i) then\n\t\t\t\t\tset t_name to name of static text 1 of group i\n\t\t\t\t\tif t_name is EXTENSION then\n\t\t\t\t\t\tset found_extension to true\n\t\t\t\t\t\t-- click button \"Reload\" of UI element (\"ReloadUninstall\" & t_name)\n\t\t\t\t\t\tclick button 1 of UI element 4\n\t\t\t\t\t\texit repeat\n\t\t\t\t\tend if\n\t\t\t\tend if\n\t\t\t\tkeystroke (character id 31)\n\t\t\t\tdelay 0.2\n\t\t\tend repeat\n\t\t\t\n\t\t\tif found_extension is false then\n\t\t\t\tdisplay dialog \"Was unable to locate the extension \\\"\" & EXTENSION \u00ac\n\t\t\t\t\t& \"\\\"\" & return & return \u00ac\n\t\t\t\t\t& \"It must be manually installed before this script may be used.\"\n\t\t\t\terror number -128\n\t\t\tend if\n\t\tend tell\n\tend tell\nend tell\n\ntell application \"Safari\" to quit\n","subject":"Make reinstall.scpt system language independent.","message":"JasonLeyba: Make reinstall.scpt system language independent.\n\ngit-svn-id: 4179480af2c2519a5eb5e1e9b541cbdf5cf27696@16964 07704840-8298-11de-bf8c-fd130f914ac9\n","lang":"AppleScript","license":"apache-2.0","repos":"winhamwr\/selenium,winhamwr\/selenium,virajs\/selenium-1,virajs\/selenium-1,virajs\/selenium-1,virajs\/selenium-1,winhamwr\/selenium,virajs\/selenium-1,virajs\/selenium-1,virajs\/selenium-1,winhamwr\/selenium,winhamwr\/selenium,virajs\/selenium-1,winhamwr\/selenium,winhamwr\/selenium,virajs\/selenium-1,winhamwr\/selenium"}
{"commit":"6968f1694181681f5520551bf214152ca4b88cff","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\n-- brings queue into view in iTunes window\non focusQueue()\n\n\ttell application \"iTunes\"\n\n\t\treveal user playlist workflowPlaylistName\n\n\tend tell\n\nend focusQueue\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to first user playlist whose id is playlistId\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif disc number of theSong is discIndex and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\n\tfocusQueue()\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tfocusQueue()\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\n-- brings queue into view in iTunes window\non focusQueue()\n\n\ttell application \"iTunes\"\n\n\t\treveal user playlist workflowPlaylistName\n\n\tend tell\n\nend focusQueue\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to first user playlist whose id is playlistId\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif disc number of theSong is discIndex and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\n\tfocusQueue()\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tfocusQueue()\n\tplayQueue()\n\nend play\n","subject":"Add space between quantity number and quantity name","message":"Add space between quantity number and quantity name\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"be432b7e1afa47c978d34b97440ce894967c2dc0","old_file":"installer\/vba-blocks.applescript","new_file":"installer\/vba-blocks.applescript","old_contents":"tell application \"Terminal\"\n  activate\n  set currentTab to do script (\"vba-blocks help\")\nend tell\n","new_contents":"tell application \"Terminal\"\n\tactivate\n\tdo script (\"vba-blocks help\")\nend tell\n","subject":"Tweak run applescript","message":"Tweak run applescript\n","lang":"AppleScript","license":"mit","repos":"vba-blocks\/vba-blocks,vba-blocks\/vba-blocks,vba-blocks\/vba-blocks"}
{"commit":"49f23c9646bbc9a8f955ba4cb5f1c036d641e065","old_file":"status.applescript","new_file":"status.applescript","old_contents":"tell application \"Finder\"\n\tset json_path to file \"json.scpt\" of folder of (path to me)\nend tell\nset json to load script (json_path as alias)\n\non is_running(appName)\n\ttell application \"System Events\" to (name of processes) contains appName\nend is_running\n\nset reply to json's createDict()\nif is_running(\"Hermes\") then\n\treply's setkv(\"running\", true)\n\tset hermesInfo to json's createDict()\n--\tset hermesStations to json's createDict()\n\ttell application \"Hermes\"\n\t\thermesInfo's setkv(\"state\", playback state as string)\n\t\thermesInfo's setkv(\"volume\", playback volume)\n\n-- XXX: execution error: Hermes got an error: every station doesn\u2019t understand the \u201ccount\u201d message. (-1708)\n--\t\trepeat with theStation in stations\n--\t\t\thermesStations's setkv(\"name\", theStation's name)\n--\t\t\thermesStations's setkv(\"id\", theStation's station ID)\n--\t\tend repeat\n\n\t\thermesInfo's setkv(\"title\", current song's title)\n\t\thermesInfo's setkv(\"artist\", current song's artist)\n\t\thermesInfo's setkv(\"album\", current song's album)\n\t\thermesInfo's setkv(\"artwork\", current song's artwork URL)\n\t\thermesInfo's setkv(\"rating\", current song's rating)\n\t\thermesInfo's setkv(\"position\", playback position as integer)\n\t\thermesInfo's setkv(\"duration\", current song duration as integer)\n\t\thermesInfo's setkv(\"station_name\", current station's name)\n\t\thermesInfo's setkv(\"station_id\", current station's station ID)\n\tend tell\n--\thermesInfo's setkv(\"stations\", hermesStations)\n\treply's setkv(\"info\", hermesInfo)\nelse\n\treply's setkv(\"running\", false)\nend if\nreturn reply's toJson()\n","new_contents":"tell application \"Finder\"\n\tset json_path to file \"json.scpt\" of folder of (path to me)\nend tell\nset json to load script (json_path as alias)\n\non is_running(appName)\n\ttell application \"System Events\" to (name of processes) contains appName\nend is_running\n\nset reply to json's createDict()\nif is_running(\"Hermes\") then\n\treply's setkv(\"running\", true)\n\tset hermesInfo to json's createDict()\n--\tset hermesStations to json's createDict()\n\ttell application \"Hermes\"\n\t\thermesInfo's setkv(\"state\", playback state as string)\n\t\thermesInfo's setkv(\"volume\", playback volume)\n\n-- XXX: execution error: Hermes got an error: every station doesn\u2019t understand the \u201ccount\u201d message. (-1708)\n--\t\trepeat with theStation in stations\n--\t\t\thermesStations's setkv(\"name\", theStation's name)\n--\t\t\thermesStations's setkv(\"id\", theStation's station ID)\n--\t\tend repeat\n\n\t\thermesInfo's setkv(\"title\", current song's title)\n\t\thermesInfo's setkv(\"artist\", current song's artist)\n\t\thermesInfo's setkv(\"album\", current song's album)\n\t\thermesInfo's setkv(\"artwork\", current song's artwork URL)\n\t\thermesInfo's setkv(\"rating\", current song's rating)\n\t\thermesInfo's setkv(\"position\", playback position as integer)\n\t\thermesInfo's setkv(\"duration\", current song duration as integer)\n\t\thermesInfo's setkv(\"station_name\", current station's name)\n\t\thermesInfo's setkv(\"station_id\", current station's station ID)\n\tend tell\n--\thermesInfo's setkv(\"stations\", hermesStations)\n\treply's setkv(\"info\", hermesInfo)\nelse\n\treply's setkv(\"running\", false)\nend if\nreply's setkv(\"time\", (do shell script \"date -u +%s\"))\nreturn reply's toJson()\n","subject":"Add UTC unix epoch as \"time\" as string","message":"Add UTC unix epoch as \"time\" as string\n\notherwise it converts to a real since AppleScript's integer\nis seemingly narrow...\n","lang":"AppleScript","license":"mit","repos":"winny-\/HermesRemote,winny-\/HermesRemote"}
{"commit":"3a58557c1262f691a0019299e89884c24c779481","old_file":"mpkg\/boot2docker.app\/Contents\/Resources\/Scripts\/main.scpt","new_file":"mpkg\/boot2docker.app\/Contents\/Resources\/Scripts\/main.scpt","old_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0003l\u0000\u0002\u0000\u0000\u0000R\u0000\u0004\r\u0000\u0004\u0000\u0002O\u0000\u0000\u0000\u0000\u0000R\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0001k\u0000\u0000\u0000\u0004\u0000Q\u0000\u0007\u0002\u0000\u0007\u0000\u0002\u0000\b\u0000\t\r\u0000\b\u0000\u0003I\u0000\u0002\u0000\u0004\u0000\t\n\u0000\u0018.miscactvnull\u0000\u0000null\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000\t\u0000\u0002\u0000\n\u0000\u000b\r\u0000\n\u0000\u0003l\u0000\u0006\u0000\n\u0000\n\u0000\f\u0000\r\u0001\u0000\u0000\f\u0000\f\u0000\u0000} TODO: test if ~\/.boot2docker\/boot2docker.iso exists, and if not, copy it from the install (need to ship it in the installer)\u0000\u0002\u0000\u0000\u000e\u0000\r\u0000\u0001\u0000\u000e\u0011\u0000\u000e\u0000\u0000 \u0000T\u0000O\u0000D\u0000O\u0000:\u0000 \u0000t\u0000e\u0000s\u0000t\u0000 \u0000i\u0000f\u0000 \u0000~\u0000\/\u0000.\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000\/\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000.\u0000i\u0000s\u0000o\u0000 \u0000e\u0000x\u0000i\u0000s\u0000t\u0000s\u0000,\u0000 \u0000a\u0000n\u0000d\u0000 \u0000i\u0000f\u0000 \u0000n\u0000o\u0000t\u0000,\u0000 \u0000c\u0000o\u0000p\u0000y\u0000 \u0000i\u0000t\u0000 \u0000f\u0000r\u0000o\u0000m\u0000 \u0000t\u0000h\u0000e\u0000 \u0000i\u0000n\u0000s\u0000t\u0000a\u0000l\u0000l\u0000 \u0000(\u0000n\u0000e\u0000e\u0000d\u0000 \u0000t\u0000o\u0000 \u0000s\u0000h\u0000i\u0000p\u0000 \u0000i\u0000t\u0000 \u0000i\u0000n\u0000 \u0000t\u0000h\u0000e\u0000 \u0000i\u0000n\u0000s\u0000t\u0000a\u0000l\u0000l\u0000e\u0000r\u0000)\u0002\u0000\u000b\u0000\u0002\u0000\u000f\u0000\u0010\r\u0000\u000f\u0000\u0002r\u0000\u0000\u0000\n\u0000\u0011\u0000\u0011\u0000\u0012\r\u0000\u0011\u0000\u0003I\u0000\u0002\u0000\n\u0000\u000f\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000\u0012\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u0002\u0000\u0010\u0000\u0002\u0000\u0013\u0000\u0014\r\u0000\u0013\u0000\u0002r\u0000\u0000\u0000\u0012\u0000\u0015\u0000\u0015\u0000\u0016\r\u0000\u0015\u0000\u0001m\u0000\u0000\u0000\u0012\u0000\u0013\u0000\u0017\u000e\u0000\u0017\u0000\u0001\u0000\u0018\u0011\u0000\u0018\u0000&\u0000B\u0000o\u0000o\u0000t\u00002\u0000D\u0000o\u0000c\u0000k\u0000e\u0000r\u0000 \u0000f\u0000o\u0000r\u0000 \u0000O\u0000S\u0000X\r\u0000\u0016\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000bwindowtitle\u0000\u000bwindowTitle\u0002\u0000\u0014\u0000\u0002\u0000\u0019\u0000\u001a\r\u0000\u0019\u0000\u0002r\u0000\u0000\u0000\u0016\u0000\u001b\u0000\u001b\u0000\u001c\r\u0000\u001b\u0000\u0001m\u0000\u0000\u0000\u0016\u0000\u0017\n\u0000\b\u000bboovtrue\r\u0000\u001c\u0000\u0002n\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u001d\u0000\u001e\r\u0000\u001d\u0000\u00011\u0000\u0000\u0000\u0018\u0000\u001a\n\u0000\u0004\ntdct\r\u0000\u001e\u0000\u0001o\u0000\u0000\u0000\u0017\u0000\u0018\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u0002\u0000\u001a\u0000\u0002\u0000\u001f\u0000 \r\u0000\u001f\u0000\u0002r\u0000\u0000\u0000\u001c\u0000!\u0000!\u0000\"\r\u0000!\u0000\u0001o\u0000\u0000\u0000\u001c\u0000\u001d\u000b\u0000\u001a0\u0000\u000bwindowtitle\u0000\u000bwindowTitle\r\u0000\"\u0000\u0002n\u0000\u0000\u0000\u0000\u0000\u0000\u0000#\u0000$\r\u0000#\u0000\u00011\u0000\u0000\u0000\u001e\u0000 \n\u0000\u0004\ntitl\r\u0000$\u0000\u0001o\u0000\u0000\u0000\u001d\u0000\u001e\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u0002\u0000 \u0000\u0002\u0000%\u0000&\r\u0000%\u0000\u0002r\u0000\u0000\u0000\"\u0000%\u0000'\u0000(\r\u0000'\u0000\u0001m\u0000\u0000\u0000\"\u0000#\u0000)\u000e\u0000)\u0000\u0001\u0000*\u0011\u0000*\u00004\u0000\/\u0000u\u0000s\u0000r\u0000\/\u0000l\u0000o\u0000c\u0000a\u0000l\u0000\/\u0000b\u0000i\u0000n\u0000\/\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\r\u0000(\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00070\u0000\u0003b2d\u0000\u0000\u0002\u0000&\u0000\u0002\u0000+\u0000,\r\u0000+\u0000\u0003I\u0000\u0002\u0000&\u0000-\u0000-\u0000.\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\r\u0000-\u0000\u0001m\u0000\u0000\u0000&\u0000'\u0000\/\u000e\u0000\/\u0000\u0001\u00000\u0011\u00000\u0000.\u0000m\u0000k\u0000d\u0000i\u0000r\u0000 \u0000-\u0000p\u0000 \u0000~\u0000\/\u0000.\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0006\u0000.\u0000\u0003\u00001\n\u0000\u0004\nkfil\r\u00001\u0000\u0001o\u0000\u0000\u0000(\u0000)\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u0006\u0000\u0000\u0002\u0000,\u0000\u0002\u00002\u00003\r\u00002\u0000\u0003I\u0000\u0002\u0000.\u00005\u00004\u00005\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\r\u00004\u0000\u0001m\u0000\u0000\u0000.\u0000\/\u00006\u000e\u00006\u0000\u0001\u00007\u0011\u00007\u0000\u0000i\u0000f\u0000 \u0000[\u0000 \u0000!\u0000 \u0000-\u0000f\u0000 \u0000~\u0000\/\u0000.\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000\/\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000.\u0000i\u0000s\u0000o\u0000 \u0000]\u0000;\u0000 \u0000t\u0000h\u0000e\u0000n\u0000 \u0000c\u0000p\u0000 \u0000\/\u0000u\u0000s\u0000r\u0000\/\u0000l\u0000o\u0000c\u0000a\u0000l\u0000\/\u0000s\u0000h\u0000a\u0000r\u0000e\u0000\/\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000\/\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000.\u0000i\u0000s\u0000o\u0000 \u0000~\u0000\/\u0000.\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000\/\u0000 \u0000;\u0000 \u0000f\u0000i\u0006\u00005\u0000\u0003\u00008\n\u0000\u0004\nkfil\r\u00008\u0000\u0001o\u0000\u0000\u00000\u00001\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u0006\u0000\u0000\u0002\u00003\u0000\u0002\u00009\u0000:\r\u00009\u0000\u0003I\u0000\u0002\u00006\u0000?\u0000;\u0000<\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\r\u0000;\u0000\u0002b\u0000\u0000\u00006\u00009\u0000=\u0000>\r\u0000=\u0000\u0001o\u0000\u0000\u00006\u00007\u000b\u0000\u00070\u0000\u0003b2d\u0000\u0000\r\u0000>\u0000\u0001m\u0000\u0000\u00007\u00008\u0000?\u000e\u0000?\u0000\u0001\u0000@\u0011\u0000@\u0000\f\u0000 \u0000i\u0000n\u0000i\u0000t\u0000 \u0006\u0000<\u0000\u0003\u0000A\n\u0000\u0004\nkfil\r\u0000A\u0000\u0001o\u0000\u0000\u0000:\u0000;\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u0006\u0000\u0000\u0002\u0000:\u0000\u0002\u0000B\u0000C\r\u0000B\u0000\u0003I\u0000\u0002\u0000@\u0000I\u0000D\u0000E\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\r\u0000D\u0000\u0002b\u0000\u0000\u0000@\u0000C\u0000F\u0000G\r\u0000F\u0000\u0001o\u0000\u0000\u0000@\u0000A\u000b\u0000\u00070\u0000\u0003b2d\u0000\u0000\r\u0000G\u0000\u0001m\u0000\u0000\u0000A\u0000B\u0000H\u000e\u0000H\u0000\u0001\u0000I\u0011\u0000I\u0000\u0000 \u0000u\u0000p\u0000 \u0000&\u0000&\u0000 \u0000e\u0000x\u0000p\u0000o\u0000r\u0000t\u0000 \u0000D\u0000O\u0000C\u0000K\u0000E\u0000R\u0000_\u0000H\u0000O\u0000S\u0000T\u0000=\u0000t\u0000c\u0000p\u0000:\u0000\/\u0000\/\u0000$\u0000(\u0000\/\u0000u\u0000s\u0000r\u0000\/\u0000l\u0000o\u0000c\u0000a\u0000l\u0000\/\u0000b\u0000i\u0000n\u0000\/\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000 \u0000i\u0000p\u0000 \u00002\u0000>\u0000\/\u0000d\u0000e\u0000v\u0000\/\u0000n\u0000u\u0000l\u0000l\u0000)\u0000:\u00002\u00003\u00007\u00005\u0006\u0000E\u0000\u0003\u0000J\n\u0000\u0004\nkfil\r\u0000J\u0000\u0001o\u0000\u0000\u0000D\u0000E\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u0006\u0000\u0000\u0002\u0000C\u0000\u0002\u0000K\r\u0000K\u0000\u0003I\u0000\u0002\u0000J\u0000Q\u0000L\u0000M\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\r\u0000L\u0000\u0001m\u0000\u0000\u0000J\u0000K\u0000N\u000e\u0000N\u0000\u0001\u0000O\u0011\u0000O\u0000\u001c\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000 \u0000v\u0000e\u0000r\u0000s\u0000i\u0000o\u0000n\u0006\u0000M\u0000\u0003\u0000P\n\u0000\u0004\nkfil\r\u0000P\u0000\u0001o\u0000\u0000\u0000L\u0000M\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u0006\u0000\u0000\u0002\u0000\u0000\r\u0000\u0006\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0000Q\u000f\u0000Q\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000@\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001Z\u0000\u0002\u0000\u0001\u0006OSX-OS\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000xH+\u0000\u0000\u0000\u0000\u0000P\fTerminal.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000(>e\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tUtilities\u0000\u0000\u0010\u0000\b\u0000\u0000y`\b\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000?A\u0000\u0000\u0000\u0001\u0000\b\u0000\u0000\u0000P\u0000\u0000\u0000O\u0000\u0002\u0000,OSX-OS:Applications:\u0000Utilities:\u0000Terminal.app\u0000\u000e\u0000\u001a\u0000\f\u0000T\u0000e\u0000r\u0000m\u0000i\u0000n\u0000a\u0000l\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u000e\u0000\u0006\u0000O\u0000S\u0000X\u0000-\u0000O\u0000S\u0000\u0012\u0000#Applications\/Utilities\/Terminal.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0003\u0000R\u0000S\u0001\u0000\u0000\u0010\u0000R\u0000\u0001\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000e\u0000S\u0000\u0007\u0010\u0000T\u0000U\u0000V\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000T\u0000\u0001k\u0000\u0000\u0000\u0000\u0000R\u0000W\u0002\u0000W\u0000\u0002\u0000\u0001\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000U\u0000\u0000\u0010\u0000V\u0000\u0010\u0000Q\u0000\u0017\u0000)\u0000\/\u00006\u0000?\u0000H\u0000N\n\u0000\u0018.miscactvnull\u0000\u0000null\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u000b\u0000\u001a0\u0000\u000bwindowtitle\u0000\u000bwindowTitle\n\u0000\u0004\ntdct\n\u0000\u0004\ntitl\u000b\u0000\u00070\u0000\u0003b2d\u0000\u0000\n\u0000\u0004\nkfil\u0011\u0000S\u0012\u0000O*j\f\u0000\u0001O*j\f\u0000\u0002EOEOe,FO,FOEOl\f\u0000\u0002Ol\f\u0000\u0002O%l\f\u0000\u0002O%l\f\u0000\u0002Ol\f\u0000\u0002U\u000fascr\u0000\u0001\u0000\f\u07ad","new_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\\\u0000\u0004\r\u0000\u0004\u0000\u0002O\u0000\u0000\u0000\u0000\u0000\\\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0001k\u0000\u0000\u0000\u0004\u0000[\u0000\u0007\u0002\u0000\u0007\u0000\u0002\u0000\b\u0000\t\r\u0000\b\u0000\u0003I\u0000\u0002\u0000\u0004\u0000\t\n\u0000\u0018.miscactvnull\u0000\u0000null\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000\t\u0000\u0002\u0000\n\u0000\u000b\r\u0000\n\u0000\u0003l\u0000\u0006\u0000\n\u0000\n\u0000\f\u0000\r\u0001\u0000\u0000\f\u0000\f\u0000\u0000} TODO: test if ~\/.boot2docker\/boot2docker.iso exists, and if not, copy it from the install (need to ship it in the installer)\u0000\u0002\u0000\u0000\u000e\u0000\r\u0000\u0001\u0000\u000e\u0011\u0000\u000e\u0000\u0000 \u0000T\u0000O\u0000D\u0000O\u0000:\u0000 \u0000t\u0000e\u0000s\u0000t\u0000 \u0000i\u0000f\u0000 \u0000~\u0000\/\u0000.\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000\/\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000.\u0000i\u0000s\u0000o\u0000 \u0000e\u0000x\u0000i\u0000s\u0000t\u0000s\u0000,\u0000 \u0000a\u0000n\u0000d\u0000 \u0000i\u0000f\u0000 \u0000n\u0000o\u0000t\u0000,\u0000 \u0000c\u0000o\u0000p\u0000y\u0000 \u0000i\u0000t\u0000 \u0000f\u0000r\u0000o\u0000m\u0000 \u0000t\u0000h\u0000e\u0000 \u0000i\u0000n\u0000s\u0000t\u0000a\u0000l\u0000l\u0000 \u0000(\u0000n\u0000e\u0000e\u0000d\u0000 \u0000t\u0000o\u0000 \u0000s\u0000h\u0000i\u0000p\u0000 \u0000i\u0000t\u0000 \u0000i\u0000n\u0000 \u0000t\u0000h\u0000e\u0000 \u0000i\u0000n\u0000s\u0000t\u0000a\u0000l\u0000l\u0000e\u0000r\u0000)\u0002\u0000\u000b\u0000\u0002\u0000\u000f\u0000\u0010\r\u0000\u000f\u0000\u0002r\u0000\u0000\u0000\n\u0000\u0011\u0000\u0011\u0000\u0012\r\u0000\u0011\u0000\u0003I\u0000\u0002\u0000\n\u0000\u000f\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000\u0012\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u0002\u0000\u0010\u0000\u0002\u0000\u0013\u0000\u0014\r\u0000\u0013\u0000\u0002r\u0000\u0000\u0000\u0012\u0000\u0015\u0000\u0015\u0000\u0016\r\u0000\u0015\u0000\u0001m\u0000\u0000\u0000\u0012\u0000\u0013\u0000\u0017\u000e\u0000\u0017\u0000\u0001\u0000\u0018\u0011\u0000\u0018\u0000&\u0000B\u0000o\u0000o\u0000t\u00002\u0000D\u0000o\u0000c\u0000k\u0000e\u0000r\u0000 \u0000f\u0000o\u0000r\u0000 \u0000O\u0000S\u0000X\r\u0000\u0016\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000bwindowtitle\u0000\u000bwindowTitle\u0002\u0000\u0014\u0000\u0002\u0000\u0019\u0000\u001a\r\u0000\u0019\u0000\u0002r\u0000\u0000\u0000\u0016\u0000\u001b\u0000\u001b\u0000\u001c\r\u0000\u001b\u0000\u0001m\u0000\u0000\u0000\u0016\u0000\u0017\n\u0000\b\u000bboovtrue\r\u0000\u001c\u0000\u0002n\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u001d\u0000\u001e\r\u0000\u001d\u0000\u00011\u0000\u0000\u0000\u0018\u0000\u001a\n\u0000\u0004\ntdct\r\u0000\u001e\u0000\u0001o\u0000\u0000\u0000\u0017\u0000\u0018\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u0002\u0000\u001a\u0000\u0002\u0000\u001f\u0000 \r\u0000\u001f\u0000\u0002r\u0000\u0000\u0000\u001c\u0000!\u0000!\u0000\"\r\u0000!\u0000\u0001o\u0000\u0000\u0000\u001c\u0000\u001d\u000b\u0000\u001a0\u0000\u000bwindowtitle\u0000\u000bwindowTitle\r\u0000\"\u0000\u0002n\u0000\u0000\u0000\u0000\u0000\u0000\u0000#\u0000$\r\u0000#\u0000\u00011\u0000\u0000\u0000\u001e\u0000 \n\u0000\u0004\ntitl\r\u0000$\u0000\u0001o\u0000\u0000\u0000\u001d\u0000\u001e\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u0002\u0000 \u0000\u0002\u0000%\u0000&\r\u0000%\u0000\u0002r\u0000\u0000\u0000\"\u0000%\u0000'\u0000(\r\u0000'\u0000\u0001m\u0000\u0000\u0000\"\u0000#\u0000)\u000e\u0000)\u0000\u0001\u0000*\u0011\u0000*\u00004\u0000\/\u0000u\u0000s\u0000r\u0000\/\u0000l\u0000o\u0000c\u0000a\u0000l\u0000\/\u0000b\u0000i\u0000n\u0000\/\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\r\u0000(\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00070\u0000\u0003b2d\u0000\u0000\u0002\u0000&\u0000\u0002\u0000+\u0000,\r\u0000+\u0000\u0003I\u0000\u0002\u0000&\u0000-\u0000-\u0000.\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\r\u0000-\u0000\u0001m\u0000\u0000\u0000&\u0000'\u0000\/\u000e\u0000\/\u0000\u0001\u00000\u0011\u00000\u0000\b\u0000b\u0000a\u0000s\u0000h\u0006\u0000.\u0000\u0003\u00001\n\u0000\u0004\nkfil\r\u00001\u0000\u0001o\u0000\u0000\u0000(\u0000)\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u0006\u0000\u0000\u0002\u0000,\u0000\u0002\u00002\u00003\r\u00002\u0000\u0003I\u0000\u0002\u0000.\u00005\u00004\u00005\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\r\u00004\u0000\u0001m\u0000\u0000\u0000.\u0000\/\u00006\u000e\u00006\u0000\u0001\u00007\u0011\u00007\u0000.\u0000m\u0000k\u0000d\u0000i\u0000r\u0000 \u0000-\u0000p\u0000 \u0000~\u0000\/\u0000.\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0006\u00005\u0000\u0003\u00008\n\u0000\u0004\nkfil\r\u00008\u0000\u0001o\u0000\u0000\u00000\u00001\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u0006\u0000\u0000\u0002\u00003\u0000\u0002\u00009\u0000:\r\u00009\u0000\u0003I\u0000\u0002\u00006\u0000=\u0000;\u0000<\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\r\u0000;\u0000\u0001m\u0000\u0000\u00006\u00007\u0000=\u000e\u0000=\u0000\u0001\u0000>\u0011\u0000>\u0000\u0000i\u0000f\u0000 \u0000[\u0000 \u0000!\u0000 \u0000-\u0000f\u0000 \u0000~\u0000\/\u0000.\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000\/\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000.\u0000i\u0000s\u0000o\u0000 \u0000]\u0000;\u0000 \u0000t\u0000h\u0000e\u0000n\u0000 \u0000c\u0000p\u0000 \u0000\/\u0000u\u0000s\u0000r\u0000\/\u0000l\u0000o\u0000c\u0000a\u0000l\u0000\/\u0000s\u0000h\u0000a\u0000r\u0000e\u0000\/\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000\/\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000.\u0000i\u0000s\u0000o\u0000 \u0000~\u0000\/\u0000.\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000\/\u0000 \u0000;\u0000 \u0000f\u0000i\u0006\u0000<\u0000\u0003\u0000?\n\u0000\u0004\nkfil\r\u0000?\u0000\u0001o\u0000\u0000\u00008\u00009\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u0006\u0000\u0000\u0002\u0000:\u0000\u0002\u0000@\u0000A\r\u0000@\u0000\u0003I\u0000\u0002\u0000>\u0000G\u0000B\u0000C\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\r\u0000B\u0000\u0002b\u0000\u0000\u0000>\u0000A\u0000D\u0000E\r\u0000D\u0000\u0001o\u0000\u0000\u0000>\u0000?\u000b\u0000\u00070\u0000\u0003b2d\u0000\u0000\r\u0000E\u0000\u0001m\u0000\u0000\u0000?\u0000@\u0000F\u000e\u0000F\u0000\u0001\u0000G\u0011\u0000G\u0000\f\u0000 \u0000i\u0000n\u0000i\u0000t\u0000 \u0006\u0000C\u0000\u0003\u0000H\n\u0000\u0004\nkfil\r\u0000H\u0000\u0001o\u0000\u0000\u0000B\u0000C\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u0006\u0000\u0000\u0002\u0000A\u0000\u0002\u0000I\u0000J\r\u0000I\u0000\u0003I\u0000\u0002\u0000H\u0000Q\u0000K\u0000L\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\r\u0000K\u0000\u0002b\u0000\u0000\u0000H\u0000K\u0000M\u0000N\r\u0000M\u0000\u0001o\u0000\u0000\u0000H\u0000I\u000b\u0000\u00070\u0000\u0003b2d\u0000\u0000\r\u0000N\u0000\u0001m\u0000\u0000\u0000I\u0000J\u0000O\u000e\u0000O\u0000\u0001\u0000P\u0011\u0000P\u0000\u0000 \u0000u\u0000p\u0000 \u0000&\u0000&\u0000 \u0000e\u0000x\u0000p\u0000o\u0000r\u0000t\u0000 \u0000D\u0000O\u0000C\u0000K\u0000E\u0000R\u0000_\u0000H\u0000O\u0000S\u0000T\u0000=\u0000t\u0000c\u0000p\u0000:\u0000\/\u0000\/\u0000$\u0000(\u0000\/\u0000u\u0000s\u0000r\u0000\/\u0000l\u0000o\u0000c\u0000a\u0000l\u0000\/\u0000b\u0000i\u0000n\u0000\/\u0000b\u0000o\u0000o\u0000t\u00002\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000 \u0000i\u0000p\u0000 \u00002\u0000>\u0000\/\u0000d\u0000e\u0000v\u0000\/\u0000n\u0000u\u0000l\u0000l\u0000)\u0000:\u00002\u00003\u00007\u00005\u0006\u0000L\u0000\u0003\u0000Q\n\u0000\u0004\nkfil\r\u0000Q\u0000\u0001o\u0000\u0000\u0000L\u0000M\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u0006\u0000\u0000\u0002\u0000J\u0000\u0002\u0000R\r\u0000R\u0000\u0003I\u0000\u0002\u0000R\u0000[\u0000S\u0000T\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\r\u0000S\u0000\u0001m\u0000\u0000\u0000R\u0000U\u0000U\u000e\u0000U\u0000\u0001\u0000V\u0011\u0000V\u0000\u001c\u0000d\u0000o\u0000c\u0000k\u0000e\u0000r\u0000 \u0000v\u0000e\u0000r\u0000s\u0000i\u0000o\u0000n\u0006\u0000T\u0000\u0003\u0000W\n\u0000\u0004\nkfil\r\u0000W\u0000\u0001o\u0000\u0000\u0000V\u0000W\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u0006\u0000\u0000\u0002\u0000\u0000\r\u0000\u0006\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0000X\u000f\u0000X\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000@\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001l\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0018H+\u0000\u0000\u0000+\fTerminal.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0011_?O\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tUtilities\u0000\u0000\u0010\u0000\b\u0000\u0000\u0018\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000?A\u0000\u0000\u0000\u0001\u0000\b\u0000+\u0000*\u0000\u0002\u00002Macintosh HD:Applications:\u0000Utilities:\u0000Terminal.app\u0000\u000e\u0000\u001a\u0000\f\u0000T\u0000e\u0000r\u0000m\u0000i\u0000n\u0000a\u0000l\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000#Applications\/Utilities\/Terminal.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0003\u0000Y\u0000Z\u0001\u0000\u0000\u0010\u0000Y\u0000\u0001\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000e\u0000Z\u0000\u0007\u0010\u0000[\u0000\\\u0000]\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000[\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\\\u0000^\u0002\u0000^\u0000\u0002\u0000\u0001\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000\\\u0000\u0000\u0010\u0000]\u0000\u0011\u0000X\u0000\u0017\u0000)\u0000\/\u00006\u0000=\u0000F\u0000O\u0000U\n\u0000\u0018.miscactvnull\u0000\u0000null\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\u000b\u0000\u00160\u0000\tnewwindow\u0000\tnewWindow\u000b\u0000\u001a0\u0000\u000bwindowtitle\u0000\u000bwindowTitle\n\u0000\u0004\ntdct\n\u0000\u0004\ntitl\u000b\u0000\u00070\u0000\u0003b2d\u0000\u0000\n\u0000\u0004\nkfil\u0011\u0000]\u0012\u0000Y*j\f\u0000\u0001O*j\f\u0000\u0002EOEOe,FO,FOEOl\f\u0000\u0002Ol\f\u0000\u0002Ol\f\u0000\u0002O%l\f\u0000\u0002O%l\f\u0000\u0002Oa\u0000\u0010l\f\u0000\u0002U\u000fascr\u0000\u0001\u0000\f\u07ad","subject":"fix for issue #28, switch to bash before executing script","message":"fix for issue #28, switch to bash before executing script\n","lang":"AppleScript","license":"apache-2.0","repos":"JoeWoo\/osx-installer,boot2docker\/osx-installer,JoeWoo\/osx-installer,yut148\/osx-installer,yut148\/osx-installer,boot2docker\/osx-installer,lakwarus\/c5-osx-installer,cgvarela\/osx-installer,lakwarus\/c5-osx-installer,cgvarela\/osx-installer"}
{"commit":"fb7eb172817b1bee7e4a5448b4250aa2b5cdeb8a","old_file":"Xmod\/Xmod.applescript","new_file":"Xmod\/Xmod.applescript","old_contents":"tell application \"Xcode\"\n\tif not (exists active project document) then \n\t\terror \"No active project. Please open an Xcode project and re-run the script.\"\n\ttry\n\t\tmy updateProjectXmod(project of active project document)\n\ton error errMsg\n\t\tmy logger(\"Xmod.scpt exception: \" & errMsg)\n\tend try\nend tell\n\non updateProjectXmod(_project)\n\ttell application \"Xcode\"\n\t\t-- Iterate over every .xcdatamodel in the project.\n\t\tset modelList to every file reference of _project whose file kind is \"wrapper.xcdatamodel\"\n\t\trepeat with modelIt in modelList\n\t\t\tif comments of modelIt contains \"xmod\" then\n\t\t\t\tset modelSrcDir to my modelSrcDirPath(full path of modelIt)\n\t\t\t\tset targetList to my everyTargetWithBuildFilePath(_project, full path of modelIt)\n\t\t\t\t\n\t\t\t\t-- Create the .xcdatamodel related source group if necessary.\n\t\t\t\tif not (exists (every item reference of group of modelIt whose full path is modelSrcDir)) then\n\t\t\t\t\ttell group of modelIt\n\t\t\t\t\t\tmake new group with properties {full path:modelSrcDir, name:text 1 thru -13 of ((name of modelIt) as string)}\n\t\t\t\t\tend tell\n\t\t\t\tend if\n\t\t\t\tset modelSrcGroup to item 1 of (every item reference of group of modelIt whose full path is modelSrcDir)\n\t\t\t\ttell modelSrcGroup to delete every item reference -- clear it out for population in case we didn't just create it\n\t\t\t\t\n\t\t\t\t--\tMeat.\n\t\t\t\tdo shell script \"\/usr\/bin\/mogenerator --model '\" & full path of modelIt & \"' --output-dir '\" & modelSrcDir & \"'\"\n\t\t\t\t\n\t\t\t\t--\tBuild a list of resulting source files.\n\t\t\t\ttell application \"System Events\"\n\t\t\t\t\tset modelSrcDirAlias to POSIX file modelSrcDir as alias\n\t\t\t\t\tset humanHeaderFileList to (every file of modelSrcDirAlias whose name ends with \".h\" and name does not start with \"_\")\n\t\t\t\t\tset humanSourceFileList to (every file of modelSrcDirAlias whose (name ends with \".m\" or name ends with \".mm\") and name does not start with \"_\")\n\t\t\t\t\tset machineHeaderFileList to (every file of modelSrcDirAlias whose name ends with \".h\" and name starts with \"_\")\n\t\t\t\t\tset machineSourceFileList to (every file of modelSrcDirAlias whose (name ends with \".m\" or name ends with \".mm\") and name starts with \"_\")\n\t\t\t\t\tset fileList to humanHeaderFileList & humanSourceFileList & machineHeaderFileList & machineSourceFileList\n\t\t\t\t\tset pathList to {}\n\t\t\t\t\trepeat with fileItem in fileList\n\t\t\t\t\t\tset pathList to pathList & POSIX path of fileItem\n\t\t\t\t\tend repeat\n\t\t\t\tend tell\n\t\t\t\t\n\t\t\t\t--\tAdd the source files to the model's source group and the model's targets.\n\t\t\t\trepeat with pathIt in pathList\n\t\t\t\t\ttell modelSrcGroup\n\t\t\t\t\t\tset modelSrcFileRef to make new file reference with properties {full path:pathIt, name:name of (info for POSIX file pathIt)}\n\t\t\t\t\t\trepeat with targetIndex from 1 to (count of targetList)\n\t\t\t\t\t\t\tset targetIt to item targetIndex of targetList\n\t\t\t\t\t\t\tadd modelSrcFileRef to targetIt\n\t\t\t\t\t\tend repeat\n\t\t\t\t\tend tell\n\t\t\t\tend repeat\n\t\t\tend if\n\t\tend repeat\n\tend tell\nend updateProjectXmod\n\non everyTargetWithBuildFilePath(_project, _buildFilePath)\n\tset theResult to {}\n\ttell application \"Xcode\"\n\t\trepeat with targetIt in (every target of _project)\n\t\t\trepeat with buildFileIt in build files of targetIt\n\t\t\t\tif full path of file reference of buildFileIt is _buildFilePath then set theResult to theResult & {(targetIt as anything)}\n\t\t\tend repeat\n\t\tend repeat\n\tend tell\n\treturn theResult\nend everyTargetWithBuildFilePath\n\non modelSrcDirPath(modelFileUnixPath)\n\tset modelFilePosixRef to POSIX file modelFileUnixPath\n\tset modelFileAlias to modelFilePosixRef as alias\n\t\n\ttell application \"Finder\"\n\t\tset modelFileFolder to folder of modelFileAlias\n\t\tset modelFileName to name of modelFileAlias\n\t\tset modelSrcFolderName to text 1 thru -13 of modelFileName -- pull off the .xcdatamodel extension\n\t\tif not (exists folder modelSrcFolderName of modelFileFolder) then\n\t\t\tmake folder at modelFileFolder with properties {name:modelSrcFolderName}\n\t\tend if\n\t\tset modelSrcFolder to folder modelSrcFolderName of modelFileFolder\n\tend tell\n\treturn text 1 thru -2 of (POSIX path of (modelSrcFolder as alias)) -- kill the trailing slash\nend modelSrcDirPath\n\non logger(msg)\n\tdo shell script \"logger '\" & msg & \"'\"\nend logger\n","new_contents":"tell application \"Xcode\"\n\tif not (exists active project document) then \n\t\terror \"No active project. Please open an Xcode project and re-run the script.\"\n\ttry\n\t\tmy updateProjectXmod(project of active project document)\n\ton error errMsg\n\t\tmy logger(\"Xmod.scpt exception: \" & errMsg)\n\tend try\nend tell\n\non updateProjectXmod(_project)\n\ttell application \"Xcode\"\n\t\t-- Iterate over every .xcdatamodel in the project.\n\t\tset modelList to every file reference of _project whose file kind is \"wrapper.xcdatamodel\"\n\t\trepeat with modelIt in modelList\n\t\t\tif comments of modelIt contains \"xmod\" then\n\t\t\t\tset modelSrcDir to my modelSrcDirPath(full path of modelIt)\n\t\t\t\tset targetList to my everyTargetWithBuildFilePath(_project, full path of modelIt)\n\t\t\t\t\n\t\t\t\t-- Create the .xcdatamodel related source group if necessary.\n\t\t\t\tif not (exists (every item reference of group of modelIt whose full path is modelSrcDir)) then\n\t\t\t\t\ttell group of modelIt\n\t\t\t\t\t\tmake new group with properties {full path:modelSrcDir, name:text 1 thru -13 of ((name of modelIt) as string)}\n\t\t\t\t\tend tell\n\t\t\t\tend if\n\t\t\t\tset modelSrcGroup to item 1 of (every item reference of group of modelIt whose full path is modelSrcDir)\n\t\t\t\ttell modelSrcGroup to delete every item reference -- clear it out for population in case we didn't just create it\n\t\t\t\t\n\t\t\t\t--\tMeat.\n\t\t\t\tdo shell script \"\/usr\/bin\/mogenerator --model '\" & full path of modelIt & \"' --output-dir '\" & modelSrcDir & \"'\"\n\t\t\t\t\n\t\t\t\t--\tBuild a list of resulting source files.\n\t\t\t\ttell application \"System Events\"\n\t\t\t\t\tset modelSrcDirAlias to POSIX file modelSrcDir as alias\n\t\t\t\t\tset humanHeaderFileList to (every file of modelSrcDirAlias whose name ends with \".h\" and name does not start with \"_\")\n\t\t\t\t\tset humanSourceFileList to (every file of modelSrcDirAlias whose (name ends with \".m\" or name ends with \".mm\") and name does not start with \"_\")\n\t\t\t\t\tset machineHeaderFileList to (every file of modelSrcDirAlias whose name ends with \".h\" and name starts with \"_\")\n\t\t\t\t\tset machineSourceFileList to (every file of modelSrcDirAlias whose (name ends with \".m\" or name ends with \".mm\") and name starts with \"_\")\n\t\t\t\t\tset fileList to humanSourceFileList & humanHeaderFileList & machineSourceFileList & machineHeaderFileList\n\t\t\t\t\tset pathList to {}\n\t\t\t\t\trepeat with fileItem in fileList\n\t\t\t\t\t\tset pathList to pathList & POSIX path of fileItem\n\t\t\t\t\tend repeat\n\t\t\t\tend tell\n\t\t\t\t\n\t\t\t\t--\tAdd the source files to the model's source group and the model's targets.\n\t\t\t\trepeat with pathIt in pathList\n\t\t\t\t\ttell modelSrcGroup\n\t\t\t\t\t\tset modelSrcFileRef to make new file reference with properties {full path:pathIt, name:name of (info for POSIX file pathIt)}\n\t\t\t\t\t\trepeat with targetIndex from 1 to (count of targetList)\n\t\t\t\t\t\t\tset targetIt to item targetIndex of targetList\n\t\t\t\t\t\t\tadd modelSrcFileRef to targetIt\n\t\t\t\t\t\tend repeat\n\t\t\t\t\tend tell\n\t\t\t\tend repeat\n\t\t\tend if\n\t\tend repeat\n\tend tell\nend updateProjectXmod\n\non everyTargetWithBuildFilePath(_project, _buildFilePath)\n\tset theResult to {}\n\ttell application \"Xcode\"\n\t\trepeat with targetIt in (every target of _project)\n\t\t\trepeat with buildFileIt in build files of targetIt\n\t\t\t\tif full path of file reference of buildFileIt is _buildFilePath then set theResult to theResult & {(targetIt as anything)}\n\t\t\tend repeat\n\t\tend repeat\n\tend tell\n\treturn theResult\nend everyTargetWithBuildFilePath\n\non modelSrcDirPath(modelFileUnixPath)\n\tset modelFilePosixRef to POSIX file modelFileUnixPath\n\tset modelFileAlias to modelFilePosixRef as alias\n\t\n\ttell application \"Finder\"\n\t\tset modelFileFolder to folder of modelFileAlias\n\t\tset modelFileName to name of modelFileAlias\n\t\tset modelSrcFolderName to text 1 thru -13 of modelFileName -- pull off the .xcdatamodel extension\n\t\tif not (exists folder modelSrcFolderName of modelFileFolder) then\n\t\t\tmake folder at modelFileFolder with properties {name:modelSrcFolderName}\n\t\tend if\n\t\tset modelSrcFolder to folder modelSrcFolderName of modelFileFolder\n\tend tell\n\treturn text 1 thru -2 of (POSIX path of (modelSrcFolder as alias)) -- kill the trailing slash\nend modelSrcDirPath\n\non logger(msg)\n\tdo shell script \"logger '\" & msg & \"'\"\nend logger\n","subject":"change file ordering to human.m, human.h, machine.m, machine.h (from human.h, human.m, machine.h, machine.m).","message":"[CHANGE] Xmo'd: change file ordering to human.m, human.h, machine.m, machine.h (from human.h, human.m, machine.h, machine.m).\n","lang":"AppleScript","license":"mit","repos":"mjasa\/mogenerator,rentzsch\/mogenerator,fizker\/mogenerator,bewebste\/mogenerator,anton-matosov\/mogenerator,iv-mexx\/mogenerator,fizker\/mogenerator,ef-ctx\/mogenerator,skywinder\/mogenerator,ef-ctx\/mogenerator,seanm\/mogenerator,hardikdevios\/mogenerator,casademora\/mogenerator,willowtreeapps\/mattgenerator,rentzsch\/mogenerator,skywinder\/mogenerator,VladimirGoncharov\/mogenerator,Erin-Mounts\/mogenerator,bewebste\/mogenerator,casademora\/mogenerator,skywinder\/mogenerator,Erin-Mounts\/mogenerator,otaran\/mogenerator,seanm\/mogenerator,kostiakoval\/mogenerator,rentzsch\/mogenerator,pronebird\/mogenerator,bgulanowski\/mogenerator,VladimirGoncharov\/mogenerator,bgulanowski\/mogenerator,iv-mexx\/mogenerator,bewebste\/mogenerator,fizker\/mogenerator,pronebird\/mogenerator,iv-mexx\/mogenerator,otaran\/mogenerator,casademora\/mogenerator,seanm\/mogenerator,adozenlines\/mogenerator,VladimirGoncharov\/mogenerator,mjasa\/mogenerator,adozenlines\/mogenerator,pronebird\/mogenerator,bewebste\/mogenerator,hardikdevios\/mogenerator,anton-matosov\/mogenerator,untitledstartup\/mogenerator,untitledstartup\/mogenerator,ef-ctx\/mogenerator,Erin-Mounts\/mogenerator,untitledstartup\/mogenerator,anton-matosov\/mogenerator,kostiakoval\/mogenerator,mjasa\/mogenerator,otaran\/mogenerator,iv-mexx\/mogenerator,adozenlines\/mogenerator,willowtreeapps\/mattgenerator,kostiakoval\/mogenerator,willowtreeapps\/mattgenerator,bgulanowski\/mogenerator,hardikdevios\/mogenerator"}
{"commit":"f057989121a8e2fdb173dacb76b60b9b3c2772d3","old_file":"AppleScript\/openQnA.scpt","new_file":"AppleScript\/openQnA.scpt","old_contents":"tell application \"Terminal\"\n\tif not (exists window 1) then reopen\n\tactivate\n\tdo script \"\/Library\/BESAgent\/BESAgent.app\/Contents\/MacOS\/QnA -showtypes\" in window 1\nend tell\n","new_contents":"-- http:\/\/www-01.ibm.com\/support\/docview.wss?uid=swg21506026\n-- https:\/\/github.com\/jgstew\/tools\/blob\/master\/bash\/openQnA.sh\n-- http:\/\/alvinalexander.com\/blog\/post\/mac-os-x\/applescript-use-comments\ntell application \"Terminal\"\n\tif not (exists window 1) then reopen\n\tactivate\n\tdo script \"\/Library\/BESAgent\/BESAgent.app\/Contents\/MacOS\/QnA -showtypes\" in window 1\nend tell\n","subject":"Update openQnA.scpt","message":"Update openQnA.scpt","lang":"AppleScript","license":"mit","repos":"jgstew\/tools,jgstew\/tools,jgstew\/tools,jgstew\/tools"}
{"commit":"a5ec07ebeb796e4d0a8c6ba1e6f653f20820ea56","old_file":"scripts\/resetsimulator.applescript","new_file":"scripts\/resetsimulator.applescript","old_contents":"tell application \"System Events\" to tell process \"iOS Simulator\"\n\tactivate\n\tset frontmost to true\n\tclick menu item \"Reset Content and Settings\" of menu 0 of menu bar item \"iOS Simulator\" of menu bar 1\n  delay 0.1\n  tell application \"System Events\" to key code 36\n\t-- click button \"Reset\" of window \"\"\n  return\nend tell\n","new_contents":"tell application \"System Events\" to tell process \"Simulator\"\n\tactivate\n\tset frontmost to true\n\tclick menu item \"Reset Content and Settings\" of menu 0 of menu bar item \"Simulator\" of menu bar 1\n  delay 0.1\n  tell application \"System Events\" to key code 36\n\t-- click button \"Reset\" of window \"\"\n  return\nend tell\n","subject":"Fix simulator script","message":"Fix simulator script\n","lang":"AppleScript","license":"mit","repos":"keith\/dotfiles,keith\/dotfiles,keith\/dotfiles,keith\/dotfiles,keith\/dotfiles,keith\/dotfiles"}
{"commit":"b14b563abf63764488e4dab83bc8d6088c8cb6dc","old_file":"alfred_script.applescript","new_file":"alfred_script.applescript","old_contents":"on alfred_script(q)\n    \n    tell application \"Google Chrome\"\n        \n        if q is \"\" or q is \"p\" or q is \"pp\" or q is \"play\" or q is \"pause\" then\n            set buttonClass to \"play\"\n            set execCode to \"$('.\" & buttonClass & \"').first().click()\"\n        else if q is \"next\" or q is \"skip\" or q is \"n\" then\n            set buttonClass to \"next\"\n            set execCode to \"$('.\" & buttonClass & \"').first().click()\"\n        else\n            set argList to every text item of q\n            if item 1 of argList is \"genre\" then\n                set execCode to \"$('li.genre a')[\" & item 2 of argList & \"].click();\"\n            end if\n        end if\n        \n        set seenPlayerTab to 0\n        \n        set thisWindowIndex to 1\n        repeat with thisWindow in windows\n            \n            set thisTabIndex to 1\n            repeat with thisTab in tabs of thisWindow\n                \n                if URL of thisTab starts with \"https:\/\/www.focusatwill.com\/\" then\n                    set seenPlayerTab to 1\n                    exit repeat\n                end if\n                \n                set thisTabIndex to thisTabIndex + 1\n                \n            end repeat\n            \n            if seenPlayerTab is greater than 0 then\n                tell tab thisTabIndex of window thisWindowIndex\n                    execute javascript execCode\n                end tell\n                exit repeat\n            end if\n            \n            set thisWindowIndex to thisWindowIndex + 1\n            \n        end repeat\n        \n        if seenPlayerTab is 0 then\n            set newTab to make new tab at end of tabs of window 1\n            set URL of newTab to \"https:\/\/www.focusatwill.com\/music\/#player\"\n            delay 5\n            tell newTab\n                execute javascript execCode\n            end tell\n        end if\n        \n    end tell\nend alfred_script\n","new_contents":"on alfred_script(q)\n\n    set AppleScript's text item delimiters to {\" \"}\n\n    tell application \"Google Chrome\"\n        \n        if q is \"\" or q is \"p\" or q is \"pp\" or q is \"play\" or q is \"pause\" then\n            set buttonClass to \"play\"\n            set execCode to \"$('.\" & buttonClass & \"').first().click()\"\n        else if q is \"next\" or q is \"skip\" or q is \"n\" then\n            set buttonClass to \"next\"\n            set execCode to \"$('.\" & buttonClass & \"').first().click()\"\n        else\n            set argList to every text item of q\n            if item 1 of argList is \"genre\" then\n                set execCode to \"$('li.genre a')[\" & item 2 of argList & \"].click();\"\n            end if\n        end if\n        \n        set seenPlayerTab to 0\n        \n        set thisWindowIndex to 1\n        repeat with thisWindow in windows\n            \n            set thisTabIndex to 1\n            repeat with thisTab in tabs of thisWindow\n                \n                if URL of thisTab starts with \"https:\/\/www.focusatwill.com\/\" then\n                    set seenPlayerTab to 1\n                    exit repeat\n                end if\n                \n                set thisTabIndex to thisTabIndex + 1\n                \n            end repeat\n            \n            if seenPlayerTab is greater than 0 then\n                tell tab thisTabIndex of window thisWindowIndex\n                    execute javascript execCode\n                end tell\n                exit repeat\n            end if\n            \n            set thisWindowIndex to thisWindowIndex + 1\n            \n        end repeat\n        \n        if seenPlayerTab is 0 then\n            set newTab to make new tab at end of tabs of window 1\n            set URL of newTab to \"https:\/\/www.focusatwill.com\/music\/#player\"\n            delay 5\n            tell newTab\n                execute javascript execCode\n            end tell\n        end if\n        \n    end tell\nend alfred_script\n","subject":"Fix potential text delimiter bug","message":"Fix potential text delimiter bug\n","lang":"AppleScript","license":"mit","repos":"tangledhelix\/focusatwill-in-google-chrome,tangledhelix\/focusatwill-in-google-chrome"}
{"commit":"93db092c03980b587e6b2b8e4df15352b83d5134","old_file":"XcodeWayExtensions\/Script\/XcodeWayScript.scpt","new_file":"XcodeWayExtensions\/Script\/XcodeWayScript.scpt","old_contents":"use scripting additions\nuse framework \"Foundation\"\nproperty NSString : a reference to current application's NSString\n\n-- Helper\n\non myRemoveLastPath(myPath)\nset myString to NSString's stringWithString:myPath\nset removedLastPathString to myString's stringByDeletingLastPathComponent\nremovedLastPathString as text\nend myRemoveLastPath\n\non myFolderExists(myFolder) -- (String) as Boolean\ntell application \"System Events\"\nif exists folder myFolder then\nreturn true\nelse\nreturn false\nend if\nend tell\nend myFolderExists\n\n-- Path\n\non myHomePath()\ntell application \"System Events\"\n\"\/Users\/\" & (name of current user)\nend tell\nend myHomePath\n\non myLibraryPath()\nmyHomePath() & \"\/Library\"\nend myLibraryPath\n\non myXcodePath()\nmyLibraryPath() & \"\/Developer\/Xcode\"\nend myXcodePath\n\non myUserDataPath()\nmyXcodePath() & \"\/UserData\"\nend myUserDataPath\n\non myProjectPath()\ntell application \"Xcode\"\ntell active workspace document\nset myPath to path\nend tell\nend tell\nmyRemoveLastPath(myPath)\nend myProjectPath\n\n-- Generic Open\n\non myOpenFolder(myPath)\ntell application \"Finder\"\nactivate\nopen myPath as POSIX file\nend tell\nend myOpenFolder\n\non myOpeniTerm(myPath)\ntell application \"Finder\"\ndo shell script \"open -a iTerm \" & quoted form of myPath\nend tell\nend myOpeniTerm\n\n-- Open\n\non myOpenThemesFolder()\nset myPath to myUserDataPath() & \"\/FontAndColorThemes\/\"\nmyOpenFolder(myPath)\nend myOpenThemesFolder\n\non myOpenCodeSnippetsFolder()\nset myPath to myUserDataPath() & \"\/CodeSnippets\/\"\nmyOpenFolder(myPath)\nend myOpenCodeSnippetsFolder\n\non myOpenDeviceSupportFolder()\nset myPath to \"\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/DeviceSupport\"\nmyOpenFolder(myPath)\nend myOpenDeviceSupportFolder\n\non myOpenArchivesFolder()\nset myPath to myXcodePath() & \"\/Archives\/\"\nmyOpenFolder(myPath)\nend myOpenArchivesFolder\n\non myOpenProvisioningProfileFolder()\nset myPath to myLibraryPath() & \"\/MobileDevice\/Provisioning Profiles\"\nmyOpenFolder(myPath)\nend myOpenProvisioningProfileFolder\n\non myOpenProjectFolder()\nset myPath to myProjectPath()\nmyOpenFolder(myPath)\nend myOpenProjectFolder\n\non myOpeniTermForCurrentProject()\nset myPath to myProjectPath()\nmyOpeniTerm(myPath)\nend myOpeniTermForCurrentProject\n\non myOpenDerivedDataFolder()\nset myRelativePath to myProjectPath() & \"\/DerivedData\/\"\nif myFolderExists(myRelativePath) then\nmyOpenFolder(myRelativePath)\nelse\nmyOpenFolder(myXcodePath() & \"\/DerivedData\/\")\nend if\nend myOpenDerivedDataFolder\n\non myOpenGitHub()\nset myPath to myProjectPath()\nset myUrl to (do shell script \"cd \" & quoted form of myPath & \"; git config --get remote.origin.url\")\nopen location myUrl\nend myOpenGitHub\n","new_contents":"use scripting additions\nuse framework \"Foundation\"\nproperty NSString : a reference to current application's NSString\n\n-- Helper\n\non myRemoveLastPath(myPath)\nset myString to NSString's stringWithString:myPath\nset removedLastPathString to myString's stringByDeletingLastPathComponent\nremovedLastPathString as text\nend myRemoveLastPath\n\non myFolderExists(myFolder) -- (String) as Boolean\ntell application \"System Events\"\nif exists folder myFolder then\nreturn true\nelse\nreturn false\nend if\nend tell\nend myFolderExists\n\non myGetRemote(myText)\nset myString to NSString's stringWithString:myText\nset myParts to myString's componentsSeparatedByString:\"  \"\nset myFirstParts to item 1 of myParts\nmyFirstParts as text\nend myGetRemote\n\n-- Path\n\non myHomePath()\ntell application \"System Events\"\n\"\/Users\/\" & (name of current user)\nend tell\nend myHomePath\n\non myLibraryPath()\nmyHomePath() & \"\/Library\"\nend myLibraryPath\n\non myXcodePath()\nmyLibraryPath() & \"\/Developer\/Xcode\"\nend myXcodePath\n\non myUserDataPath()\nmyXcodePath() & \"\/UserData\"\nend myUserDataPath\n\non myProjectPath()\ntell application \"Xcode\"\ntell active workspace document\nset myPath to path\nend tell\nend tell\nmyRemoveLastPath(myPath)\nend myProjectPath\n\n-- Generic Open\n\non myOpenFolder(myPath)\ntell application \"Finder\"\nactivate\nopen myPath as POSIX file\nend tell\nend myOpenFolder\n\non myOpeniTerm(myPath)\ntell application \"Finder\"\ndo shell script \"open -a iTerm \" & quoted form of myPath\nend tell\nend myOpeniTerm\n\n-- Open\n\non myOpenThemesFolder()\nset myPath to myUserDataPath() & \"\/FontAndColorThemes\/\"\nmyOpenFolder(myPath)\nend myOpenThemesFolder\n\non myOpenCodeSnippetsFolder()\nset myPath to myUserDataPath() & \"\/CodeSnippets\/\"\nmyOpenFolder(myPath)\nend myOpenCodeSnippetsFolder\n\non myOpenDeviceSupportFolder()\nset myPath to \"\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/DeviceSupport\"\nmyOpenFolder(myPath)\nend myOpenDeviceSupportFolder\n\non myOpenArchivesFolder()\nset myPath to myXcodePath() & \"\/Archives\/\"\nmyOpenFolder(myPath)\nend myOpenArchivesFolder\n\non myOpenProvisioningProfileFolder()\nset myPath to myLibraryPath() & \"\/MobileDevice\/Provisioning Profiles\"\nmyOpenFolder(myPath)\nend myOpenProvisioningProfileFolder\n\non myOpenProjectFolder()\nset myPath to myProjectPath()\nmyOpenFolder(myPath)\nend myOpenProjectFolder\n\non myOpeniTermForCurrentProject()\nset myPath to myProjectPath()\nmyOpeniTerm(myPath)\nend myOpeniTermForCurrentProject\n\non myOpenDerivedDataFolder()\nset myRelativePath to myProjectPath() & \"\/DerivedData\/\"\nif myFolderExists(myRelativePath) then\nmyOpenFolder(myRelativePath)\nelse\nmyOpenFolder(myXcodePath() & \"\/DerivedData\/\")\nend if\nend myOpenDerivedDataFolder\n\non myOpenGitHub()\nset myPath to myProjectPath()\nset myConsoleOutput to (do shell script \"cd \" & quoted form of myPath & \"; git remote -v\")\nset myRemote to myGetRemote(myConsoleOutput)\nset myUrl to (do shell script \"cd \" & quoted form of myPath & \"; git config --get remote.\" & quoted form of myRemote & \".url\")\nopen location myUrl\nend myOpenGitHub\n","subject":"Add myGetRemote","message":"Add myGetRemote\n","lang":"AppleScript","license":"mit","repos":"onmyway133\/XcodeWay,onmyway133\/XcodeWay"}
{"commit":"6dcc626d17571f6f56ef38b14a594b376c9ea395","old_file":"Release\/dmg_growl.applescript","new_file":"Release\/dmg_growl.applescript","old_contents":"on run -- for testing in script editor\n\tprocess_disk_image(\"Growl\", \"\/Users\/evands\/growl\/Release\/Artwork\")\nend run\n\non process_disk_image(volumeName, artPath)\n\ttell application \"Finder\"\n\t\ttell disk volumeName\n\t\t\topen\n\t\t\ttell container window\n\t\t\t\tset current view to icon view\n\t\t\t\tset toolbar visible to false\n\t\t\t\tset statusbar visible to false\n\t\t\t\t--set the bounds to {30, 50, 579, 600}\n\t\t\tend tell\n\t\t\tclose\n\t\t\tset opts to the icon view options of container window\n\t\t\ttell opts\n\t\t\t\tset icon size to 64\n\t\t\t\tset arrangement to not arranged\n\t\t\tend tell\n\t\t\tset background picture of opts to file \".background:growlDMGBackground.png\"\n\t\t\tset position of item \"Growl.pkg\" to {147, 75}\n\t\t\tset position of item \"Extras\" to {100, 320}\n\t\t\t--set position of item \"Scripts\" to {36, 153}\n\t\t\tset position of item \"Growl Documentation.webloc\" to {100, 218}\n\t\t\tset position of item \"Growl version history.webloc\" to {275, 218}\n\t\t\tset position of item \"Get more styles.webloc\" to {415, 218}\n\t\t\tset position of item \"Uninstall Growl.app\" to {415, 320}\n\t\t\t\n\t\t\t-- Custom icons\n\t\t\tmy copyIconOfTo(artPath & \"\/GrowlIcon\", \"\/Volumes\/\" & volumeName & \"\/Growl.mpkg\")\n\t\t\t\n\t\t\tupdate without registering applications\n\t\t\ttell container window\n\t\t\t\topen\n\t\t\t\tset the_window_id to id\n\t\t\tend tell\n\t\t\tupdate without registering applications\n\t\tend tell\n\t\tset bounds of window id the_window_id to {30, 50, 575, 450}\n\t\t--give the finder some time to write the .DS_Store file\n\t\tdelay 5\n\tend tell\nend process_disk_image\n\non copyIconOfTo(aFileOrFolderWithIcon, aFileOrFolder)\n\ttell application \"Finder\" to set f to POSIX file aFileOrFolderWithIcon as alias\n\t-- grab the file's icon\n\tmy CopyOrPaste(f, \"c\")\n\t-- now the icon is in the clipboard\n\ttell application \"Finder\" to set c to POSIX file aFileOrFolder as alias\n\tmy CopyOrPaste(result, \"v\")\nend copyIconOfTo\n\non CopyOrPaste(i, cv)\n\ttell application \"Finder\"\n\t\tactivate\n\t\topen information window of i\n\tend tell\n\ttell application \"System Events\" to tell process \"Finder\" to tell window 1\n\t\tkeystroke tab -- select icon button\n\t\tkeystroke (cv & \"w\") using command down (* (copy or paste) + close window *)\n\tend tell -- window 1 then process Finder then System Events\nend CopyOrPaste\n","new_contents":"on run -- for testing in script editor\n\tprocess_disk_image(\"Growl\", \"\/Users\/evands\/growl\/Release\/Artwork\")\nend run\n\non process_disk_image(volumeName, artPath)\n\ttell application \"Finder\"\n\t\ttell disk volumeName\n\t\t\topen\n\t\t\ttell container window\n\t\t\t\tset current view to icon view\n\t\t\t\tset toolbar visible to false\n\t\t\t\tset statusbar visible to false\n\t\t\t\tset bounds to {30, 50, 579, 486}\n\t\t\tend tell\n\t\t\tclose\n\t\t\tset opts to the icon view options of container window\n\t\t\ttell opts\n\t\t\t\tset icon size to 64\n\t\t\t\tset arrangement to not arranged\n\t\t\tend tell\n\t\t\tset background picture of opts to file \".background:growlDMGBackground.png\"\n\t\t\tset position of item \"Growl.pkg\" to {147, 75}\n\t\t\tset position of item \"Extras\" to {100, 320}\n\t\t\t--set position of item \"Scripts\" to {36, 153}\n\t\t\tset position of item \"Growl Documentation.webloc\" to {100, 218}\n\t\t\tset position of item \"Growl version history.webloc\" to {275, 218}\n\t\t\tset position of item \"Get more styles.webloc\" to {415, 218}\n\t\t\tset position of item \"Uninstall Growl.app\" to {415, 320}\n\t\t\t\n\t\t\t-- Custom icons\n\t\t\tmy copyIconOfTo(artPath & \"\/GrowlIcon\", \"\/Volumes\/\" & volumeName & \"\/Growl.mpkg\")\n\t\t\t\n\t\t\tupdate without registering applications\n\t\t\ttell container window\n\t\t\t\topen\n\t\t\t\tset the_window_id to id\n\t\t\tend tell\n\t\t\tupdate without registering applications\n\t\tend tell\n\t\tset bounds of window id the_window_id to {30, 50, 575, 450}\n\t\t--give the finder some time to write the .DS_Store file\n\t\tdelay 5\n\tend tell\nend process_disk_image\n\non copyIconOfTo(aFileOrFolderWithIcon, aFileOrFolder)\n\ttell application \"Finder\" to set f to POSIX file aFileOrFolderWithIcon as alias\n\t-- grab the file's icon\n\tmy CopyOrPaste(f, \"c\")\n\t-- now the icon is in the clipboard\n\ttell application \"Finder\" to set c to POSIX file aFileOrFolder as alias\n\tmy CopyOrPaste(result, \"v\")\nend copyIconOfTo\n\non CopyOrPaste(i, cv)\n\ttell application \"Finder\"\n\t\tactivate\n\t\topen information window of i\n\tend tell\n\ttell application \"System Events\" to tell process \"Finder\" to tell window 1\n\t\tkeystroke tab -- select icon button\n\t\tkeystroke (cv & \"w\") using command down (* (copy or paste) + close window *)\n\tend tell -- window 1 then process Finder then System Events\nend CopyOrPaste\n","subject":"Set the bounds of the disk image volume window. I'm not sure why this was commented out. Not only have I uncommented it, I also changed the value.","message":"Set the bounds of the disk image volume window. I'm not sure why this was commented out. Not only have I uncommented it, I also changed the value.\n","lang":"AppleScript","license":"bsd-3-clause","repos":"PersonifyInc\/growl,incbee\/Growl,PersonifyInc\/growl,incbee\/Growl,incbee\/Growl,incbee\/Growl,PersonifyInc\/growl,PersonifyInc\/growl,incbee\/Growl,PersonifyInc\/growl"}
{"commit":"b7ee1c5622c637681081add5a2c8b3e17e4bf09c","old_file":"automation\/mac\/pictureit.scpt","new_file":"automation\/mac\/pictureit.scpt","old_contents":"#\n# This script outlines  the basic funcationality needed to build\n# an automatic scraper or other chrome automation function.  It solves\n# several annoying problems with automator and appleScript and should save\n# people a bunch of time.  It does not catch errors or implement other \n# bulletproofing.\n# \n# It uses google.com for illustration.  \n# Operations: \n#   Open chrome window of a certain size at position 0,0\n#   Type something in \n#   Click somewhere on the screen\n#   Screen shot just the window\n\nset screenWidth to 1200\nset screenHeight to 1440\n\ntell application \"Google Chrome\"\n\tactivate\n\tset w to make new window with properties {bounds:{0, 0, screenWidth, screenHeight}}\n\tdelay (random number from 0.2304 to 2.8472)\n\topen location \"http:\/\/google.com\"\n\tdelay (random number from 1.2304 to 2.8472)\n\ttell application \"System Events\" to keystroke \"test\"\n\tdelay (random number from 0.335 to 1.534)\n\t\n\ttell application \"System Events\" to keystroke return\n\tdelay (random number from 0.335 to 1.534)\n\t\n\trepeat 5 times\n\t\ttell application \"System Events\" to keystroke tab\n\t\tdelay (random number from 0.335 to 1.534)\n\tend repeat\nend tell\ndo shell script \"\/usr\/bin\/click -x 0 -y 0\"\nset fileName to do shell script \"date \\\"+Screen Shot  %Y-%m-%d at %H.%M.%S.png\\\"\"\ntell application \"System Events\" to set thePath to POSIX path of desktop folder\ndo shell script \"screencapture  -o -R0,0,1200,1400 -x -T 1 \" & \"\\\"\" & thePath & \"\/\" & fileName & \"\\\"\"\n\n\t\n","new_contents":"#\n# This script outlines  the basic funcationality needed to build\n# an automatic scraper or other chrome automation function.  It solves\n# several annoying problems with automator and appleScript and should save\n# people a bunch of time.  It does not catch errors or implement other \n# bulletproofing.\n# \n# It uses google.com for illustration.  \n# Operations: \n#   Open chrome window of a certain size at position 0,0\n#   Type something in \n#   Click somewhere on the screen\n#   Screen shot just the window\n\nset screenWidth to 1200\nset screenHeight to 1440\n\ntell application \"Google Chrome\"\n\tactivate\n\tset w to make new window with properties {bounds:{0, 0, screenWidth, screenHeight}}\n\tdelay (random number from 0.2304 to 2.8472)\n\topen location \"http:\/\/google.com\"\n\tdelay (random number from 1.2304 to 2.8472)\n\ttell application \"System Events\" to keystroke \"test\"\n\tdelay (random number from 0.335 to 1.534)\n\t\n\ttell application \"System Events\" to keystroke return\n\tdelay (random number from 0.335 to 1.534)\n\t\n\trepeat 5 times\n\t\ttell application \"System Events\" to keystroke tab\n\t\tdelay (random number from 0.335 to 1.534)\n\tend repeat\nend tell\ndo shell script \"\/usr\/local\/bin\/click -x 0 -y 0\"\nset fileName to do shell script \"date \\\"+Screen Shot  %Y-%m-%d at %H.%M.%S.png\\\"\"\ntell application \"System Events\" to set thePath to POSIX path of desktop folder\ndo shell script \"screencapture  -o -R0,0,1200,1400 -x -T 1 \" & \"\\\"\" & thePath & \"\/\" & fileName & \"\\\"\"\n\n\t\n","subject":"Update pictureit.scpt","message":"Update pictureit.scpt\n\nBest to put click in \/usr\/local\/bin","lang":"AppleScript","license":"apache-2.0","repos":"scarrico\/BayAreaFresh,scarrico\/BayAreaFresh,scarrico\/BayAreaFresh"}
{"commit":"aca26bf1a96b26d52a6dd8fc482d0ab5ea9400ed","old_file":"chrome\/lib\/controller.scpt","new_file":"chrome\/lib\/controller.scpt","old_contents":"on control(keyCode)\n  set code to \"var keyCode = \" & keyCode & \";\n    var event = document.createEvent('Events');\n    event.initEvent('keydown', true, true);\n    event.keyCode = keyCode;\n    event.which = keyCode;\n\n    document.dispatchEvent(event);\n  \"\n\n  set targetTab to activeTab() of me\n  executeJavaScript(targetTab, code) of me\nend control\n\non notifyCurrentSong()\n  set targetTab to activeTab() of me\n\n  set songCode to \"document.querySelector('.playerSongTitle .fade-out-content').innerHTML\"\n  set song to executeJavaScript(targetTab, songCode) of me\n\n  set artistCode to \"document.querySelector('.playerArtist .fade-out-content').innerHTML\"\n  set artist to executeJavaScript(targetTab, artistCode) of me\n\n  notify(song, artist) of me\nend notifyCurrentSong\n\non notify(name, message)\n  set command to \"\/usr\/local\/bin\/growlnotify -n \" & quoted form of name & \" -m \" & quoted form of message\n  do shell script command\nend notify\n\non activeTab()\n  set targetTab to null\n\n  tell application \"Google Chrome\"\n    repeat with theWindow in every window\n      repeat with theTab in every tab of theWindow\n        if theTab's title ends with \"- Google Play Music\" then\n          set targetTab to theTab\n          exit repeat\n        end if\n      end repeat\n    end repeat\n  end tell\n\n  return targetTab\nend activeTab\n\non executeJavaScript(activeTab, code)\n  set result to null\n\n  tell application \"Google Chrome\"\n    set result to execute activeTab javascript code\n  end tell\n\n  return result\nend executeJavaScript\n","new_contents":"on control(keyCode)\n  set code to \"var keyCode = \" & keyCode & \";\n    var event = document.createEvent('Events');\n    event.initEvent('keydown', true, true);\n    event.keyCode = keyCode;\n    event.which = keyCode;\n\n    document.dispatchEvent(event);\n  \"\n\n  set targetTab to activeTab() of me\n  executeJavaScript(targetTab, code) of me\nend control\n\non notifyCurrentSong()\n  set targetTab to activeTab() of me\n\n  set songCode to \"document.querySelector('#playerSongTitle').innerHTML\"\n  set song to executeJavaScript(targetTab, songCode) of me\n\n  set artistCode to \"document.querySelector('.player-artist-album-wrapper').innerText\"\n  set artist to executeJavaScript(targetTab, artistCode) of me\n\n  notify(song, artist) of me\nend notifyCurrentSong\n\non notify(name, message)\n  display notification message with title name\nend notify\n\non activeTab()\n  set targetTab to null\n\n  tell application \"Google Chrome\"\n    repeat with theWindow in every window\n      repeat with theTab in every tab of theWindow\n        if theTab's title ends with \"- Google Play Music\" then\n          set targetTab to theTab\n          exit repeat\n        end if\n      end repeat\n    end repeat\n  end tell\n\n  return targetTab\nend activeTab\n\non executeJavaScript(activeTab, code)\n  set result to null\n\n  tell application \"Google Chrome\"\n    set result to execute activeTab javascript code\n  end tell\n\n  return result\nend executeJavaScript\n","subject":"update to use notification center instead of growl","message":"update to use notification center instead of growl\n","lang":"AppleScript","license":"mit","repos":"atsuya\/google-music-control"}
{"commit":"4c6235ca33932483dd913b7b2abec1b0279b82b1","old_file":"Support\/inbox.app\/Contents\/Resources\/Scripts\/main.scpt","new_file":"Support\/inbox.app\/Contents\/Resources\/Scripts\/main.scpt","old_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000\u0007\u0000\b\r\u0000\u0007\u0000\u0002i\u0000\u0000\u0000\u0000\u0000\u0003\u0000\t\u0000\n\r\u0000\t\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0000\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000\n\u0000\u0003Q\u0000\u0000\u0000\u0000\u0000\u001d\u0000\u000b\u0000\f\r\u0000\u000b\u0000\u0001k\u0000\u0000\u0000\u0003\u0000\u0014\u0000\r\u0002\u0000\r\u0000\u0002\u0000\u000e\u0000\u000f\r\u0000\u000e\u0000\u0002r\u0000\u0000\u0000\u0003\u0000\f\u0000\u0010\u0000\u0011\r\u0000\u0010\u0000\u0002n\u0000\u0001\u0000\u0003\u0000\n\u0000\u0012\u0000\u0013\r\u0000\u0012\u0000\u0003I\u0000\u0000\u0000\u0004\u0000\n\u0000\u0014\u000b\u0000\u001a0\u0000\u000binputdialog\u0000\u000binputDialog\u0002\u0000\u0014\u0000\u0002\u0000\u0015\u0000\u0016\r\u0000\u0015\u0000\u0001m\u0000\u0000\u0000\u0004\u0000\u0005\u0000\u0017\u000e\u0000\u0017\u0000\u0001\u0000\u0018\u0011\u0000\u0018\u0000\u0016\u0000E\u0000n\u0000t\u0000e\u0000r\u0000 \u0000t\u0000a\u0000s\u0000k\u0000:\u0002\u0000\u0016\u0000\u0002\u0000\u0019\r\u0000\u0019\u0000\u0001m\u0000\u0000\u0000\u0005\u0000\u0006\u0000\u001a\u000e\u0000\u001a\u0000\u0001\u0000\u001b\u0011\u0000\u001b\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0013\u0000\u0000f\u0000\u0000\u0000\u0003\u0000\u0004\r\u0000\u0011\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\r0\u0000\ttask_text\u0000\u0000\u0002\u0000\u000f\u0000\u0002\u0000\u001c\r\u0000\u001c\u0000\u0002n\u0000\u0001\u0000\r\u0000\u0014\u0000\u001d\u0000\u001e\r\u0000\u001d\u0000\u0003I\u0000\u0000\u0000\u000e\u0000\u0014\u0000\u001f\u000b\u0000\"0\u0000\u000faddentrytoinbox\u0000\u000faddEntryToInbox\u0002\u0000\u001f\u0000\u0002\u0000 \u0000!\r\u0000 \u0000\u0001o\u0000\u0000\u0000\u000e\u0000\u000f\u000b\u0000\r0\u0000\ttask_text\u0000\u0000\u0002\u0000!\u0000\u0002\u0000\"\r\u0000\"\u0000\u0001m\u0000\u0000\u0000\u000f\u0000\u0010\u0000#\u000e\u0000#\u0000\u0001\u0000$\u0011\u0000$\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u001e\u0000\u0000f\u0000\u0000\u0000\r\u0000\u000e\u0002\u0000\u0000\r\u0000\f\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\b\u0000\u0002\u0000%\u0000&\r\u0000%\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000&\u0000\u0002\u0000'\u0000(\r\u0000'\u0000\u0002i\u0000\u0000\u0000\u0004\u0000\u0007\u0000)\u0000*\r\u0000)\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0000\u0000+\n\u0000\u0018.aevtodocnull\u0000\u0000\u0000\u0000\u0000\u0010\u0000alis\r\u0000+\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00110\u0000\rdropped_files\u0000\u0000\u0002\u0000\u0000\r\u0000*\u0000\u0003X\u0000\u0000\u0000\u0000\u0000H\u0000,\u0000-\r\u0000,\u0000\u0001k\u0000\u0000\u0000\u0010\u0000C\u0000.\u0002\u0000.\u0000\u0002\u0000\/\u00000\r\u0000\/\u0000\u0002r\u0000\u0000\u0000\u0010\u0000\u0017\u00001\u00002\r\u00001\u0000\u0002n\u0000\u0000\u0000\u0010\u0000\u0015\u00003\u00004\r\u00003\u0000\u00011\u0000\u0000\u0000\u0013\u0000\u0015\n\u0000\u0004\nstrq\r\u00004\u0000\u0002n\u0000\u0000\u0000\u0010\u0000\u0013\u00005\u00006\r\u00005\u0000\u00011\u0000\u0000\u0000\u0011\u0000\u0013\n\u0000\u0004\npsxp\r\u00006\u0000\u0001o\u0000\u0000\u0000\u0010\u0000\u0011\u000b\u0000\r0\u0000\tfile_path\u0000\u0000\r\u00002\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u000e0\u0000\u0005afile\u0000\u0005aFile\u0002\u00000\u0000\u0002\u00007\u00008\r\u00007\u0000\u0002r\u0000\u0000\u0000\u0018\u0000!\u00009\u0000:\r\u00009\u0000\u0003I\u0000\u0002\u0000\u0018\u0000\u001f\u0000;\n\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\r\u0000;\u0000\u0002b\u0000\u0000\u0000\u0018\u0000\u001b\u0000<\u0000=\r\u0000<\u0000\u0001m\u0000\u0000\u0000\u0018\u0000\u0019\u0000>\u000e\u0000>\u0000\u0001\u0000?\u0011\u0000?\u0000\u0012\u0000b\u0000a\u0000s\u0000e\u0000n\u0000a\u0000m\u0000e\u0000 \r\u0000=\u0000\u0001o\u0000\u0000\u0000\u0019\u0000\u001a\u000b\u0000\u000e0\u0000\u0005afile\u0000\u0005aFile\u0002\u0000\u0000\r\u0000:\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\f0\u0000\bfilename\u0000\u0000\u0002\u00008\u0000\u0002\u0000@\r\u0000@\u0000\u0003Q\u0000\u0000\u0000\"\u0000C\u0000A\u0000B\r\u0000A\u0000\u0001k\u0000\u0000\u0000%\u0000:\u0000C\u0002\u0000C\u0000\u0002\u0000D\u0000E\r\u0000D\u0000\u0002r\u0000\u0000\u0000%\u00002\u0000F\u0000G\r\u0000F\u0000\u0002n\u0000\u0001\u0000%\u00000\u0000H\u0000I\r\u0000H\u0000\u0003I\u0000\u0000\u0000&\u00000\u0000J\u000b\u0000\u001a0\u0000\u000binputdialog\u0000\u000binputDialog\u0002\u0000J\u0000\u0002\u0000K\u0000L\r\u0000K\u0000\u0002b\u0000\u0000\u0000&\u0000+\u0000M\u0000N\r\u0000M\u0000\u0002b\u0000\u0000\u0000&\u0000)\u0000O\u0000P\r\u0000O\u0000\u0001m\u0000\u0000\u0000&\u0000'\u0000Q\u000e\u0000Q\u0000\u0001\u0000R\u0011\u0000R\u0000 \u0000T\u0000a\u0000s\u0000k\u0000 \u0000r\u0000e\u0000l\u0000a\u0000t\u0000e\u0000d\u0000 \u0000t\u0000o\u0000 \r\u0000P\u0000\u0001o\u0000\u0000\u0000'\u0000(\u000b\u0000\f0\u0000\bfilename\u0000\u0000\r\u0000N\u0000\u0001m\u0000\u0000\u0000)\u0000*\u0000S\u000e\u0000S\u0000\u0001\u0000T\u0011\u0000T\u0000\u0002\u0000:\u0002\u0000L\u0000\u0002\u0000U\r\u0000U\u0000\u0001o\u0000\u0000\u0000+\u0000,\u000b\u0000\f0\u0000\bfilename\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000I\u0000\u0000f\u0000\u0000\u0000%\u0000&\r\u0000G\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\r0\u0000\ttask_text\u0000\u0000\u0002\u0000E\u0000\u0002\u0000V\r\u0000V\u0000\u0002n\u0000\u0001\u00003\u0000:\u0000W\u0000X\r\u0000W\u0000\u0003I\u0000\u0000\u00004\u0000:\u0000Y\u000b\u0000\"0\u0000\u000faddentrytoinbox\u0000\u000faddEntryToInbox\u0002\u0000Y\u0000\u0002\u0000Z\u0000[\r\u0000Z\u0000\u0001o\u0000\u0000\u00004\u00005\u000b\u0000\r0\u0000\ttask_text\u0000\u0000\u0002\u0000[\u0000\u0002\u0000\\\r\u0000\\\u0000\u0001o\u0000\u0000\u00005\u00006\u000b\u0000\u000e0\u0000\u0005afile\u0000\u0005aFile\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000X\u0000\u0000f\u0000\u0000\u00003\u00004\u0002\u0000\u0000\r\u0000B\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000b\u0000\r0\u0000\tfile_path\u0000\u0000\r\u0000-\u0000\u0001o\u0000\u0000\u0000\u0003\u0000\u0004\u000b\u0000\u00110\u0000\rdropped_files\u0000\u0000\u0002\u0000(\u0000\u0002\u0000]\u0000^\r\u0000]\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000^\u0000\u0002\u0000_\u0000`\r\u0000_\u0000\u0002i\u0000\u0000\u0000\b\u0000\u000b\u0000a\u0000b\r\u0000a\u0000\u0003I\u0000\u0000\u0000\u0000\u0000\u0000\u0000c\u000b\u0000\"0\u0000\u000faddentrytoinbox\u0000\u000faddEntryToInbox\u0002\u0000c\u0000\u0002\u0000d\u0000e\r\u0000d\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\r0\u0000\ttask_text\u0000\u0000\u0002\u0000e\u0000\u0002\u0000f\r\u0000f\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\r0\u0000\tfile_path\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000b\u0000\u0001k\u0000\u0000\u0000\u0000\u0000+\u0000g\u0002\u0000g\u0000\u0002\u0000h\u0000i\r\u0000h\u0000\u0002r\u0000\u0000\u0000\u0000\u0000\u0007\u0000j\u0000k\r\u0000j\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0005\u0000l\n\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\r\u0000l\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0000m\u000e\u0000m\u0000\u0001\u0000n\u0011\u0000n\u0000N\u0000d\u0000e\u0000f\u0000a\u0000u\u0000l\u0000t\u0000s\u0000 \u0000r\u0000e\u0000a\u0000d\u0000 \u0000i\u0000n\u0000b\u0000o\u0000x\u0000.\u0000a\u0000p\u0000p\u0000.\u0000p\u0000l\u0000i\u0000s\u0000t\u0000 \u0000i\u0000n\u0000b\u0000o\u0000x\u0000_\u0000c\u0000m\u0000d\u0002\u0000\u0000\r\u0000k\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\r0\u0000\tinbox_cmd\u0000\u0000\u0002\u0000i\u0000\u0002\u0000o\u0000p\r\u0000o\u0000\u0004Z\u0000\u0000\u0000\b\u0000\u0019\u0000q\u0000r\u0000s\r\u0000q\u0000\u0002=\u0000\u0003\u0000\b\u0000\u000b\u0000t\u0000u\r\u0000t\u0000\u0001o\u0000\u0000\u0000\b\u0000\t\u000b\u0000\r0\u0000\tfile_path\u0000\u0000\r\u0000u\u0000\u0001m\u0000\u0000\u0000\t\u0000\n\u0000v\u000e\u0000v\u0000\u0001\u0000w\u0011\u0000w\u0000\u0000\r\u0000r\u0000\u0002r\u0000\u0000\u0000\u000e\u0000\u0011\u0000x\u0000y\r\u0000x\u0000\u0001m\u0000\u0000\u0000\u000e\u0000\u000f\u0000z\u000e\u0000z\u0000\u0001\u0000{\u0011\u0000{\u0000\u0000\r\u0000y\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\f0\u0000\bfile_ref\u0000\u0000\u0002\u0000\u0000\r\u0000s\u0000\u0002r\u0000\u0000\u0000\u0014\u0000\u0019\u0000|\u0000}\r\u0000|\u0000\u0002b\u0000\u0000\u0000\u0014\u0000\u0017\u0000~\u0000\r\u0000~\u0000\u0001m\u0000\u0000\u0000\u0014\u0000\u0015\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0010\u0000 \u0000f\u0000i\u0000l\u0000e\u0000:\u0000\/\u0000\/\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0015\u0000\u0016\u000b\u0000\r0\u0000\tfile_path\u0000\u0000\r\u0000}\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\f0\u0000\bfile_ref\u0000\u0000\u0002\u0000p\u0000\u0002\u0000\u0000\r\u0000\u0000\u0002r\u0000\u0000\u0000\u001a\u0000#\u0000\u0000\r\u0000\u0000\u0002b\u0000\u0000\u0000\u001a\u0000!\u0000\u0000\r\u0000\u0000\u0002b\u0000\u0000\u0000\u001a\u0000\u001f\u0000\u0000\r\u0000\u0000\u0002b\u0000\u0000\u0000\u001a\u0000\u001d\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u001a\u0000\u001b\u000b\u0000\r0\u0000\tinbox_cmd\u0000\u0000\r\u0000\u0000\u0001m\u0000\u0000\u0000\u001b\u0000\u001c\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0002\u0000 \r\u0000\u0000\u0001o\u0000\u0000\u0000\u001d\u0000\u001e\u000b\u0000\r0\u0000\ttask_text\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u001f\u0000 \u000b\u0000\f0\u0000\bfile_ref\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00070\u0000\u0003cmd\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000$\u0000%\u000b\u0000\u00070\u0000\u0003cmd\u0000\u0000\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000&\u0000+\u0000\n\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\r\u0000\u0000\u0001o\u0000\u0000\u0000&\u0000'\u000b\u0000\u00070\u0000\u0003cmd\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\u0002\u0000`\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0002i\u0000\u0000\u0000\f\u0000\u000f\u0000\u0000\r\u0000\u0000\u0003I\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000binputdialog\u0000\u000binputDialog\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\t0\u0000\u0005title\u0000\u0000\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00100\u0000\fdefault_text\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u001b\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0002r\u0000\u0000\u0000\u0000\u0000\u0012\u0000\u0000\r\u0000\u0000\u0003l\u0000\u0005\u0000\u0000\u0000\u0010\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0010\u0000\u0000\n\u0000\u0018.sysodlogaskr\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000TEXT\r\u0000\u0000\u0003l\u0000\n\u0000\u0000\u0000\u0001\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0000\t0\u0000\u0005title\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0006\u0000\u0000\u0003\u0000\u0000\n\u0000\u0004\ndtxt\r\u0000\u0000\u0003l\u0000\n\u0000\u0002\u0000\u0003\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0002\u0000\u0003\u000b\u0000\u00100\u0000\fdefault_text\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0006\u0000\u0000\u0003\u0000\u0000\n\u0000\u0004\ndisp\r\u0000\u0000\u0003l\u0000\n\u0000\u0004\u0000\u0005\u0000\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0004\u0000\u0005\u0003\u0000\u0001\u0001\u0000\u0000\u0001\u0000\u0000\u0006\u0000\u0000\u0003\u0000\u0000\n\u0000\u0004\nbtns\r\u0000\u0000\u0003l\u0000\n\u0000\u0006\u0000\n\u0000\r\u0000\u0000\u0001J\u0000\u0000\u0000\u0006\u0000\n\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0006\u0000\u0007\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\f\u0000C\u0000a\u0000n\u0000c\u0000e\u0000l\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0007\u0000\b\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0004\u0000O\u0000K\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0006\u0000\u0000\u0003\u0000\n\u0000\u0004\ndflt\r\u0000\u0000\u0001m\u0000\u0000\u0000\u000b\u0000\f\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0004\u0000O\u0000K\u0006\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\tthedialog\u0000\ttheDialog\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0002r\u0000\u0000\u0000\u0013\u0000\u0018\u0000\u0000\r\u0000\u0000\u0002n\u0000\u0000\u0000\u0013\u0000\u0016\u0000\u0000\r\u0000\u0000\u00011\u0000\u0000\u0000\u0014\u0000\u0016\n\u0000\u0004\nttxt\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0013\u0000\u0014\u000b\u0000\u00160\u0000\tthedialog\u0000\ttheDialog\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u000e0\u0000\ntext_typed\u0000\u0000\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0001L\u0000\u0000\u0000\u0019\u0000\u001b\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0019\u0000\u001a\u000b\u0000\u000e0\u0000\ntext_typed\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\n\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0010\u0000\u0000\b~}\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\n\u0000\u0018.aevtodocnull\u0000\u0000\u0000\u0000\u0000\u0010\u0000alis\u000b\u0000\"0\u0000\u000faddentrytoinbox\u0000\u000faddEntryToInbox\u000b\u0000\u001a0\u0000\u000binputdialog\u0000\u000binputDialog\u000b\u0000\r0\u0000\ttask_text\u0000\u0000\u0001\u0000\u0000\u0001~\u0000\u0000\u0001}\u0000\u0000\u000e\u0000\u0000\u0007\u0010|\u0000\n{z\u0000\u0000y\n|\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u0001{\u0000\u0000\u0002z\u0000\u0000\u0010\u0000\u0000\u0000\u0010\u0000\u0000\b\u0000\u0017\u0000\u001axw\u0000#vut\u000bx\u0000\u001a0\u0000\u000binputdialog\u0000\u000binputDialog\u000bw\u0000\r0\u0000\ttask_text\u0000\u0000\u000bv\u0000\"0\u0000\u000faddentrytoinbox\u0000\u000faddEntryToInbox\u0001u\u0000\u0000\u0002t\u0000\u0000\u0011y\u0000\u001e\u0014\u0000\u0016)l+\u0000\u0002EO)l+\u0000\u0005W\u0000\bX\u0000\u0006\u0000\u0007h\u000f\u000e\u0000\u0000\u0007\u0010s\u0000*rq\u0000\u0000p\ns\u0000\u0018.aevtodocnull\u0000\u0000\u0000\u0000\u0000\u0010\u0000alis\u000br\u0000\u00110\u0000\rdropped_files\u0000\u0000\u0002q\u0000\u0000\u0010\u0000\u0000\u0005onmlk\u000bo\u0000\u00110\u0000\rdropped_files\u0000\u0000\u000bn\u0000\r0\u0000\tfile_path\u0000\u0000\u000bm\u0000\u000e0\u0000\u0005afile\u0000\u0005aFile\u000bl\u0000\f0\u0000\bfilename\u0000\u0000\u000bk\u0000\r0\u0000\ttask_text\u0000\u0000\u0010\u0000\u0000\rjihgf\u0000>e\u0000Q\u0000Sdcba\nj\u0000\u0004\nkocl\ni\u0000\u0004\ncobj\nh\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\ng\u0000\u0004\npsxp\nf\u0000\u0004\nstrq\ne\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\u000bd\u0000\u001a0\u0000\u000binputdialog\u0000\u000binputDialog\u000bc\u0000\"0\u0000\u000faddentrytoinbox\u0000\u000faddEntryToInbox\u0001b\u0000\u0000\u0002a\u0000\u0000\u0011p\u0000I\u0017\u0000G[l\f\u0000\u0002kh\u001b\u0000\u0001,,EO%j\f\u0000\u0006EO\u0014\u0000\u001a)%%l+\u0000\tEO)l+\u0000\nW\u0000\bX\u0000\u000b\u0000\fh[OY\u000f\u000e\u0000\u0000\u0007\u0010`\u0000b_^\u0000\u0000]\u000b`\u0000\"0\u0000\u000faddentrytoinbox\u0000\u000faddEntryToInbox\u000e_\u0000\u0002\u0004\\\u0000\u0003\\\u0000\u0002\u000e\u0000\u0000\u0002\u0000[Z\u000b[\u0000\r0\u0000\ttask_text\u0000\u0000\u000bZ\u0000\r0\u0000\tfile_path\u0000\u0000\u0002^\u0000\u0000\u0010\u0000\u0000\u0005YXWVU\u000bY\u0000\r0\u0000\ttask_text\u0000\u0000\u000bX\u0000\r0\u0000\tfile_path\u0000\u0000\u000bW\u0000\r0\u0000\tinbox_cmd\u0000\u0000\u000bV\u0000\f0\u0000\bfile_ref\u0000\u0000\u000bU\u0000\u00070\u0000\u0003cmd\u0000\u0000\u0010\u0000\u0000\u0006\u0000mT\u0000v\u0000z\u0000\u0000\nT\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\u0011]\u0000,j\f\u0000\u0001EO\u0000\u001d\u0000\bEY\u0000\u0007%EO%%%EOOj\f\u0000\u0001\u000f\u000e\u0000\u0000\u0007\u0010S\u0000RQ\u0000\u0000P\u000bS\u0000\u001a0\u0000\u000binputdialog\u0000\u000binputDialog\u000eR\u0000\u0002\u0004O\u0000\u0003O\u0000\u0002\u000e\u0000\u0000\u0002\u0000NM\u000bN\u0000\t0\u0000\u0005title\u0000\u0000\u000bM\u0000\u00100\u0000\fdefault_text\u0000\u0000\u0002Q\u0000\u0000\u0010\u0000\u0000\u0004LKJI\u000bL\u0000\t0\u0000\u0005title\u0000\u0000\u000bK\u0000\u00100\u0000\fdefault_text\u0000\u0000\u000bJ\u0000\u00160\u0000\tthedialog\u0000\ttheDialog\u000bI\u0000\u000e0\u0000\ntext_typed\u0000\u0000\u0010\u0000\u0000\nHGF\u0000\u0000E\u0000DCB\nH\u0000\u0004\ndtxt\nG\u0000\u0004\ndisp\nF\u0000\u0004\nbtns\nE\u0000\u0004\ndflt\u0003D\u0000\b\nC\u0000\u0018.sysodlogaskr\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000TEXT\nB\u0000\u0004\nttxt\u0011P\u0000\u001cklv\f\u0000\bEO,EO\u000f\u000f\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0006\u0000F\u0000o\u0000o\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0000ascr\u0000\u0001\u0000\r\u07ad","new_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000\u0007\u0000\b\r\u0000\u0007\u0000\u0002i\u0000\u0000\u0000\u0000\u0000\u0003\u0000\t\u0000\n\r\u0000\t\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0000\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000\n\u0000\u0003Q\u0000\u0000\u0000\u0000\u0000\u001d\u0000\u000b\u0000\f\r\u0000\u000b\u0000\u0001k\u0000\u0000\u0000\u0003\u0000\u0014\u0000\r\u0002\u0000\r\u0000\u0002\u0000\u000e\u0000\u000f\r\u0000\u000e\u0000\u0002r\u0000\u0000\u0000\u0003\u0000\f\u0000\u0010\u0000\u0011\r\u0000\u0010\u0000\u0002n\u0000\u0001\u0000\u0003\u0000\n\u0000\u0012\u0000\u0013\r\u0000\u0012\u0000\u0003I\u0000\u0000\u0000\u0004\u0000\n\u0000\u0014\u000b\u0000\u001a0\u0000\u000binputdialog\u0000\u000binputDialog\u0002\u0000\u0014\u0000\u0002\u0000\u0015\u0000\u0016\r\u0000\u0015\u0000\u0001m\u0000\u0000\u0000\u0004\u0000\u0005\u0000\u0017\u000e\u0000\u0017\u0000\u0001\u0000\u0018\u0011\u0000\u0018\u0000\u0016\u0000E\u0000n\u0000t\u0000e\u0000r\u0000 \u0000t\u0000a\u0000s\u0000k\u0000:\u0002\u0000\u0016\u0000\u0002\u0000\u0019\r\u0000\u0019\u0000\u0001m\u0000\u0000\u0000\u0005\u0000\u0006\u0000\u001a\u000e\u0000\u001a\u0000\u0001\u0000\u001b\u0011\u0000\u001b\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0013\u0000\u0000f\u0000\u0000\u0000\u0003\u0000\u0004\r\u0000\u0011\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\r0\u0000\ttask_text\u0000\u0000\u0002\u0000\u000f\u0000\u0002\u0000\u001c\r\u0000\u001c\u0000\u0002n\u0000\u0001\u0000\r\u0000\u0014\u0000\u001d\u0000\u001e\r\u0000\u001d\u0000\u0003I\u0000\u0000\u0000\u000e\u0000\u0014\u0000\u001f\u000b\u0000\"0\u0000\u000faddentrytoinbox\u0000\u000faddEntryToInbox\u0002\u0000\u001f\u0000\u0002\u0000 \u0000!\r\u0000 \u0000\u0001o\u0000\u0000\u0000\u000e\u0000\u000f\u000b\u0000\r0\u0000\ttask_text\u0000\u0000\u0002\u0000!\u0000\u0002\u0000\"\r\u0000\"\u0000\u0001m\u0000\u0000\u0000\u000f\u0000\u0010\u0000#\u000e\u0000#\u0000\u0001\u0000$\u0011\u0000$\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u001e\u0000\u0000f\u0000\u0000\u0000\r\u0000\u000e\u0002\u0000\u0000\r\u0000\f\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\b\u0000\u0002\u0000%\u0000&\r\u0000%\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000&\u0000\u0002\u0000'\u0000(\r\u0000'\u0000\u0002i\u0000\u0000\u0000\u0004\u0000\u0007\u0000)\u0000*\r\u0000)\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0000\u0000+\n\u0000\u0018.aevtodocnull\u0000\u0000\u0000\u0000\u0000\u0010\u0000alis\r\u0000+\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00110\u0000\rdropped_files\u0000\u0000\u0002\u0000\u0000\r\u0000*\u0000\u0003X\u0000\u0000\u0000\u0000\u0000H\u0000,\u0000-\r\u0000,\u0000\u0001k\u0000\u0000\u0000\u0010\u0000C\u0000.\u0002\u0000.\u0000\u0002\u0000\/\u00000\r\u0000\/\u0000\u0002r\u0000\u0000\u0000\u0010\u0000\u0017\u00001\u00002\r\u00001\u0000\u0002n\u0000\u0000\u0000\u0010\u0000\u0015\u00003\u00004\r\u00003\u0000\u00011\u0000\u0000\u0000\u0013\u0000\u0015\n\u0000\u0004\nstrq\r\u00004\u0000\u0002n\u0000\u0000\u0000\u0010\u0000\u0013\u00005\u00006\r\u00005\u0000\u00011\u0000\u0000\u0000\u0011\u0000\u0013\n\u0000\u0004\npsxp\r\u00006\u0000\u0001o\u0000\u0000\u0000\u0010\u0000\u0011\u000b\u0000\r0\u0000\tfile_path\u0000\u0000\r\u00002\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u000e0\u0000\u0005afile\u0000\u0005aFile\u0002\u00000\u0000\u0002\u00007\u00008\r\u00007\u0000\u0002r\u0000\u0000\u0000\u0018\u0000!\u00009\u0000:\r\u00009\u0000\u0003I\u0000\u0002\u0000\u0018\u0000\u001f\u0000;\n\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\r\u0000;\u0000\u0002b\u0000\u0000\u0000\u0018\u0000\u001b\u0000<\u0000=\r\u0000<\u0000\u0001m\u0000\u0000\u0000\u0018\u0000\u0019\u0000>\u000e\u0000>\u0000\u0001\u0000?\u0011\u0000?\u0000\u0012\u0000b\u0000a\u0000s\u0000e\u0000n\u0000a\u0000m\u0000e\u0000 \r\u0000=\u0000\u0001o\u0000\u0000\u0000\u0019\u0000\u001a\u000b\u0000\u000e0\u0000\u0005afile\u0000\u0005aFile\u0002\u0000\u0000\r\u0000:\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\f0\u0000\bfilename\u0000\u0000\u0002\u00008\u0000\u0002\u0000@\r\u0000@\u0000\u0003Q\u0000\u0000\u0000\"\u0000C\u0000A\u0000B\r\u0000A\u0000\u0001k\u0000\u0000\u0000%\u0000:\u0000C\u0002\u0000C\u0000\u0002\u0000D\u0000E\r\u0000D\u0000\u0002r\u0000\u0000\u0000%\u00002\u0000F\u0000G\r\u0000F\u0000\u0002n\u0000\u0001\u0000%\u00000\u0000H\u0000I\r\u0000H\u0000\u0003I\u0000\u0000\u0000&\u00000\u0000J\u000b\u0000\u001a0\u0000\u000binputdialog\u0000\u000binputDialog\u0002\u0000J\u0000\u0002\u0000K\u0000L\r\u0000K\u0000\u0002b\u0000\u0000\u0000&\u0000+\u0000M\u0000N\r\u0000M\u0000\u0002b\u0000\u0000\u0000&\u0000)\u0000O\u0000P\r\u0000O\u0000\u0001m\u0000\u0000\u0000&\u0000'\u0000Q\u000e\u0000Q\u0000\u0001\u0000R\u0011\u0000R\u0000 \u0000T\u0000a\u0000s\u0000k\u0000 \u0000r\u0000e\u0000l\u0000a\u0000t\u0000e\u0000d\u0000 \u0000t\u0000o\u0000 \r\u0000P\u0000\u0001o\u0000\u0000\u0000'\u0000(\u000b\u0000\f0\u0000\bfilename\u0000\u0000\r\u0000N\u0000\u0001m\u0000\u0000\u0000)\u0000*\u0000S\u000e\u0000S\u0000\u0001\u0000T\u0011\u0000T\u0000\u0002\u0000:\u0002\u0000L\u0000\u0002\u0000U\r\u0000U\u0000\u0001o\u0000\u0000\u0000+\u0000,\u000b\u0000\f0\u0000\bfilename\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000I\u0000\u0000f\u0000\u0000\u0000%\u0000&\r\u0000G\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\r0\u0000\ttask_text\u0000\u0000\u0002\u0000E\u0000\u0002\u0000V\r\u0000V\u0000\u0002n\u0000\u0001\u00003\u0000:\u0000W\u0000X\r\u0000W\u0000\u0003I\u0000\u0000\u00004\u0000:\u0000Y\u000b\u0000\"0\u0000\u000faddentrytoinbox\u0000\u000faddEntryToInbox\u0002\u0000Y\u0000\u0002\u0000Z\u0000[\r\u0000Z\u0000\u0001o\u0000\u0000\u00004\u00005\u000b\u0000\r0\u0000\ttask_text\u0000\u0000\u0002\u0000[\u0000\u0002\u0000\\\r\u0000\\\u0000\u0001o\u0000\u0000\u00005\u00006\u000b\u0000\u000e0\u0000\u0005afile\u0000\u0005aFile\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000X\u0000\u0000f\u0000\u0000\u00003\u00004\u0002\u0000\u0000\r\u0000B\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000b\u0000\r0\u0000\tfile_path\u0000\u0000\r\u0000-\u0000\u0001o\u0000\u0000\u0000\u0003\u0000\u0004\u000b\u0000\u00110\u0000\rdropped_files\u0000\u0000\u0002\u0000(\u0000\u0002\u0000]\u0000^\r\u0000]\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000^\u0000\u0002\u0000_\u0000`\r\u0000_\u0000\u0002i\u0000\u0000\u0000\b\u0000\u000b\u0000a\u0000b\r\u0000a\u0000\u0003I\u0000\u0000\u0000\u0000\u0000\u0000\u0000c\u000b\u0000\"0\u0000\u000faddentrytoinbox\u0000\u000faddEntryToInbox\u0002\u0000c\u0000\u0002\u0000d\u0000e\r\u0000d\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\r0\u0000\ttask_text\u0000\u0000\u0002\u0000e\u0000\u0002\u0000f\r\u0000f\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\r0\u0000\tfile_path\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000b\u0000\u0001k\u0000\u0000\u0000\u0000\u0000+\u0000g\u0002\u0000g\u0000\u0002\u0000h\u0000i\r\u0000h\u0000\u0002r\u0000\u0000\u0000\u0000\u0000\u0007\u0000j\u0000k\r\u0000j\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0005\u0000l\n\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\r\u0000l\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0000m\u000e\u0000m\u0000\u0001\u0000n\u0011\u0000n\u0000N\u0000d\u0000e\u0000f\u0000a\u0000u\u0000l\u0000t\u0000s\u0000 \u0000r\u0000e\u0000a\u0000d\u0000 \u0000i\u0000n\u0000b\u0000o\u0000x\u0000.\u0000a\u0000p\u0000p\u0000.\u0000p\u0000l\u0000i\u0000s\u0000t\u0000 \u0000i\u0000n\u0000b\u0000o\u0000x\u0000_\u0000c\u0000m\u0000d\u0002\u0000\u0000\r\u0000k\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\r0\u0000\tinbox_cmd\u0000\u0000\u0002\u0000i\u0000\u0002\u0000o\u0000p\r\u0000o\u0000\u0004Z\u0000\u0000\u0000\b\u0000\u0019\u0000q\u0000r\u0000s\r\u0000q\u0000\u0002=\u0000\u0003\u0000\b\u0000\u000b\u0000t\u0000u\r\u0000t\u0000\u0001o\u0000\u0000\u0000\b\u0000\t\u000b\u0000\r0\u0000\tfile_path\u0000\u0000\r\u0000u\u0000\u0001m\u0000\u0000\u0000\t\u0000\n\u0000v\u000e\u0000v\u0000\u0001\u0000w\u0011\u0000w\u0000\u0000\r\u0000r\u0000\u0002r\u0000\u0000\u0000\u000e\u0000\u0011\u0000x\u0000y\r\u0000x\u0000\u0001m\u0000\u0000\u0000\u000e\u0000\u000f\u0000z\u000e\u0000z\u0000\u0001\u0000{\u0011\u0000{\u0000\u0000\r\u0000y\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\f0\u0000\bfile_ref\u0000\u0000\u0002\u0000\u0000\r\u0000s\u0000\u0002r\u0000\u0000\u0000\u0014\u0000\u0019\u0000|\u0000}\r\u0000|\u0000\u0002b\u0000\u0000\u0000\u0014\u0000\u0017\u0000~\u0000\r\u0000~\u0000\u0001m\u0000\u0000\u0000\u0014\u0000\u0015\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0010\u0000 \u0000f\u0000i\u0000l\u0000e\u0000:\u0000\/\u0000\/\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0015\u0000\u0016\u000b\u0000\r0\u0000\tfile_path\u0000\u0000\r\u0000}\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\f0\u0000\bfile_ref\u0000\u0000\u0002\u0000p\u0000\u0002\u0000\u0000\r\u0000\u0000\u0002r\u0000\u0000\u0000\u001a\u0000#\u0000\u0000\r\u0000\u0000\u0002b\u0000\u0000\u0000\u001a\u0000!\u0000\u0000\r\u0000\u0000\u0002b\u0000\u0000\u0000\u001a\u0000\u001f\u0000\u0000\r\u0000\u0000\u0002b\u0000\u0000\u0000\u001a\u0000\u001d\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u001a\u0000\u001b\u000b\u0000\r0\u0000\tinbox_cmd\u0000\u0000\r\u0000\u0000\u0001m\u0000\u0000\u0000\u001b\u0000\u001c\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0002\u0000 \r\u0000\u0000\u0001o\u0000\u0000\u0000\u001d\u0000\u001e\u000b\u0000\r0\u0000\ttask_text\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u001f\u0000 \u000b\u0000\f0\u0000\bfile_ref\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00070\u0000\u0003cmd\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000$\u0000%\u000b\u0000\u00070\u0000\u0003cmd\u0000\u0000\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000&\u0000+\u0000\n\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\r\u0000\u0000\u0001o\u0000\u0000\u0000&\u0000'\u000b\u0000\u00070\u0000\u0003cmd\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\u0002\u0000`\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0002i\u0000\u0000\u0000\f\u0000\u000f\u0000\u0000\r\u0000\u0000\u0003I\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000binputdialog\u0000\u000binputDialog\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\t0\u0000\u0005title\u0000\u0000\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00100\u0000\fdefault_text\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u001b\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0002r\u0000\u0000\u0000\u0000\u0000\u0012\u0000\u0000\r\u0000\u0000\u0003l\u0000\u0005\u0000\u0000\u0000\u0010\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0010\u0000\u0000\n\u0000\u0018.sysodlogaskr\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000TEXT\r\u0000\u0000\u0003l\u0000\n\u0000\u0000\u0000\u0001\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0001\u000b\u0000\t0\u0000\u0005title\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0006\u0000\u0000\u0003\u0000\u0000\n\u0000\u0004\ndtxt\r\u0000\u0000\u0003l\u0000\n\u0000\u0002\u0000\u0003\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0002\u0000\u0003\u000b\u0000\u00100\u0000\fdefault_text\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0006\u0000\u0000\u0003\u0000\u0000\n\u0000\u0004\ndisp\r\u0000\u0000\u0003l\u0000\n\u0000\u0004\u0000\u0005\u0000\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0004\u0000\u0005\u0003\u0000\u0001\u0001\u0000\u0000\u0001\u0000\u0000\u0006\u0000\u0000\u0003\u0000\u0000\n\u0000\u0004\nbtns\r\u0000\u0000\u0003l\u0000\n\u0000\u0006\u0000\n\u0000\r\u0000\u0000\u0001J\u0000\u0000\u0000\u0006\u0000\n\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0006\u0000\u0007\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\f\u0000C\u0000a\u0000n\u0000c\u0000e\u0000l\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0007\u0000\b\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0004\u0000O\u0000K\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0006\u0000\u0000\u0003\u0000\n\u0000\u0004\ndflt\r\u0000\u0000\u0001m\u0000\u0000\u0000\u000b\u0000\f\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0004\u0000O\u0000K\u0006\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\tthedialog\u0000\ttheDialog\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0002r\u0000\u0000\u0000\u0013\u0000\u0018\u0000\u0000\r\u0000\u0000\u0002n\u0000\u0000\u0000\u0013\u0000\u0016\u0000\u0000\r\u0000\u0000\u00011\u0000\u0000\u0000\u0014\u0000\u0016\n\u0000\u0004\nttxt\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0013\u0000\u0014\u000b\u0000\u00160\u0000\tthedialog\u0000\ttheDialog\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u000e0\u0000\ntext_typed\u0000\u0000\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0001L\u0000\u0000\u0000\u0019\u0000\u001b\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0019\u0000\u001a\u000b\u0000\u000e0\u0000\ntext_typed\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\n\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0010\u0000\u0000\b~}\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\n\u0000\u0018.aevtodocnull\u0000\u0000\u0000\u0000\u0000\u0010\u0000alis\u000b\u0000\"0\u0000\u000faddentrytoinbox\u0000\u000faddEntryToInbox\u000b\u0000\u001a0\u0000\u000binputdialog\u0000\u000binputDialog\u000b\u0000\r0\u0000\ttask_text\u0000\u0000\u0001\u0000\u0000\u0001~\u0000\u0000\u0001}\u0000\u0000\u000e\u0000\u0000\u0007\u0010|\u0000\n{z\u0000\u0000y\n|\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u0001{\u0000\u0000\u0002z\u0000\u0000\u0010\u0000\u0000\u0000\u0010\u0000\u0000\b\u0000\u0017\u0000\u001axw\u0000#vut\u000bx\u0000\u001a0\u0000\u000binputdialog\u0000\u000binputDialog\u000bw\u0000\r0\u0000\ttask_text\u0000\u0000\u000bv\u0000\"0\u0000\u000faddentrytoinbox\u0000\u000faddEntryToInbox\u0001u\u0000\u0000\u0002t\u0000\u0000\u0011y\u0000\u001e\u0014\u0000\u0016)l+\u0000\u0002EO)l+\u0000\u0005W\u0000\bX\u0000\u0006\u0000\u0007h\u000f\u000e\u0000\u0000\u0007\u0010s\u0000*rq\u0000\u0000p\ns\u0000\u0018.aevtodocnull\u0000\u0000\u0000\u0000\u0000\u0010\u0000alis\u000br\u0000\u00110\u0000\rdropped_files\u0000\u0000\u0002q\u0000\u0000\u0010\u0000\u0000\u0005onmlk\u000bo\u0000\u00110\u0000\rdropped_files\u0000\u0000\u000bn\u0000\r0\u0000\tfile_path\u0000\u0000\u000bm\u0000\u000e0\u0000\u0005afile\u0000\u0005aFile\u000bl\u0000\f0\u0000\bfilename\u0000\u0000\u000bk\u0000\r0\u0000\ttask_text\u0000\u0000\u0010\u0000\u0000\rjihgf\u0000>e\u0000Q\u0000Sdcba\nj\u0000\u0004\nkocl\ni\u0000\u0004\ncobj\nh\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\ng\u0000\u0004\npsxp\nf\u0000\u0004\nstrq\ne\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\u000bd\u0000\u001a0\u0000\u000binputdialog\u0000\u000binputDialog\u000bc\u0000\"0\u0000\u000faddentrytoinbox\u0000\u000faddEntryToInbox\u0001b\u0000\u0000\u0002a\u0000\u0000\u0011p\u0000I\u0017\u0000G[l\f\u0000\u0002kh\u001b\u0000\u0001,,EO%j\f\u0000\u0006EO\u0014\u0000\u001a)%%l+\u0000\tEO)l+\u0000\nW\u0000\bX\u0000\u000b\u0000\fh[OY\u000f\u000e\u0000\u0000\u0007\u0010`\u0000b_^\u0000\u0000]\u000b`\u0000\"0\u0000\u000faddentrytoinbox\u0000\u000faddEntryToInbox\u000e_\u0000\u0002\u0004\\\u0000\u0003\\\u0000\u0002\u000e\u0000\u0000\u0002\u0000[Z\u000b[\u0000\r0\u0000\ttask_text\u0000\u0000\u000bZ\u0000\r0\u0000\tfile_path\u0000\u0000\u0002^\u0000\u0000\u0010\u0000\u0000\u0005YXWVU\u000bY\u0000\r0\u0000\ttask_text\u0000\u0000\u000bX\u0000\r0\u0000\tfile_path\u0000\u0000\u000bW\u0000\r0\u0000\tinbox_cmd\u0000\u0000\u000bV\u0000\f0\u0000\bfile_ref\u0000\u0000\u000bU\u0000\u00070\u0000\u0003cmd\u0000\u0000\u0010\u0000\u0000\u0006\u0000mT\u0000v\u0000z\u0000\u0000\nT\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\u0011]\u0000,j\f\u0000\u0001EO\u0000\u001d\u0000\bEY\u0000\u0007%EO%%%EOOj\f\u0000\u0001\u000f\u000e\u0000\u0000\u0007\u0010S\u0000RQ\u0000\u0000P\u000bS\u0000\u001a0\u0000\u000binputdialog\u0000\u000binputDialog\u000eR\u0000\u0002\u0004O\u0000\u0003O\u0000\u0002\u000e\u0000\u0000\u0002\u0000NM\u000bN\u0000\t0\u0000\u0005title\u0000\u0000\u000bM\u0000\u00100\u0000\fdefault_text\u0000\u0000\u0002Q\u0000\u0000\u0010\u0000\u0000\u0004LKJI\u000bL\u0000\t0\u0000\u0005title\u0000\u0000\u000bK\u0000\u00100\u0000\fdefault_text\u0000\u0000\u000bJ\u0000\u00160\u0000\tthedialog\u0000\ttheDialog\u000bI\u0000\u000e0\u0000\ntext_typed\u0000\u0000\u0010\u0000\u0000\nHGF\u0000\u0000E\u0000DCB\nH\u0000\u0004\ndtxt\nG\u0000\u0004\ndisp\nF\u0000\u0004\nbtns\nE\u0000\u0004\ndflt\u0003D\u0000\b\nC\u0000\u0018.sysodlogaskr\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000TEXT\nB\u0000\u0004\nttxt\u0011P\u0000\u001cklv\f\u0000\bEO,EO\u000f\u000f\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0006\u0000f\u0000o\u0000o\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0000ascr\u0000\u0001\u0000\r\u07ad","subject":"Update inbox applescript","message":"Update inbox applescript\n","lang":"AppleScript","license":"mit","repos":"persquare\/TextTasks.tmbundle"}
{"commit":"330494b6b28e28be3daae9ea8cc644507c20af1d","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tif length of theSongs is not greater than 1 then\n\t\t\treturn theSongs\n\t\tend if\n\n\t\tset trackCount to track count of (item 1 of theSongs)\n\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\tif trackCount is 0 or discCount is 0 then\n\t\t\treturn theSongs\n\t\tend if\n\n\t\tset theSongsSorted to {} as list\n\n\t\trepeat with discIndex from 1 to discCount\n\n\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\tif (disc number of theSong is discIndex or (disc number of theSong is 0 and discIndex is 1)) and track number of theSong is songIndex then\n\n\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\tend if\n\n\t\t\t\tend repeat\n\n\t\t\tend repeat\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","subject":"Remove sorting algo in favor of current sort order","message":"Remove sorting algo in favor of current sort order\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"f4df021ff0c4c39d028d488de883bdbbb60396de","old_file":"CotEditor\/InternalScript\/openDictionary.applescript","new_file":"CotEditor\/InternalScript\/openDictionary.applescript","old_contents":"(*\n\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u3001\u4e0b\u8a18\u306e\u30bd\u30fc\u30b9\u3092\u53c2\u8003\u306b\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002\nhttp:\/\/piza.2ch.net\/log2\/mac\/kako\/957\/957215209.html\n*)\ntell application \"Finder\"\n\tset the script_editor to application file id \"ToyS\"\n\tset file_path to path to frontmost application\n\tignoring application responses\n\t\topen file_path using script_editor\n\tend ignoring\nend tell\n","new_contents":"(*\n ==============================================================================\n openDictionary.applescript\n \n CotEditor\n http:\/\/coteditor.com\n \n Created on 2014-12-02 by 1024jp\n ------------------------------------------------------------------------------\n \n \u00a9 2014 1024jp\n \n This program is free software; you can redistribute it and\/or modify it under\n the terms of the GNU General Public License as published by the Free Software\n Foundation; either version 2 of the License, or (at your option) any later\n version.\n \n This program is distributed in the hope that it will be useful, but WITHOUT\n ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n \n You should have received a copy of the GNU General Public License along with\n this program; if not, write to the Free Software Foundation, Inc., 59 Temple\n Place - Suite 330, Boston, MA  02111-1307, USA.\n \n ==============================================================================\n *)\n \nset theApp to frontmost application\nset scriptEditor to application id \"com.apple.ScriptEditor2\"\n \nignoring application responses\n    tell scriptEditor to open (path to theApp)\nend ignoring\n","subject":"Rewrite openDictionary.applescript","message":"Rewrite openDictionary.applescript\n\nAvoid calling Finder for Sandbox.\n","lang":"AppleScript","license":"apache-2.0","repos":"eric-seekas\/CotEditor,uchuugaka\/CotEditor,onevcat\/CotEditor,uchuugaka\/CotEditor,eric-seekas\/CotEditor,angi2\/CotEditor,uchuugaka\/CotEditor,uchuugaka\/CotEditor,eric-seekas\/CotEditor,angi2\/CotEditor,uchuugaka\/CotEditor,uchuugaka\/CotEditor,yangchenghu\/CotEditor,eric-seekas\/CotEditor,yangchenghu\/CotEditor,eric-seekas\/CotEditor,eric-seekas\/CotEditor,eric-seekas\/CotEditor,onevcat\/CotEditor,uchuugaka\/CotEditor,angi2\/CotEditor,angi2\/CotEditor,angi2\/CotEditor,onevcat\/CotEditor,uchuugaka\/CotEditor,yangchenghu\/CotEditor,yangchenghu\/CotEditor,eric-seekas\/CotEditor,angi2\/CotEditor,angi2\/CotEditor,yangchenghu\/CotEditor"}
{"commit":"74fe089b497feaab0568de327f7f2e6aad57c3fc","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\n-- workflow folders\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\n\n-- the default icon used for search results without album artwork\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and use it to fetch album artwork\n\t\t\tset songId to persistent ID of theSong\n\t\t\t-- the base path to the artwork file (without extension)\n\t\t\tset artworkPath to (do shell script \".\/resources\/get-song-artwork-path.sh\" & space & songId & space & defaultIconName)\n\n\t\tend tell\n\n\t\treturn artworkPath\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\ttell application \"Music\"\n\n\t\tset genreSongs to every track of playlist 2 whose genre is genreName\n\n\tend tell\n\n\treturn genreSongs\n\nend getGenreSongs\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\n-- workflow folders\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\n\n-- the default icon used for search results without album artwork\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and use it to fetch album artwork\n\t\t\tset songId to persistent ID of theSong\n\t\t\t-- the base path to the artwork file (without extension)\n\t\t\tset artworkPath to (do shell script \".\/resources\/get-song-artwork-path.sh\" & space & songId & space & defaultIconName)\n\n\t\tend tell\n\n\t\treturn artworkPath\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\ttell application \"Music\"\n\n\t\tset genreSongs to every track of playlist 2 whose genre is genreName\n\n\tend tell\n\n\treturn genreSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n    tell application \"Music\"\n\n        set artistSongs to every track of playlist 2 whose artist is artistName\n        set albumNames to {}\n\n        repeat with theSong in artistSongs\n\n            if (album of theSong) is not in albumNames then\n\n                set albumNames to albumNames & (album of theSong)\n\n            end if\n\n        end repeat\n\n    end tell\n\n    return albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","subject":"Fix regression where a2ec45c broke playalbumby filter","message":"Fix regression where a2ec45c broke playalbumby filter\n\nThis is because a2ec45c removed the getArtistAlbums handler, which is\nused by the playalbumby filter.\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"621eb40dd3959c84ff377ed2769304addbc74f99","old_file":"support\/iphone\/itunes_sync.scpt","new_file":"support\/iphone\/itunes_sync.scpt","old_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\n\u0000\u0004\r\u0000\u0004\u0000\u0002O\u0000\u0001\u0000\u0000\u0000\n\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0003I\u0000\u0002\u0000\u0004\u0000\t\n\u0000\u0018.hookUpdtnull\u0000\u0000\u0000\u0000\u0000cSrc\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000\u0006\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0007\u000f\u0000\u0007\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000hook\u0000\u0000\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001L\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000@eH+\u0000\u0000\u0000\u0000\u0000\niTunes.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000uWMU\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fApplications\u0000\u0010\u0000\b\u0000\u0000@\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000ML\u0000\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000\u0000\u0002\u0000$Macintosh HD:Applications:iTunes.app\u0000\u000e\u0000\u0016\u0000\n\u0000i\u0000T\u0000u\u0000n\u0000e\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000\u0017Applications\/iTunes.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0003\u0000\b\u0000\t\u0001\u0000\u0000\u0010\u0000\b\u0000\u0001\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000e\u0000\t\u0000\u0007\u0010\u0000\n\u0000\u000b\u0000\f\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000\n\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\n\u0000\r\u0002\u0000\r\u0000\u0002\u0000\u0001\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000\u000b\u0000\u0000\u0010\u0000\f\u0000\u0002\u0000\u0007\n\u0000\u0018.hookUpdtnull\u0000\u0000\u0000\u0000\u0000cSrc\u0011\u0000\u000b\u0012\u0000\u0007*j\f\u0000\u0001U\u000fascr\u0000\u0001\u0000\f\u07ad","new_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0003l\u0000\u0002\u0000\u0000\u0000L\u0000\u0004\r\u0000\u0004\u0000\u0002O\u0000\u0000\u0000\u0000\u0000L\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0005Y\u0000\u0000\u0000\u0004\u0000K\u0000\u0007\u0000\b\u0000\t\r\u0000\u0007\u0000\u0004Z\u0000\u0000\u0000\u0014\u0000F\u0000\n\u0000\u000b\r\u0000\n\u0000\u0002=\u0000\u0003\u0000\u0014\u0000\u001c\u0000\f\u0000\r\r\u0000\f\u0000\u0003l\u0001\u0000\u0000\u0014\u0000\u001a\u0000\u000e\r\u0000\u000e\u0000\u0002n\u0000\u0000\u0000\u0014\u0000\u001a\u0000\u000f\u0000\u0010\r\u0000\u000f\u0000\u00011\u0000\u0000\u0000\u0018\u0000\u001a\n\u0000\u0004\npKnd\r\u0000\u0010\u0000\u00024\u0000\u0000\u0000\u0014\u0000\u0018\u0000\u0011\n\u0000\u0004\ncSrc\r\u0000\u0011\u0000\u0001o\u0000\u0000\u0000\u0016\u0000\u0017\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000\r\u0000\u0001m\u0000\u0000\u0000\u001a\u0000\u001b\n\u0000\b\u000beSrckPod\r\u0000\u000b\u0000\u0003Q\u0000\u0000\u0000\u001f\u0000B\u0000\u0012\u0000\u0013\u0000\u0014\r\u0000\u0012\u0000\u0003I\u0000\u0002\u0000\"\u0000'\u0000\u0015\n\u0000\u0018.hookUpdtnull\u0000\u0000\u0000\u0000\u0000cSrc\r\u0000\u0015\u0000\u0001o\u0000\u0000\u0000\"\u0000#\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\u0002\u0000\u0000\r\u0000\u0013\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0016\u0000\u0017\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000\u0016\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00140\u0000\berrorstr\u0000\berrorStr\u0006\u0000\u0017\u0000\u0003\u0000\u0018\n\u0000\u0004\nerrn\r\u0000\u0018\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000berrornumber\u0000\u000berrorNumber\u0006\u0000\u0000\r\u0000\u0014\u0000\u0003I\u0000\u0002\u0000\/\u0000B\u0000\u0019\n\u0000\u0018.ascrcmnt****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000\u0019\u0000\u0002b\u0000\u0000\u0000\/\u0000>\u0000\u001a\u0000\u001b\r\u0000\u001a\u0000\u0002b\u0000\u0000\u0000\/\u0000<\u0000\u001c\u0000\u001d\r\u0000\u001c\u0000\u0002b\u0000\u0000\u0000\/\u0000:\u0000\u001e\u0000\u001f\r\u0000\u001e\u0000\u0002b\u0000\u0000\u0000\/\u00008\u0000 \u0000!\r\u0000 \u0000\u0002b\u0000\u0000\u0000\/\u00006\u0000\"\u0000#\r\u0000\"\u0000\u0002b\u0000\u0000\u0000\/\u00004\u0000$\u0000%\r\u0000$\u0000\u0001m\u0000\u0000\u0000\/\u00000\u0000&\u000e\u0000&\u0000\u0001\u0000'\u0011\u0000'\u0000\u0016\u0000T\u0000h\u0000e\u0000 \u0000d\u0000e\u0000v\u0000i\u0000c\u0000e\u0000 \r\u0000%\u0000\u0002n\u0000\u0000\u00000\u00003\u0000(\u0000)\r\u0000(\u0000\u00011\u0000\u0000\u00001\u00003\n\u0000\u0004\npnam\r\u0000)\u0000\u0001o\u0000\u0000\u00000\u00001\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\r\u0000#\u0000\u0001m\u0000\u0000\u00004\u00005\u0000*\u000e\u0000*\u0000\u0001\u0000+\u0011\u0000+\u0000*\u0000 \u0000w\u0000a\u0000s\u0000 \u0000u\u0000n\u0000a\u0000b\u0000l\u0000e\u0000 \u0000t\u0000o\u0000 \u0000s\u0000y\u0000n\u0000c\u0000 \u0000(\r\u0000!\u0000\u0001o\u0000\u0000\u00006\u00007\u000b\u0000\u00140\u0000\berrorstr\u0000\berrorStr\r\u0000\u001f\u0000\u0001m\u0000\u0000\u00008\u00009\u0000,\u000e\u0000,\u0000\u0001\u0000-\u0011\u0000-\u0000\u0002\u0000:\r\u0000\u001d\u0000\u0001o\u0000\u0000\u0000:\u0000;\u000b\u0000\u001a0\u0000\u000berrornumber\u0000\u000berrorNumber\r\u0000\u001b\u0000\u0001m\u0000\u0000\u0000<\u0000=\u0000.\u000e\u0000.\u0000\u0001\u0000\/\u0011\u0000\/\u0000\u0002\u0000)\u0002\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\r\u0000\b\u0000\u0001m\u0000\u0000\u0000\u0007\u0000\b\u0003\u0000\u0001\r\u0000\t\u0000\u0003l\u0001\u0000\u0000\b\u0000\u000f\u00000\r\u00000\u0000\u0003I\u0000\u0001\u0000\b\u0000\u000f\u00001\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\r\u00001\u0000\u00012\u0000\u0001\u0000\b\u0000\u000b\n\u0000\u0004\ncSrc\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000\u0006\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u00002\u000f\u00002\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000hook\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001L\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0006SH+\u0000\u0000\u0000\u0000\u0000q\niTunes.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00007\u0003l\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fApplications\u0000\u0010\u0000\b\u0000\u0000\u0006\u001b\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000m$w\u0000\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000q\u0000\u0002\u0000$Macintosh HD:Applications:iTunes.app\u0000\u000e\u0000\u0016\u0000\n\u0000i\u0000T\u0000u\u0000n\u0000e\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000\u0017Applications\/iTunes.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0003\u00003\u00004\u0001\u0000\u0000\u0010\u00003\u0000\u0001\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000e\u00004\u0000\u0007\u0010\u00005\u00006\u00007\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u00005\u0000\u0001k\u0000\u0000\u0000\u0000\u0000L\u00008\u0002\u00008\u0000\u0002\u0000\u0001\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u00006\u0000\u0003\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\u000b\u0000\u00140\u0000\berrorstr\u0000\berrorStr\u000b\u0000\u001a0\u0000\u000berrornumber\u0000\u000berrorNumber\u0010\u00007\u0000\u000e\u00002\u00009\u0000&\u0000*\u0000,\u0000.\n\u0000\u0004\ncSrc\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\n\u0000\u0004\npKnd\n\u0000\b\u000beSrckPod\n\u0000\u0018.hookUpdtnull\u0000\u0000\u0000\u0000\u0000cSrc\u000b\u0000\u00140\u0000\berrorstr\u0000\berrorStr\u0006\u00009\u0000\u0003\n\u0000\u0004\nerrn\u000b\u0000\u001a0\u0000\u000berrornumber\u0000\u000berrorNumber\u0006\u0000\u0000\n\u0000\u0004\npnam\n\u0000\u0018.ascrcmnt****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0011\u0000M\u0012\u0000I\u0017\u0000Fk*-j\f\u0000\u0002kh\u001c\u0000\u0000*\/,\u0000\u001d\u0000(\u0014\u0000\nj\f\u0000\u0005W\u0000\u001aX\u0000\u0006\u0000\u0007,%%%%%%j\f\u0000\rY\u0000\u0003h[OYU\u000fascr\u0000\u0001\u0000\f\u07ad","subject":"Fix to support 'install to device' on iOS when no device present or sync disallowed [TISTUD-209]","message":"Fix to support 'install to device' on iOS when no device present or sync disallowed [TISTUD-209]\n","lang":"AppleScript","license":"apache-2.0","repos":"prop\/titanium_mobile,KangaCoders\/titanium_mobile,csg-coder\/titanium_mobile,mano-mykingdom\/titanium_mobile,linearhub\/titanium_mobile,sriks\/titanium_mobile,kopiro\/titanium_mobile,jhaynie\/titanium_mobile,benbahrenburg\/titanium_mobile,peymanmortazavi\/titanium_mobile,openbaoz\/titanium_mobile,collinprice\/titanium_mobile,hieupham007\/Titanium_Mobile,hieupham007\/Titanium_Mobile,pinnamur\/titanium_mobile,mano-mykingdom\/titanium_mobile,peymanmortazavi\/titanium_mobile,indera\/titanium_mobile,rblalock\/titanium_mobile,jvkops\/titanium_mobile,ashcoding\/titanium_mobile,jvkops\/titanium_mobile,prop\/titanium_mobile,falkolab\/titanium_mobile,openbaoz\/titanium_mobile,pec1985\/titanium_mobile,formalin14\/titanium_mobile,bright-sparks\/titanium_mobile,pinnamur\/titanium_mobile,FokkeZB\/titanium_mobile,hieupham007\/Titanium_Mobile,taoger\/titanium_mobile,bhatfield\/titanium_mobile,peymanmortazavi\/titanium_mobile,kopiro\/titanium_mobile,bhatfield\/titanium_mobile,kopiro\/titanium_mobile,ashcoding\/titanium_mobile,hieupham007\/Titanium_Mobile,smit1625\/titanium_mobile,emilyvon\/titanium_mobile,sriks\/titanium_mobile,shopmium\/titanium_mobile,KoketsoMabuela92\/titanium_mobile,mano-mykingdom\/titanium_mobile,AngelkPetkov\/titanium_mobile,benbahrenburg\/titanium_mobile,indera\/titanium_mobile,jhaynie\/titanium_mobile,emilyvon\/titanium_mobile,pinnamur\/titanium_mobile,rblalock\/titanium_mobile,sriks\/titanium_mobile,emilyvon\/titanium_mobile,bhatfield\/titanium_mobile,falkolab\/titanium_mobile,FokkeZB\/titanium_mobile,arnaudsj\/titanium_mobile,bright-sparks\/titanium_mobile,KangaCoders\/titanium_mobile,kopiro\/titanium_mobile,bhatfield\/titanium_mobile,FokkeZB\/titanium_mobile,jvkops\/titanium_mobile,linearhub\/titanium_mobile,mano-mykingdom\/titanium_mobile,falkolab\/titanium_mobile,mvitr\/titanium_mobile,taoger\/titanium_mobile,prop\/titanium_mobile,shopmium\/titanium_mobile,taoger\/titanium_mobile,bhatfield\/titanium_mobile,taoger\/titanium_mobile,collinprice\/titanium_mobile,benbahrenburg\/titanium_mobile,cheekiatng\/titanium_mobile,FokkeZB\/titanium_mobile,csg-coder\/titanium_mobile,pinnamur\/titanium_mobile,formalin14\/titanium_mobile,sriks\/titanium_mobile,perdona\/titanium_mobile,openbaoz\/titanium_mobile,linearhub\/titanium_mobile,rblalock\/titanium_mobile,jhaynie\/titanium_mobile,pinnamur\/titanium_mobile,FokkeZB\/titanium_mobile,arnaudsj\/titanium_mobile,mano-mykingdom\/titanium_mobile,falkolab\/titanium_mobile,formalin14\/titanium_mobile,falkolab\/titanium_mobile,KangaCoders\/titanium_mobile,indera\/titanium_mobile,ashcoding\/titanium_mobile,linearhub\/titanium_mobile,cheekiatng\/titanium_mobile,perdona\/titanium_mobile,cheekiatng\/titanium_mobile,jvkops\/titanium_mobile,KoketsoMabuela92\/titanium_mobile,perdona\/titanium_mobile,hieupham007\/Titanium_Mobile,arnaudsj\/titanium_mobile,KangaCoders\/titanium_mobile,mvitr\/titanium_mobile,kopiro\/titanium_mobile,bhatfield\/titanium_mobile,jhaynie\/titanium_mobile,collinprice\/titanium_mobile,emilyvon\/titanium_mobile,perdona\/titanium_mobile,prop\/titanium_mobile,openbaoz\/titanium_mobile,formalin14\/titanium_mobile,mvitr\/titanium_mobile,openbaoz\/titanium_mobile,cheekiatng\/titanium_mobile,collinprice\/titanium_mobile,smit1625\/titanium_mobile,pinnamur\/titanium_mobile,AngelkPetkov\/titanium_mobile,openbaoz\/titanium_mobile,emilyvon\/titanium_mobile,KoketsoMabuela92\/titanium_mobile,benbahrenburg\/titanium_mobile,smit1625\/titanium_mobile,indera\/titanium_mobile,smit1625\/titanium_mobile,pinnamur\/titanium_mobile,peymanmortazavi\/titanium_mobile,arnaudsj\/titanium_mobile,cheekiatng\/titanium_mobile,mvitr\/titanium_mobile,smit1625\/titanium_mobile,bhatfield\/titanium_mobile,arnaudsj\/titanium_mobile,csg-coder\/titanium_mobile,kopiro\/titanium_mobile,AngelkPetkov\/titanium_mobile,KoketsoMabuela92\/titanium_mobile,csg-coder\/titanium_mobile,mvitr\/titanium_mobile,falkolab\/titanium_mobile,bright-sparks\/titanium_mobile,emilyvon\/titanium_mobile,indera\/titanium_mobile,kopiro\/titanium_mobile,jhaynie\/titanium_mobile,rblalock\/titanium_mobile,pinnamur\/titanium_mobile,pec1985\/titanium_mobile,bright-sparks\/titanium_mobile,kopiro\/titanium_mobile,FokkeZB\/titanium_mobile,hieupham007\/Titanium_Mobile,rblalock\/titanium_mobile,benbahrenburg\/titanium_mobile,shopmium\/titanium_mobile,prop\/titanium_mobile,perdona\/titanium_mobile,shopmium\/titanium_mobile,falkolab\/titanium_mobile,bright-sparks\/titanium_mobile,mano-mykingdom\/titanium_mobile,benbahrenburg\/titanium_mobile,rblalock\/titanium_mobile,KoketsoMabuela92\/titanium_mobile,taoger\/titanium_mobile,KoketsoMabuela92\/titanium_mobile,sriks\/titanium_mobile,ashcoding\/titanium_mobile,jvkops\/titanium_mobile,bright-sparks\/titanium_mobile,cheekiatng\/titanium_mobile,openbaoz\/titanium_mobile,benbahrenburg\/titanium_mobile,prop\/titanium_mobile,taoger\/titanium_mobile,pec1985\/titanium_mobile,formalin14\/titanium_mobile,AngelkPetkov\/titanium_mobile,indera\/titanium_mobile,arnaudsj\/titanium_mobile,csg-coder\/titanium_mobile,perdona\/titanium_mobile,pec1985\/titanium_mobile,falkolab\/titanium_mobile,bhatfield\/titanium_mobile,indera\/titanium_mobile,taoger\/titanium_mobile,hieupham007\/Titanium_Mobile,linearhub\/titanium_mobile,AngelkPetkov\/titanium_mobile,collinprice\/titanium_mobile,mano-mykingdom\/titanium_mobile,KangaCoders\/titanium_mobile,sriks\/titanium_mobile,sriks\/titanium_mobile,shopmium\/titanium_mobile,FokkeZB\/titanium_mobile,rblalock\/titanium_mobile,shopmium\/titanium_mobile,AngelkPetkov\/titanium_mobile,hieupham007\/Titanium_Mobile,pec1985\/titanium_mobile,jvkops\/titanium_mobile,emilyvon\/titanium_mobile,FokkeZB\/titanium_mobile,benbahrenburg\/titanium_mobile,csg-coder\/titanium_mobile,prop\/titanium_mobile,mvitr\/titanium_mobile,perdona\/titanium_mobile,jvkops\/titanium_mobile,formalin14\/titanium_mobile,pec1985\/titanium_mobile,shopmium\/titanium_mobile,rblalock\/titanium_mobile,mano-mykingdom\/titanium_mobile,perdona\/titanium_mobile,mvitr\/titanium_mobile,jhaynie\/titanium_mobile,pec1985\/titanium_mobile,pec1985\/titanium_mobile,smit1625\/titanium_mobile,emilyvon\/titanium_mobile,indera\/titanium_mobile,peymanmortazavi\/titanium_mobile,AngelkPetkov\/titanium_mobile,peymanmortazavi\/titanium_mobile,AngelkPetkov\/titanium_mobile,mvitr\/titanium_mobile,collinprice\/titanium_mobile,linearhub\/titanium_mobile,ashcoding\/titanium_mobile,linearhub\/titanium_mobile,smit1625\/titanium_mobile,ashcoding\/titanium_mobile,collinprice\/titanium_mobile,bright-sparks\/titanium_mobile,jvkops\/titanium_mobile,csg-coder\/titanium_mobile,peymanmortazavi\/titanium_mobile,taoger\/titanium_mobile,KangaCoders\/titanium_mobile,shopmium\/titanium_mobile,jhaynie\/titanium_mobile,cheekiatng\/titanium_mobile,smit1625\/titanium_mobile,ashcoding\/titanium_mobile,peymanmortazavi\/titanium_mobile,KoketsoMabuela92\/titanium_mobile,pec1985\/titanium_mobile,KangaCoders\/titanium_mobile,openbaoz\/titanium_mobile,formalin14\/titanium_mobile,formalin14\/titanium_mobile,linearhub\/titanium_mobile,pinnamur\/titanium_mobile,sriks\/titanium_mobile,collinprice\/titanium_mobile,KangaCoders\/titanium_mobile,bright-sparks\/titanium_mobile,ashcoding\/titanium_mobile,KoketsoMabuela92\/titanium_mobile,prop\/titanium_mobile,jhaynie\/titanium_mobile,csg-coder\/titanium_mobile,cheekiatng\/titanium_mobile"}
{"commit":"4ddb10ee58c03166cd525e7788769ccaeb425171","old_file":"Release\/dmg_growl.applescript","new_file":"Release\/dmg_growl.applescript","old_contents":"tell application \"Finder\"\n\ttell disk \"Growl\"\n\t\topen\n\t\ttell container window\n\t\t\tset current view to icon view\n\t\t\tset toolbar visible to false\n\t\t\tset statusbar visible to false\n\t\t\t--set the bounds to {30, 50, 579, 600}\n\t\tend tell\n\t\tclose\n\t\tset opts to the icon view options of container window\n\t\ttell opts\n\t\t\tset icon size to 64\n\t\t\tset arrangement to not arranged\n\t\tend tell\n\t\tset background picture of opts to file \".background:growlDMGBackground.png\"\n\t\tset position of item \"Growl.prefPane\" to {147, 75}\n\t\tset position of item \"Extras\" to {80, 315}\n\t\t--set position of item \"Scripts\" to {36, 153}\n\t\tset position of item \"Growl Documentation.webloc\" to {100, 215}\n\t\tset position of item \"Growl version history.webloc\" to {275, 215}\n\t\tset position of item \"Get more styles.webloc\" to {415, 215}\n\t\tset position of item \"Uninstall Growl.app\" to {415, 315}\n\t\tupdate without registering applications\n\t\tset the_window_id to id of container window\n\t\tupdate without registering applications\n\tend tell\n\tset bounds of window id the_window_id to {30, 50, 579, 900}\n\t--give the finder some time to write the .DS_Store file\n\tdelay 5\nend tell\n","new_contents":"tell application \"Finder\"\n\ttell disk \"Growl\"\n\t\topen\n\t\ttell container window\n\t\t\tset current view to icon view\n\t\t\tset toolbar visible to false\n\t\t\tset statusbar visible to false\n\t\t\t--set the bounds to {30, 50, 579, 600}\n\t\tend tell\n\t\tclose\n\t\tset opts to the icon view options of container window\n\t\ttell opts\n\t\t\tset icon size to 64\n\t\t\tset arrangement to not arranged\n\t\tend tell\n\t\tset background picture of opts to file \".background:growlDMGBackground.png\"\n\t\tset position of item \"Growl.prefPane\" to {147, 75}\n\t\tset position of item \"Extras\" to {80, 315}\n\t\t--set position of item \"Scripts\" to {36, 153}\n\t\tset position of item \"Growl Documentation.webloc\" to {100, 215}\n\t\tset position of item \"Growl version history.webloc\" to {275, 215}\n\t\tset position of item \"Get more styles.webloc\" to {415, 215}\n\t\tset position of item \"Uninstall Growl.app\" to {415, 315}\n\t\tupdate without registering applications\n\t\ttell container window\n\t\t\topen\n\t\t\tset the_window_id to id\n\t\tend tell\n\t\tupdate without registering applications\n\tend tell\n\tset bounds of window id the_window_id to {30, 50, 579, 462}\n\t--give the finder some time to write the .DS_Store file\n\tdelay 5\nend tell\n","subject":"Save before committing!","message":"Save before committing!\n\n--HG--\nextra : convert_revision : svn%3A99687598-2e92-11dd-8019-fe7b9d601d1b\/trunk%404216\n","lang":"AppleScript","license":"bsd-3-clause","repos":"incbee\/Growl,PersonifyInc\/growl,incbee\/Growl,PersonifyInc\/growl,incbee\/Growl,incbee\/Growl,incbee\/Growl,PersonifyInc\/growl,PersonifyInc\/growl,PersonifyInc\/growl"}
{"commit":"7ea28364a90a68f480bffca668cee43160abecd7","old_file":"scripts\/pdfmatch_folder_action.applescript","new_file":"scripts\/pdfmatch_folder_action.applescript","old_contents":"# AppleScript folder action for the pdfmatch command\n#\n# Open with script editor, compile and save to\n# ~\/Library\/Workflows\/Applications\/Folder\\ Actions\/\n#\n# Then open the \"Folder Actions Setup\" application and add the work folder\n# where your pdfmatch.json config lives and attach this script.\n#\non adding folder items to this_folder after receiving these_files\n\ttry\n\t\trepeat with each_file in these_files\n\t\t\ttell application \"System Events\"\n\t\t\t\tif name extension of each_file is \"pdf\" or \"tif\" or \"tiff\" or \"jpeg\" or \"jpg\" then\n\t\t\t\t\t# You might need to add your node binary to your $PATH. For example:\n\t\t\t\t\t# export PATH=\/usr\/local\/bin:\/usr\/local\/opt\/node@6\/bin:$PATH \n\t\t\t\t\tset output to (do shell script \"export PATH=\/usr\/local\/bin:\/usr\/local\/opt\/node@6\/bin:$PATH && cd '\" & POSIX path of this_folder & \"' && pdfmatch '\" & POSIX path of each_file & \"' --delete 2>&1\")\n\t\t\t\t\t#display alert output\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend repeat\n\ton error err_string number error_number\n\t\tdisplay alert \"Error \" & error_number & \": \" & err_string\n\tend try\nend adding folder items to\n","new_contents":"# AppleScript folder action for the pdfmatch command\n#\n# Open with script editor, compile and save to\n# ~\/Library\/Workflows\/Applications\/Folder\\ Actions\/\n#\n# Then open the \"Folder Actions Setup\" application and add the work folder\n# where your pdfmatch.json config lives and attach this script.\n#\non adding folder items to this_folder after receiving these_files\n\ttry\n\t\trepeat with each_file in these_files\n\t\t\ttell application \"System Events\"\n\t\t\t\tif name extension of each_file is \"pdf\" or \"tif\" or \"tiff\" or \"jpeg\" or \"jpg\" then\n\t\t\t\t\t# You might need to add your node binary to your $PATH. For example:\n\t\t\t\t\t# export PATH=\/usr\/local\/bin:\/usr\/local\/opt\/node@6\/bin:$PATH \n\t\t\t\t\tset output to (do shell script \"cd '\" & POSIX path of this_folder & \"' && pdfmatch '\" & POSIX path of each_file & \"' --delete 2>&1\")\n\t\t\t\t\t#display alert output\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend repeat\n\ton error err_string number error_number\n\t\tdisplay alert \"Error \" & error_number & \": \" & err_string\n\tend try\nend adding folder items to\n","subject":"Remove my $PATH setting from default apple script","message":"Remove my $PATH setting from default apple script\n","lang":"AppleScript","license":"mit","repos":"mantoni\/pdfmatch.js"}
{"commit":"ddefa47e896de5eaf18037c85b9b66d893c9572d","old_file":"thumbscrew.scpt","new_file":"thumbscrew.scpt","old_contents":"-- thumbscrew.scpt\n-- usage: thumbscript.scpt <path_to_root_dir> <path_to_keynotePresentation> <presentation_name>\n--\n-- Will create scaled thumbnails of length `thumbSize` in the directory\n-- <path_to_root_dir>\/.keynote\/<presentation>\nproperty thumbSize : 480\nproperty thumbnailDir: \"keynotes\"\n\non getImages(f)\n  tell application \"Finder\" to return (files of folder f) as alias list\nend getImages\n\non run argv\n  set gitRoot to item 1 of argv\n  set tmpFile to item 2 of argv\n  set documentName to item 3 of argv\n  if documentName ends with \".key\" then set documentName to text 1 thru -5 of documentName\n\n  set gitRoot to posix file (POSIX path of (gitRoot as text) & \"\/\" & thumbnailDir) as alias\n  set tmpFile to (POSIX file tmpFile) as alias\n\n  tell application \"Keynote\"\n    activate\n    open tmpFile\n\n    if playing is true then stop the front document\n\n    tell application \"Finder\"\n      if not (exists folder documentName of folder gitRoot)\n        make new folder at gitRoot with properties {name:documentName}\n      end if\n      set the targetFolder to folder documentName of folder gitRoot\n      set the targetFolderHFSPath to targetFolder as string\n    end tell\n\n    export front document as slide images to file targetFolderHFSPath with properties {image format: JPEG}\n    set jpegs to my getImages(targetFolderHFSPath)\n    repeat with thisJPEG in jpegs\n      try\n        tell application \"Image Events\"\n          launch\n          set this_image to open thisJPEG\n          scale this_image to size thumbSize\n          save this_image with icon\n          close this_image\n        end tell\n        on error error_message\n          display dialog error_message\n      end try\n    end repeat\n\n    close front document without saving\n  end tell\n  return POSIX path of gitRoot\nend run\n","new_contents":"-- thumbscrew.scpt\n-- usage: thumbscript.scpt <path_to_root_dir> <path_to_keynotePresentation> <presentation_name>\n--\n-- Will create scaled thumbnails of length `thumbSize` in the directory\n-- <path_to_root_dir>\/.keynote\/<presentation>\nproperty thumbSize : 480\nproperty thumbnailDir: \"keynotes\"\n\non getImages(f)\n  tell application \"Finder\" to return (files of folder f) as alias list\nend getImages\n\non run argv\n  set gitRoot to item 1 of argv\n  set tmpFile to item 2 of argv\n  set documentName to item 3 of argv\n  if documentName ends with \".key\" then set documentName to text 1 thru -5 of documentName\n\n  set gitRoot to posix file (POSIX path of (gitRoot as text) & \"\/\" & thumbnailDir) as alias\n  set tmpFile to (POSIX file tmpFile) as alias\n\n  tell application \"Keynote\"\n    activate\n    open tmpFile\n\n    if playing is true then stop the front document\n\n    tell application \"Finder\"\n      if not (exists folder documentName of folder gitRoot)\n        make new folder at gitRoot with properties {name:documentName}\n      end if\n      set the targetFolder to folder documentName of folder gitRoot\n      set the targetFolderHFSPath to targetFolder as string\n    end tell\n\n    export front document as slide images to file targetFolderHFSPath with properties {image format: JPEG}\n    set jpegs to my getImages(targetFolderHFSPath)\n    repeat with thisJPEG in jpegs\n      try\n        tell application \"Image Events\"\n          launch\n          set this_image to open thisJPEG\n          scale this_image to size thumbSize\n          save this_image with icon\n          close this_image\n        end tell\n        on error error_message\n          display dialog error_message\n      end try\n    end repeat\n\n    close front document without saving\n  end tell\nend run\n","subject":"remove the return value so it doesnt get into the stream","message":"remove the return value so it doesnt get into the stream\n","lang":"AppleScript","license":"mit","repos":"azizshamim\/thumbscrew,helaili\/thumbscrew"}
{"commit":"fa78dd8d3fe31723a568999345ab067a25671d37","old_file":"actions\/clearcache.applescript","new_file":"actions\/clearcache.applescript","old_contents":"-- clears workflow cache, including album artwork and compiled scripts --\n\non loadConfig()\n\treturn (load script POSIX file (do shell script \".\/resources\/compile-config.sh\"))\nend loadConfig\n\non run query\n\tset config to loadConfig()\n\ttry\n\t\ttell application \"Finder\"\n\t\t\tdelete folder (workflowCacheFolder of config)\n\t\tend tell\n\tend try\nend run\n","new_contents":"-- clears workflow cache, including album artwork and compiled scripts --\n\non loadConfig()\n\treturn (load script POSIX file (do shell script \".\/resources\/compile-config.sh\"))\nend loadConfig\n\non run query\n\tset config to loadConfig()\n\ttry\n\t\ttell application \"Finder\"\n\t\t\tdelete folder (workflowCacheFolder of config)\n\t\tend tell\n\t\ttell application \"Music\"\n\t\t\tdelete user playlist (workflowPlaylistName of config)\n\t\tend tell\n\tend try\nend run\n","subject":"Delete Alfred Play Song playlist when clearing cache","message":"Delete Alfred Play Song playlist when clearing cache\n\nThis is becoming a helpful step when troubleshooting any issues.\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"88a5decbde7d5704dfe3d69b48308044d0b969f9","old_file":"macos\/chrome\/current-song.scpt","new_file":"macos\/chrome\/current-song.scpt","old_contents":"set theFolder to POSIX path of ((the path to me as text) & \"::\")\nset Controller to run script (\"script s\" & return & (read alias (POSIX file (theFolder & \"\/lib\/controller.scpt\")) as \u00abclass utf8\u00bb) & return & \"end script \" & return & \"return s\")\n\nset currentTrack to Controller's getCurrentSong()\n\nset output to item 1 of currentTrack & \" - \" & item 2 of currentTrack\n\ndo shell script \"echo \" & quoted form of output\n","new_contents":"set theFolder to POSIX path of ((the path to me as text) & \"::\")\nset Controller to run script (\"script s\" & return & (read alias (POSIX file (theFolder & \"\/lib\/controller.scpt\")) as \u00abclass utf8\u00bb) & return & \"end script \" & return & \"return s\")\n\nset currentTrack to Controller's getCurrentSong()\n\ntry\n  set output to quoted form of (item 1 of currentTrack & \" - \" & item 2 of currentTrack)\non error\n  set output to \"\"\nend try\n\ndo shell script \"echo \" & output\n","subject":"Set current song to empty string if nothing is playing","message":"Set current song to empty string if nothing is playing\n","lang":"AppleScript","license":"mit","repos":"atsuya\/google-music-control"}
{"commit":"2993e22789d3d012eb65dbadfbcda3694deb335b","old_file":"script\/start_install.scpt","new_file":"script\/start_install.scpt","old_contents":"#!\/usr\/bin\/env osascript\n\n-- Fist: Click Install Button\nset timeoutSeconds to 8.0\n\nmy doWithTimeout(\"click UI Element \\\"Install\\\" of window 1 of application process \\\"Install Command Line Developer Toold\\\"\", timeoutSeconds)\nmy doWithTimeout(\"click UI Element \\\"Agree\\\" of window 1 of application process \\\"Install Command Line Developer Toold\\\"\", timeoutSeconds)\n\non doWithTimeout(uiScript, timeoutSeconds)\n  set endDate to (current date) + timeoutSeconds\n  repeat\n    try\n      run script \"tell application \\\"System Events\\\"\n\" & uiScript & \"\nend tell\"\n      exit repeat\n    on error errorMessage\n      if ((current date) > endDate) then\n        error \"Can not \" & uiScript\n      end if\n    end try\n  end repeat\nend doWithTimeout\n","new_contents":"#!\/usr\/bin\/env osascript\n\n-- Fist: Click Install Button\nset timeoutSeconds to 8.0\n\nmy doWithTimeout(\"click UI Element \\\"Install\\\" of window 1 of application process \\\"Install Command Line Developer Tools\\\"\", timeoutSeconds)\nmy doWithTimeout(\"click UI Element \\\"Agree\\\" of window 1 of application process \\\"Install Command Line Developer Tools\\\"\", timeoutSeconds)\n\non doWithTimeout(uiScript, timeoutSeconds)\n  set endDate to (current date) + timeoutSeconds\n  repeat\n    try\n      run script \"tell application \\\"System Events\\\"\n\" & uiScript & \"\nend tell\"\n      exit repeat\n    on error errorMessage\n      if ((current date) > endDate) then\n        error \"Can not \" & uiScript\n      end if\n    end try\n  end repeat\nend doWithTimeout\n","subject":"Fix fatal mistake","message":"Fix fatal mistake\n","lang":"AppleScript","license":"mit","repos":"k0kubun\/rebuild,k0kubun\/rebuild"}
{"commit":"32dd1e9210fd345d3508f3e67430338ca04ac7f5","old_file":"QuickStats\/QuickStats.applescript","new_file":"QuickStats\/QuickStats.applescript","old_contents":"property pTitle : \"OmniFocus: Quick Stats\"\nproperty pVersion : \"2.07.brett\"\n\nproperty pstrDBPath : \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/com.omnigroup.OmniFocus\/OmniFocusDatabase2\"\nproperty pstrMinOSX : \"10.9\"\n\nproperty pTimeOut : 30\n\n-- Original version: https:\/\/github.com\/RobTrew\/tree-tools\/blob\/master\/OmniFocus%20scripts\/Statistics\/QuickStats.applescript\n\n-- Copyright  2012, 2013, 2014 Robin Trew\n-- \n-- Permission is hereby granted, free of charge, \n-- to any person obtaining a copy of this software \n-- and associated documentation files (the \"Software\"), \n-- to deal in the Software without restriction, \n-- including without limitation the rights to use, copy, \n-- modify, merge, publish, distribute, sublicense, \n-- and\/or sell copies of the Software, and to permit persons \n-- to whom the Software is furnished to do so, \n-- subject to the following conditions:\n-- \n-- *******\n-- The above copyright notice and this permission notice \n-- shall be included in ALL copies \n-- or substantial portions of the Software.\n-- *******\n-- \n-- THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, \n-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES \n-- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \n-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \n-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, \n-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE \n-- OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n-- Ver 0.8 adds clipboard option to dialogue\n-- Ver 0.9 gives an error message if the cache schema has changed, leading to an SQL error in the script\n-- Ver 1.0 slight simplification of the code\n-- Ver 1.1 added count of Pending projects\n-- Ver 1.2 added a count of available actions\n-- Ver 1.3 added a break-down of unavailable actions\n-- Ver 1.4 added count of Current projects to complement Pending projects\n-- ver 1.5 replaced Applescript time function with SQL time expression\n-- Ver 1.7 Reorganizes menu, and attempts to enable access for .macappstore installations of OF\n--Ver 1.8 Adjusts handling of variant bundle identifiers generally\n-- Ver 2.00 Redraft of task breakdown, with progressive narrowing of criteria ...\n\nproperty pToClipboard : \"Copy list to clipboard\"\n\nif not FileExists(pstrDBPath) then set pstrDBPath to GetCachePath()\n\ntell application \"Finder\"\n\tif (version < pstrMinOSX) then\n\t\tdisplay dialog \"This script requires OSX \" & pstrMinOSX & \" or higher\" buttons {\"OK\"} default button 1 with title pTitle & \"Ver. \" & pVersion\n\t\treturn\n\tend if\n\n\tset screen_resolution to bounds of window of desktop\n\tset height to item 4 of screen_resolution\n\tif height < 900 then\n\t\tset brief to true\n\telse\n\t\tset brief to false\n\tend if\nend tell\n\nif pstrDBPath  \"\" then\n\tset inbox_cmd to \"\n\tselect 'INBOX GROUPS & ACTIONS', count(*) from task where (inInbox=1);\n\tselect '    Inbox action groups', count(*) from task where (inInbox=1) and (childrenCount>0);\n\tselect '    Inbox actions', count(*) from task where (inInbox=1) and (childrenCount=0);\n\tselect null;\n\t\"\n\tset folders_cmd to \"\n\tselect 'FOLDERS'\t, count(*) from folder;\n\tselect '    Active folders', count(*) from folder where effectiveActive=1;\n\tselect '    Dropped folders', count(*) from folder where effectiveActive=0;\n\tselect null;\n\t\"\n\tset projects_cmd to \"\n\tselect 'PROJECTS', count(*) from projectInfo where containsSingletonActions=0;\n\tselect '    Active projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='active');\n\tselect '            Current projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart is null or t.dateToStart < (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '            Pending projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart > (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '    On-hold projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='inactive');\n\tselect '    Completed projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='done');\n\tselect '    Dropped projects', count(*) from projectInfo where (containsSingletonActions=0) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset lists_cmd to \"\n\tselect 'SINGLE ACTION LISTS', count(*) from projectInfo where containsSingletonActions=1;\n\tselect '    Active single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='active');\n\tselect '    On-hold single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='inactive');\n\tselect '    Completed single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='done');\n\tselect '    Dropped single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset contexts_cmd to \"\n\tselect 'CONTEXTS', count(*) from context;\n\tselect '    Active contexts', count(*) from context where (effectiveActive=1) and (allowsNextAction=1);\n\tselect '    On-hold contexts', count(*) from context where (effectiveActive=1) and allowsNextAction=0;\n\tselect '    Dropped contexts', count(*) from context where effectiveActive=0;\n\tselect null;\n\t\"\n\tset groups_cmd to \"\n\tselect 'ACTION GROUPS', count(*) from task where (projectinfo is null) and (childrenCount>0);\n\tselect '    Remaining action groups', count(*) from task where (projectinfo is null) and (dateCompleted is null) and (childrenCount>0);\n\tselect '    Completed action groups', count(dateCompleted) from task where (projectinfo is null) and (childrenCount>0);\n\tselect null;\n\t\"\n\tset tasks_cmd to \"\n\tselect 'ALL TASKS', count(*) from task;\n\tselect null;\n\t\"\n\tset actions_cmd to \"\n\tselect 'ACTIONS', count(*) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Completed actions', count(dateCompleted) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Dropped project actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp where (projectinfo is null) and (childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is not null and (tp.status='dropped' or tp.folderEffectiveActive=0));\n\tselect '    Dropped context actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand c.effectiveActive= 0;\n\tselect '    Remaining actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1);\n\tselect '        Actions in Projects on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is not null and tp.status='inactive');\n\tselect '        Actions in Contexts on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is not null and c.allowsNextAction=0);\n\tselect '        Blocked actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1;\n\tselect '        \tBlocked by future start date', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=1;\n\tselect '        \tSequentially blocked', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=0;\n\tselect '        Available actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=0;\n\tselect null;\n\t\"\n\tset summary_cmd to \"\n\tselect 'SUMMARY';\n\tselect '    Inbox available actions', count(*) from task where (inInbox=1) and (dateCompleted is null);\n\tselect '    Due in next week', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01');\n\tselect '    Flagged projects and actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand tp.effectiveFlagged;\n\tselect '    Due or Flagged', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand (tp.effectiveFlagged or (effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01')));\n\tselect null;\n\t\"\n\tif brief then\n\t\tset commands to projects_cmd & lists_cmd & contexts_cmd & groups_cmd & actions_cmd & summary_cmd\n\telse\n\t\tset commands to inbox_cmd & folders_cmd & projects_cmd & lists_cmd & contexts_cmd & groups_cmd & actions_cmd & tasks_cmd & summary_cmd\n\tend if\n\tset strCmd to \"sqlite3 -separator ': ' \\\"\" & pstrDBPath & \"\\\" \" & quoted form of (commands)\n\t\n\t-- \t\ttry\n\tset strList to do shell script strCmd\n\t-- \t\ton error\n\t-- \t\t\tdisplay dialog \"The SQL schema for the OmniFocus cache may have changed in a recent update of OF.\" & return & return & \n\t-- \t\t\t\t\"Look on the OmniFocus user forums for an updated version of this script.\" buttons {\"OK\"} with title pTitle & \"Ver. \" & pVersion\n\t-- \t\t\treturn\n\t-- \t\tend try\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tif button returned of (display dialog strList buttons {pToClipboard, \"OK\"} default button \"OK\" giving up after pTimeOut with title pTitle & \" Ver. \" & pVersion) \n\t\t\tis pToClipboard then tell application id \"com.apple.finder\" to set the clipboard to strList\n\tend tell\nelse\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tdisplay dialog \"OmniFocus cache not found ...\" buttons {\"OK\"} default button 1 with title pTitle & \" Ver. \" & pVersion\n\tend tell\nend if\n\n\non FileExists(strPath)\n\t(do shell script \"test -e \" & strPath & \" ; echo $?\") = \"0\"\nend FileExists\n\non GetCachePath()\n\ttry\n\t\ttell application \"Finder\" to tell (application file id \"OFOC\") to \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/\" & its id & \"\/OmniFocusDatabase2\"\n\ton error\n\t\terror \"OmniFocus not installed ...\"\n\tend try\nend GetCachePath\n\n","new_contents":"property pTitle : \"OmniFocus: Quick Stats\"\nproperty pVersion : \"2.07.brett\"\n\nproperty pstrDBPath : \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/com.omnigroup.OmniFocus\/OmniFocusDatabase2\"\nproperty pstrMinOSX : \"10.9\"\n\nproperty pTimeOut : 30\n\n-- Original version: https:\/\/github.com\/RobTrew\/tree-tools\/blob\/master\/OmniFocus%20scripts\/Statistics\/QuickStats.applescript\n\n-- Copyright  2012, 2013, 2014 Robin Trew\n-- \n-- Permission is hereby granted, free of charge, \n-- to any person obtaining a copy of this software \n-- and associated documentation files (the \"Software\"), \n-- to deal in the Software without restriction, \n-- including without limitation the rights to use, copy, \n-- modify, merge, publish, distribute, sublicense, \n-- and\/or sell copies of the Software, and to permit persons \n-- to whom the Software is furnished to do so, \n-- subject to the following conditions:\n-- \n-- *******\n-- The above copyright notice and this permission notice \n-- shall be included in ALL copies \n-- or substantial portions of the Software.\n-- *******\n-- \n-- THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, \n-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES \n-- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \n-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \n-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, \n-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE \n-- OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n-- Ver 0.8 adds clipboard option to dialogue\n-- Ver 0.9 gives an error message if the cache schema has changed, leading to an SQL error in the script\n-- Ver 1.0 slight simplification of the code\n-- Ver 1.1 added count of Pending projects\n-- Ver 1.2 added a count of available actions\n-- Ver 1.3 added a break-down of unavailable actions\n-- Ver 1.4 added count of Current projects to complement Pending projects\n-- ver 1.5 replaced Applescript time function with SQL time expression\n-- Ver 1.7 Reorganizes menu, and attempts to enable access for .macappstore installations of OF\n--Ver 1.8 Adjusts handling of variant bundle identifiers generally\n-- Ver 2.00 Redraft of task breakdown, with progressive narrowing of criteria ...\n\nproperty pToClipboard : \"Copy list to clipboard\"\n\nif not FileExists(pstrDBPath) then set pstrDBPath to GetCachePath()\n\ntell application \"Finder\"\n\tif (version < pstrMinOSX) then\n\t\tdisplay dialog \"This script requires OSX \" & pstrMinOSX & \" or higher\" buttons {\"OK\"} default button 1 with title pTitle & \"Ver. \" & pVersion\n\t\treturn\n\tend if\n\n\tset screen_resolution to bounds of window of desktop\n\tset height to item 4 of screen_resolution\n\tif height < 1024 then\n\t\tset brief to true\n\telse\n\t\tset brief to false\n\tend if\nend tell\n\nif pstrDBPath  \"\" then\n\tset inbox_cmd to \"\n\tselect 'INBOX GROUPS & ACTIONS', count(*) from task where (inInbox=1);\n\tselect '    Inbox action groups', count(*) from task where (inInbox=1) and (childrenCount>0);\n\tselect '    Inbox actions', count(*) from task where (inInbox=1) and (childrenCount=0);\n\tselect null;\n\t\"\n\tset folders_cmd to \"\n\tselect 'FOLDERS'\t, count(*) from folder;\n\tselect '    Active folders', count(*) from folder where effectiveActive=1;\n\tselect '    Dropped folders', count(*) from folder where effectiveActive=0;\n\tselect null;\n\t\"\n\tset projects_cmd to \"\n\tselect 'PROJECTS', count(*) from projectInfo where containsSingletonActions=0;\n\tselect '    Active projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='active');\n\tselect '            Current projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart is null or t.dateToStart < (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '            Pending projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart > (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '    On-hold projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='inactive');\n\tselect '    Completed projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='done');\n\tselect '    Dropped projects', count(*) from projectInfo where (containsSingletonActions=0) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset lists_cmd to \"\n\tselect 'SINGLE ACTION LISTS', count(*) from projectInfo where containsSingletonActions=1;\n\tselect '    Active single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='active');\n\tselect '    On-hold single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='inactive');\n\tselect '    Completed single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='done');\n\tselect '    Dropped single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset contexts_cmd to \"\n\tselect 'CONTEXTS', count(*) from context;\n\tselect '    Active contexts', count(*) from context where (effectiveActive=1) and (allowsNextAction=1);\n\tselect '    On-hold contexts', count(*) from context where (effectiveActive=1) and allowsNextAction=0;\n\tselect '    Dropped contexts', count(*) from context where effectiveActive=0;\n\tselect null;\n\t\"\n\tset groups_cmd to \"\n\tselect 'ACTION GROUPS', count(*) from task where (projectinfo is null) and (childrenCount>0);\n\tselect '    Remaining action groups', count(*) from task where (projectinfo is null) and (dateCompleted is null) and (childrenCount>0);\n\tselect '    Completed action groups', count(dateCompleted) from task where (projectinfo is null) and (childrenCount>0);\n\tselect null;\n\t\"\n\tset tasks_cmd to \"\n\tselect 'ALL TASKS', count(*) from task;\n\tselect null;\n\t\"\n\tset actions_cmd to \"\n\tselect 'ACTIONS', count(*) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Completed actions', count(dateCompleted) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Dropped project actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp where (projectinfo is null) and (childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is not null and (tp.status='dropped' or tp.folderEffectiveActive=0));\n\tselect '    Dropped context actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand c.effectiveActive= 0;\n\tselect '    Remaining actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1);\n\tselect '        Actions in Projects on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is not null and tp.status='inactive');\n\tselect '        Actions in Contexts on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is not null and c.allowsNextAction=0);\n\tselect '        Blocked actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1;\n\tselect '        \tBlocked by future start date', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=1;\n\tselect '        \tSequentially blocked', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=0;\n\tselect '        Available actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=0;\n\tselect null;\n\t\"\n\tset summary_cmd to \"\n\tselect 'SUMMARY';\n\tselect '    Inbox available actions', count(*) from task where (inInbox=1) and (dateCompleted is null);\n\tselect '    Due in next week', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01');\n\tselect '    Flagged projects and actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand tp.effectiveFlagged;\n\tselect '    Due or Flagged', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand (tp.effectiveFlagged or (effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01')));\n\tselect null;\n\t\"\n\tif brief then\n\t\tset commands to projects_cmd & lists_cmd & contexts_cmd & groups_cmd & actions_cmd & summary_cmd\n\telse\n\t\tset commands to inbox_cmd & folders_cmd & projects_cmd & lists_cmd & contexts_cmd & groups_cmd & actions_cmd & tasks_cmd & summary_cmd\n\tend if\n\tset strCmd to \"sqlite3 -separator ': ' \\\"\" & pstrDBPath & \"\\\" \" & quoted form of (commands)\n\t\n\t-- \t\ttry\n\tset strList to do shell script strCmd\n\t-- \t\ton error\n\t-- \t\t\tdisplay dialog \"The SQL schema for the OmniFocus cache may have changed in a recent update of OF.\" & return & return & \n\t-- \t\t\t\t\"Look on the OmniFocus user forums for an updated version of this script.\" buttons {\"OK\"} with title pTitle & \"Ver. \" & pVersion\n\t-- \t\t\treturn\n\t-- \t\tend try\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tif button returned of (display dialog strList buttons {pToClipboard, \"OK\"} default button \"OK\" giving up after pTimeOut with title pTitle & \" Ver. \" & pVersion) \n\t\t\tis pToClipboard then tell application id \"com.apple.finder\" to set the clipboard to strList\n\tend tell\nelse\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tdisplay dialog \"OmniFocus cache not found ...\" buttons {\"OK\"} default button 1 with title pTitle & \" Ver. \" & pVersion\n\tend tell\nend if\n\n\non FileExists(strPath)\n\t(do shell script \"test -e \" & strPath & \" ; echo $?\") = \"0\"\nend FileExists\n\non GetCachePath()\n\ttry\n\t\ttell application \"Finder\" to tell (application file id \"OFOC\") to \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/\" & its id & \"\/OmniFocusDatabase2\"\n\ton error\n\t\terror \"OmniFocus not installed ...\"\n\tend try\nend GetCachePath\n\n","subject":"adjust resolution where brief needed","message":"adjust resolution where brief needed\n","lang":"AppleScript","license":"apache-2.0","repos":"brettporter\/omnifocus-tools"}
{"commit":"9bbbbb5f469a7c65947908499bfa94cca4f9e03d","old_file":"keynote.applescript","new_file":"keynote.applescript","old_contents":"on newPresentation(themeName)\n\ttell application \"Keynote\"\n\t\tactivate\n\t\t-- FIXME: Make this selectable?\n\t\tset targetWidth to 1024 -- 1440 <-- higher resolution\n\t\tset targetHeight to 768 -- 1080 <-- higher resolution\n\n\t\tset props to {document theme:theme (themeName as string), width:targetWidth, height:targetHeight}\n\n\t\tset thisDocument to make new document with properties props\n\t\treturn id of thisDocument\n\tend tell\nend newPresentation\n\non openPresentation(posixPath)\n\ttell application \"Keynote\"\n\t\topen posixPath\n\tend tell\nend openPresentation\n\non savePresentation(docId, posixPath)\n\ttell application \"Keynote\"\t\n\t\tactivate\t\n        set theDocument to document id docId\n\t\tsave theDocument in POSIX file posixPath\n        delete theDocument\n        open posixPath \n\tend tell\nend savePresentation\t\n\non closePresentation(docId)\n\ttell application \"Keynote\"\t\n\t\tactivate\t\n        set theDocument to document id docId\n\t\tclose theDocument\n\tend tell\nend savePresentation\t\n\n\non createSlide(docId, masterSlideName)\n\ttell application \"Keynote\"\n\t\ttell document id docId\n\t\t\tset thisSlide to make new slide with properties {base slide:master slide masterSlideName}\n\t\tend tell\n\tend tell\nend createSlide\n\non deleteAllSlides(docId)\n\ttell application \"Keynote\"\n\t\ttell document id docId to delete every slide\n\tend tell\nend deleteAllSlides\n\non finalize(docId)\n\ttell application \"Keynote\"\n\t\ttell document id docId to delete slide 1\n\tend tell\nend finalize\n\non themeMasters(docId)\n\t--\t  tell application \"Keynote\" to get the name of every master slide of thisDocument\n\ttell application \"Keynote\"\n\t\tset names to the name of every master slide of document id docId\n\t\treturn names\n\tend tell\nend themeMasters\n\non addImage(docId, slideIndex, n, filepath)\n  tell application \"Keynote\"\n\ttell slide slideIndex of document id docId\n\t\t-- TO REPLACE A PLACEHOLDER OR EXISTING IMAGE:\n\t\tset thisPlaceholderImageItem to image n\n\t\t-- change the value of the \u201cfile name\u201d property of the image to be an HFS file reference to the replacement image file\n\t    set macPath to POSIX file filepath as Unicode text\n\t\tset file name of thisPlaceholderImageItem to \u00ac\n\t\t\talias macPath\n\tend tell\n  end tell\nend addImage\n\n\non addTitle(docId, slideIndex, thisSlideTitle)\n\ttell application \"Keynote\"\n    \ttell slide slideIndex of document id docId\n\t\t\tset the object text of the default title item to thisSlideTitle\n\t\tend tell\n\tend tell\nend addTitle\n\non addBody(docId, slideIndex, thisSlideBody)\n\ttell application \"Keynote\"\n    \ttell slide slideIndex of document id docId\n            set the object text of the default body item to thisSlideBody\n\t\tend tell\n\tend tell\nend addTitle\n\non addPresenterNotes(docId, slideIndex, theNotes)\n\ttell application \"Keynote\"\n    \ttell slide slideIndex of document id docId\n\t\t\tset presenter notes to theNotes\n\t\tend tell\n\tend tell\nend addPresenterNotes\n\non addText(docId, slideIndex, itemIndex, theText)\n  tell application \"Keynote\"\n  \ttell slide slideIndex of document id docId\n\t\tset thisPlaceholderItem to text item itemIndex\n\t\tset object text of thisPlaceholderItem to theText\n\tend tell\n  end tell\nend addText\n\n","new_contents":"on newPresentation(themeName)\n\ttell application \"Keynote\"\n\t\tactivate\n\t\t-- FIXME: Make this selectable?\n\t\tset targetWidth to 1024 -- 1440 <-- higher resolution\n\t\tset targetHeight to 768 -- 1080 <-- higher resolution\n\n\t\tset props to {document theme:theme (themeName as string), width:targetWidth, height:targetHeight}\n\n\t\tset thisDocument to make new document with properties props\n\t\treturn id of thisDocument\n\tend tell\nend newPresentation\n\non openPresentation(posixPath)\n\ttell application \"Keynote\"\n\t\topen posixPath\n\tend tell\nend openPresentation\n\non savePresentation(docId, posixPath)\n\ttell application \"Keynote\"\t\n\t\tactivate\t\n        set theDocument to document id docId\n\t\tsave theDocument in POSIX file posixPath\n        delete theDocument\n        open posixPath \n\tend tell\nend savePresentation\t\n\non closePresentation(docId)\n\ttell application \"Keynote\"\t\n\t\tactivate\t\n        set theDocument to document id docId\n\t\tclose theDocument\n\tend tell\nend savePresentation\t\n\n\non createSlide(docId, masterSlideName)\n\ttell application \"Keynote\"\n\t\ttell document id docId\n\t\t\tset thisSlide to make new slide with properties {base slide:master slide masterSlideName}\n\t\tend tell\n\t\treturn slide number of thisSlide\n\tend tell\nend createSlide\n\non deleteAllSlides(docId)\n\ttell application \"Keynote\"\n\t\ttell document id docId to delete every slide\n\tend tell\nend deleteAllSlides\n\non finalize(docId)\n\ttell application \"Keynote\"\n\t\ttell document id docId to delete slide 1\n\tend tell\nend finalize\n\non themeMasters(docId)\n\t--\t  tell application \"Keynote\" to get the name of every master slide of thisDocument\n\ttell application \"Keynote\"\n\t\tset names to the name of every master slide of document id docId\n\t\treturn names\n\tend tell\nend themeMasters\n\non addImage(docId, slideIndex, n, filepath)\n  tell application \"Keynote\"\n\ttell slide slideIndex of document id docId\n\t\t-- TO REPLACE A PLACEHOLDER OR EXISTING IMAGE:\n\t\tset thisPlaceholderImageItem to image n\n\t\t-- change the value of the \u201cfile name\u201d property of the image to be an HFS file reference to the replacement image file\n\t    set macPath to POSIX file filepath as Unicode text\n\t\tset file name of thisPlaceholderImageItem to \u00ac\n\t\t\talias macPath\n\tend tell\n  end tell\nend addImage\n\n\non addTitle(docId, slideIndex, thisSlideTitle)\n\ttell application \"Keynote\"\n    \ttell slide slideIndex of document id docId\n\t\t\tset the object text of the default title item to thisSlideTitle\n\t\tend tell\n\tend tell\nend addTitle\n\non addBody(docId, slideIndex, thisSlideBody)\n\ttell application \"Keynote\"\n    \ttell slide slideIndex of document id docId\n            set the object text of the default body item to thisSlideBody\n\t\tend tell\n\tend tell\nend addTitle\n\non addPresenterNotes(docId, slideIndex, theNotes)\n\ttell application \"Keynote\"\n    \ttell slide slideIndex of document id docId\n\t\t\tset presenter notes to theNotes\n\t\tend tell\n\tend tell\nend addPresenterNotes\n\non addText(docId, slideIndex, itemIndex, theText)\n  tell application \"Keynote\"\n  \ttell slide slideIndex of document id docId\n\t\tset thisPlaceholderItem to text item itemIndex\n\t\tset object text of thisPlaceholderItem to theText\n\tend tell\n  end tell\nend addText\n\n","subject":"Return index when creating slide","message":"Return index when creating slide\n","lang":"AppleScript","license":"mit","repos":"persquare\/md2keynote"}
{"commit":"2581b69b5b177d8aa8c44357b4a7e58aa5bb8f80","old_file":"autoload\/tube\/applescript\/iterm.applescript","new_file":"autoload\/tube\/applescript\/iterm.applescript","old_contents":"on run argv\n    set command to (item 1 of argv)\n\n    tell application iTerm2\n      set _window to (current window)\n\n      if _window is equal to missing value then\n        create window with default profile\n      end if\n\n      tell current window\n        tell current session\n          write text command\n        end tell\n      end tell\n    end tell\nend run\n","new_contents":"on run argv\n    set command to (item 1 of argv)\n\n    tell application \"iTerm2\"\n      set _window to (current window)\n\n      if _window is equal to missing value then\n        create window with default profile\n      end if\n\n      tell current window\n        tell current session\n          write text command\n        end tell\n      end tell\n    end tell\nend run\n","subject":"Update script again","message":"Update script again\n","lang":"AppleScript","license":"mit","repos":"alisnic\/tube.vim"}
{"commit":"510d03a61c46bb54ea1025438d081157bf00faf1","old_file":"applescript\/halt_vagrant.applescript","new_file":"applescript\/halt_vagrant.applescript","old_contents":"set close_vagrant to \"z puppet; vagrant halt -f;\"\n\n-- close vagrant\ntell application \"iTerm\"\n\tactivate\n\tset myterm to (make new terminal)\n\ttell myterm\n\t\tlaunch session \"Default\"\n\t\tset mysession to current session\n\tend tell\n\n\ttell mysession\n\t\twrite text close_vagrant\n\tend tell\n\n\tdelay 5\nend tell\n\n-- quit iTerm\nignoring application responses\n\ttell application \"iTerm\"\n\t\tquit\n\tend tell\nend ignoring\n\ndelay 2\ntell application \"System Events\" to keystroke return\n","new_contents":"set close_vagrant to \"z puppet; vagrant halt -f;\"\n\n-- close vagrant\ntell application \"iTerm\"\n\tactivate\n\tset myterm to (make new terminal)\n\ttell myterm\n\t\tlaunch session \"Default\"\n\t\tset mysession to current session\n\tend tell\n\n\ttell mysession\n\t\twrite text close_vagrant\n\tend tell\nend tell\n","subject":"Remove closing iTerm2","message":"Remove closing iTerm2\n","lang":"AppleScript","license":"apache-2.0","repos":"uberVU\/toolbox"}
{"commit":"dcabab4b698dc4009406443113aa06ef22422811","old_file":"scripts\/pdfmatch_folder_action.applescript","new_file":"scripts\/pdfmatch_folder_action.applescript","old_contents":"# AppleScript folder action for the pdfmatch command\n#\n# Open with script editor, compile and save to\n# ~\/Library\/Workflows\/Applications\/Folder\\ Actions\/\n#\n# Then open the \"Folder Actions Setup\" application and add the work folder\n# where your pdfmatch.json config lives and attach this script.\n#\non adding folder items to this_folder after receiving these_files\n\ttry\n\t\trepeat with each_file in these_files\n\t\t\ttell application \"System Events\"\n\t\t\t\tif name extension of each_file is \"pdf\" or \"tif\" or \"tiff\" or \"jpeg\" or \"jpg\" then\n\t\t\t\t\t# You might need to add your node binary to your $PATH. For example:\n\t\t\t\t\t# export PATH=\/usr\/local\/bin:\/usr\/local\/opt\/node@6\/bin:$PATH \n\t\t\t\t\tset output to (do shell script \"cd '\" & POSIX path of this_folder & \"' && pdfmatch '\" & POSIX path of each_file & \"' --delete 2>&1\")\n\t\t\t\t\t#display alert output\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend repeat\n\ton error err_string number error_number\n\t\tdisplay alert \"Error \" & error_number & \": \" & err_string\n\tend try\nend adding folder items to\n","new_contents":"# AppleScript folder action for the pdfmatch command\n#\n# Open with script editor, compile and save to\n# ~\/Library\/Workflows\/Applications\/Folder\\ Actions\/\n#\n# Then open the \"Folder Actions Setup\" application and add the work folder\n# where your pdfmatch.json config lives and attach this script.\n#\non adding folder items to this_folder after receiving these_files\n\ttry\n    set ext to {\"pdf\", \"tif\", \"tiff\", \"jpeg\", \"jpg\"}\n\t\trepeat with each_file in these_files\n\t\t\ttell application \"System Events\"\n\t\t\t\tif ext contains name extension of each_file then\n\t\t\t\t\t# You might need to add your node binary to your $PATH. For example:\n\t\t\t\t\t# export PATH=\/usr\/local\/bin:\/usr\/local\/opt\/node@6\/bin:$PATH \n\t\t\t\t\tset output to (do shell script \"cd '\" & POSIX path of this_folder & \"' && pdfmatch '\" & POSIX path of each_file & \"' --delete 2>&1\")\n\t\t\t\t\t#display alert output\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend repeat\n\ton error err_string number error_number\n\t\tdisplay alert \"Error \" & error_number & \": \" & err_string\n\tend try\nend adding folder items to\n","subject":"Fix AppleScript extension matching","message":"Fix AppleScript extension matching\n","lang":"AppleScript","license":"mit","repos":"mantoni\/pdfmatch.js"}
{"commit":"0d4f11430d41c734eca1db4342623c0b40aec89a","old_file":"scripts\/thinkCERCA-iterm.scpt","new_file":"scripts\/thinkCERCA-iterm.scpt","old_contents":"tell application \"iTerm2\"\n  activate\n\n  set cercaWindow to (current window)\n\n  tell cercaWindow\n\n    tell current session\n      split vertically with default profile\n      write text \"tcd\"\n    end tell\n\n    tell last session of current tab\n      write text \"tcs\"\n    end tell\n\n    set secondTab to (create tab with default profile)\n    secondTab\n    tell secondTab\n      tell current session\n        split vertically with default profile\n        write text \"tcf\"\n      end tell\n\n      tell last session\n        write text \"tc\"\n      end tell\n    end tell\n\n    set thirdTab to (create tab with default profile)\n    thirdTab\n    tell thirdTab\n      tell first session\n        write text \"tcv\"\n      end tell\n    end tell\n  end tell\nend tell\n","new_contents":"tell application \"iTerm2\"\n  activate\n\n  set cercaWindow to (current window)\n\n  tell cercaWindow\n\n    tell current session\n      split vertically with default profile\n      write text \"tcd\"\n    end tell\n\n    tell last session of current tab\n      write text \"tcs\"\n    end tell\n\n    set secondTab to (create tab with default profile)\n    secondTab\n    tell secondTab\n      tell current session\n        split vertically with default profile\n        write text \"tcf\"\n      end tell\n\n      tell last session\n        write text \"tc; ty; stt aux\"\n      end tell\n    end tell\n\n    set thirdTab to (create tab with default profile)\n    thirdTab\n    tell thirdTab\n      tell first session\n        write text \"tcv\"\n      end tell\n    end tell\n\n    set fourthTab to (create tab with default profile)\n    fourthTab\n    tell fourthTab\n      tell first session\n        write text \"tc\"\n      end tell\n    end tell\n  end tell\nend tell\n","subject":"update cerca script","message":"update cerca script\n","lang":"AppleScript","license":"mit","repos":"MelizzaP\/dotfiles,MelizzaP\/dotfiles,MelizzaP\/dotfiles"}
{"commit":"a79e8801a5c5d569d6946d8620ada322a6c73d8b","old_file":"hammerspoon\/connect_sony.applescript","new_file":"hammerspoon\/connect_sony.applescript","old_contents":"activate application \"SystemUIServer\"\ntell application \"System Events\"\n    tell process \"SystemUIServer\"\n        set btMenu to (menu bar item 1 of menu bar 1 whose description contains \"bluetooth\")\n        tell btMenu\n            click\n            try\n                tell (menu item \"Rosco's Headphones\" of menu 1)\n                    click\n                    if exists menu item \"Connect\" of menu 1 then\n                        click menu item \"Connect\" of menu 1\n                        return \"Connecting...\"\n                    else if exists menu item \"Disconnect\" of menu 1 then\n                        click menu item \"Disconnect\" of menu 1\n                        return \"Disconnecting...\"\n                    end if\n                end tell\n            end try\n        end tell\n    end tell\n    key code 53\n    return \"Device not found or Bluetooth turned off\"\nend tell\n\n\n","new_contents":"-- Source: https:\/\/www.reddit.com\/r\/MacOS\/comments\/i4czgu\/big_sur_airpods_script\/gck3gz3\n-- Works on macOS 11 Big Sur\n\nuse framework \"IOBluetooth\"\nuse scripting additions\n\nset DeviceName to \"Rosco's Headphones\"\n\non getFirstMatchingDevice(deviceName)\n    repeat with device in (current application's IOBluetoothDevice's pairedDevices() as list)\n        if (device's nameOrAddress as string) contains deviceName then return device\n    end repeat\nend getFirstMatchingDevice\n\non toggleDevice(device)\n    if not (device's isConnected as boolean) then\n        device's openConnection()\n        return \"Connecting \" & (device's nameOrAddress as string)\n    else\n        device's closeConnection()\n        return \"Disconnecting \" & (device's nameOrAddress as string)\n    end if\nend toggleDevice\n\nreturn toggleDevice(getFirstMatchingDevice(DeviceName))\n","subject":"Update headphone connect script for Big Sur","message":"Update headphone connect script for Big Sur\n","lang":"AppleScript","license":"mit","repos":"rkalis\/dotfiles,rkalis\/dotfiles"}
{"commit":"3755272e03311275a8845f1848cbb8a96b62c915","old_file":"uninstall.applescript","new_file":"uninstall.applescript","old_contents":"property stdout : \"\"\non run\n\tset newline to ASCII character 10\n\t\n\tset stdout to stdout & \"  shutdown TotalTerminalCrashWatcher ...\" & newline\n\ttry\n\t\tdo shell script \"killall -SIGINT TotalTerminalCrashWatcher\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    TotalTerminalCrashWatcher.com not running\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  shutdown Terminal ...\" & newline\n\ttry\n\t\ttell application \"Terminal\" to quit\n\ton error\n\t\tset stdout to stdout & \"    Terminal was not running prior uninstallation\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalTerminal.app ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Applications\/TotalTerminal.app\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Applications\/TotalTerminal.app\" & newline\n\tend try\n\t\n\t\n\tset stdout to stdout & \"  remove TotalTerminal.osax ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Library\/ScriptingAdditions\/TotalTerminal.osax\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Library\/ScriptingAdditions\/TotalTerminal.osax\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  relaunch Terminal ...\" & newline\n\ttry\n\t\ttell application \"Terminal\" to launch\n\ton error\n\t\tset stdout to stdout & \"    failed to relaunch Terminal\" & newline\n\tend try\n\t\n\t-- at this point Terminal should start cleanly and with no signs of TotalTerminal\n\t-- you may check Events\/Replies tab to see if there were no issues with uninstallation\n\t\n\tstdout -- this is needed for platypus to display output in details window\nend run","new_contents":"property stdout : \"\"\non run\n\tset newline to ASCII character 10\n\t\n\tset stdout to stdout & \"  shutdown TotalTerminalCrashWatcher ...\" & newline\n\ttry\n\t\tdo shell script \"killall -SIGINT TotalTerminalCrashWatcher\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    TotalTerminalCrashWatcher was not running\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  shutdown Terminal ...\" & newline\n\ttry\n\t\ttell application \"Terminal\" to quit\n\ton error\n\t\tset stdout to stdout & \"    Terminal was not running prior uninstallation\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalTerminal.app ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Applications\/TotalTerminal.app\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Applications\/TotalTerminal.app\" & newline\n\tend try\n\t\n\t\n\tset stdout to stdout & \"  remove TotalTerminal.osax ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Library\/ScriptingAdditions\/TotalTerminal.osax\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Library\/ScriptingAdditions\/TotalTerminal.osax\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  relaunch Terminal ...\" & newline\n\ttry\n\t\ttell application \"Terminal\" to launch\n\ton error\n\t\tset stdout to stdout & \"    failed to relaunch Terminal\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"TotalTerminal uninstallation finished\" & newline\n\t\n\t-- at this point Terminal should start cleanly and with no signs of TotalTerminal\n\t-- you may check Events\/Replies tab to see if there were no issues with uninstallation\n\t\n\tstdout -- this is needed for platypus to display output in details window\nend run","subject":"improve uninstaller script","message":"improve uninstaller script\n","lang":"AppleScript","license":"bsd-3-clause","repos":"binaryage\/totalterminal-installer"}
{"commit":"4aafec64d1586ce1ef7f7fae4b66b0025e3eeabf","old_file":"support\/iphone\/itunes_sync.scpt","new_file":"support\/iphone\/itunes_sync.scpt","old_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0003l\u0000\u0002\u0000\u0000\u0000L\u0000\u0004\r\u0000\u0004\u0000\u0002O\u0000\u0000\u0000\u0000\u0000L\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0005Y\u0000\u0000\u0000\u0004\u0000K\u0000\u0007\u0000\b\u0000\t\r\u0000\u0007\u0000\u0004Z\u0000\u0000\u0000\u0014\u0000F\u0000\n\u0000\u000b\r\u0000\n\u0000\u0002=\u0000\u0003\u0000\u0014\u0000\u001c\u0000\f\u0000\r\r\u0000\f\u0000\u0003l\u0001\u0000\u0000\u0014\u0000\u001a\u0000\u000e\r\u0000\u000e\u0000\u0002n\u0000\u0000\u0000\u0014\u0000\u001a\u0000\u000f\u0000\u0010\r\u0000\u000f\u0000\u00011\u0000\u0000\u0000\u0018\u0000\u001a\n\u0000\u0004\npKnd\r\u0000\u0010\u0000\u00024\u0000\u0000\u0000\u0014\u0000\u0018\u0000\u0011\n\u0000\u0004\ncSrc\r\u0000\u0011\u0000\u0001o\u0000\u0000\u0000\u0016\u0000\u0017\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000\r\u0000\u0001m\u0000\u0000\u0000\u001a\u0000\u001b\n\u0000\b\u000beSrckPod\r\u0000\u000b\u0000\u0003Q\u0000\u0000\u0000\u001f\u0000B\u0000\u0012\u0000\u0013\u0000\u0014\r\u0000\u0012\u0000\u0003I\u0000\u0002\u0000\"\u0000'\u0000\u0015\n\u0000\u0018.hookUpdtnull\u0000\u0000\u0000\u0000\u0000cSrc\r\u0000\u0015\u0000\u0001o\u0000\u0000\u0000\"\u0000#\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\u0002\u0000\u0000\r\u0000\u0013\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0016\u0000\u0017\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000\u0016\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00140\u0000\berrorstr\u0000\berrorStr\u0006\u0000\u0017\u0000\u0003\u0000\u0018\n\u0000\u0004\nerrn\r\u0000\u0018\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000berrornumber\u0000\u000berrorNumber\u0006\u0000\u0000\r\u0000\u0014\u0000\u0003I\u0000\u0002\u0000\/\u0000B\u0000\u0019\n\u0000\u0018.ascrcmnt****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000\u0019\u0000\u0002b\u0000\u0000\u0000\/\u0000>\u0000\u001a\u0000\u001b\r\u0000\u001a\u0000\u0002b\u0000\u0000\u0000\/\u0000<\u0000\u001c\u0000\u001d\r\u0000\u001c\u0000\u0002b\u0000\u0000\u0000\/\u0000:\u0000\u001e\u0000\u001f\r\u0000\u001e\u0000\u0002b\u0000\u0000\u0000\/\u00008\u0000 \u0000!\r\u0000 \u0000\u0002b\u0000\u0000\u0000\/\u00006\u0000\"\u0000#\r\u0000\"\u0000\u0002b\u0000\u0000\u0000\/\u00004\u0000$\u0000%\r\u0000$\u0000\u0001m\u0000\u0000\u0000\/\u00000\u0000&\u000e\u0000&\u0000\u0001\u0000'\u0011\u0000'\u0000\u0016\u0000T\u0000h\u0000e\u0000 \u0000d\u0000e\u0000v\u0000i\u0000c\u0000e\u0000 \r\u0000%\u0000\u0002n\u0000\u0000\u00000\u00003\u0000(\u0000)\r\u0000(\u0000\u00011\u0000\u0000\u00001\u00003\n\u0000\u0004\npnam\r\u0000)\u0000\u0001o\u0000\u0000\u00000\u00001\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\r\u0000#\u0000\u0001m\u0000\u0000\u00004\u00005\u0000*\u000e\u0000*\u0000\u0001\u0000+\u0011\u0000+\u0000*\u0000 \u0000w\u0000a\u0000s\u0000 \u0000u\u0000n\u0000a\u0000b\u0000l\u0000e\u0000 \u0000t\u0000o\u0000 \u0000s\u0000y\u0000n\u0000c\u0000 \u0000(\r\u0000!\u0000\u0001o\u0000\u0000\u00006\u00007\u000b\u0000\u00140\u0000\berrorstr\u0000\berrorStr\r\u0000\u001f\u0000\u0001m\u0000\u0000\u00008\u00009\u0000,\u000e\u0000,\u0000\u0001\u0000-\u0011\u0000-\u0000\u0002\u0000:\r\u0000\u001d\u0000\u0001o\u0000\u0000\u0000:\u0000;\u000b\u0000\u001a0\u0000\u000berrornumber\u0000\u000berrorNumber\r\u0000\u001b\u0000\u0001m\u0000\u0000\u0000<\u0000=\u0000.\u000e\u0000.\u0000\u0001\u0000\/\u0011\u0000\/\u0000\u0002\u0000)\u0002\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\r\u0000\b\u0000\u0001m\u0000\u0000\u0000\u0007\u0000\b\u0003\u0000\u0001\r\u0000\t\u0000\u0003l\u0001\u0000\u0000\b\u0000\u000f\u00000\r\u00000\u0000\u0003I\u0000\u0001\u0000\b\u0000\u000f\u00001\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\r\u00001\u0000\u00012\u0000\u0001\u0000\b\u0000\u000b\n\u0000\u0004\ncSrc\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000\u0006\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u00002\u000f\u00002\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000hook\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001L\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0006SH+\u0000\u0000\u0000\u0000\u0000q\niTunes.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00007\u0003l\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fApplications\u0000\u0010\u0000\b\u0000\u0000\u0006\u001b\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000m$w\u0000\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000q\u0000\u0002\u0000$Macintosh HD:Applications:iTunes.app\u0000\u000e\u0000\u0016\u0000\n\u0000i\u0000T\u0000u\u0000n\u0000e\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000\u0017Applications\/iTunes.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0003\u00003\u00004\u0001\u0000\u0000\u0010\u00003\u0000\u0001\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000e\u00004\u0000\u0007\u0010\u00005\u00006\u00007\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u00005\u0000\u0001k\u0000\u0000\u0000\u0000\u0000L\u00008\u0002\u00008\u0000\u0002\u0000\u0001\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u00006\u0000\u0003\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\u000b\u0000\u00140\u0000\berrorstr\u0000\berrorStr\u000b\u0000\u001a0\u0000\u000berrornumber\u0000\u000berrorNumber\u0010\u00007\u0000\u000e\u00002\u00009\u0000&\u0000*\u0000,\u0000.\n\u0000\u0004\ncSrc\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\n\u0000\u0004\npKnd\n\u0000\b\u000beSrckPod\n\u0000\u0018.hookUpdtnull\u0000\u0000\u0000\u0000\u0000cSrc\u000b\u0000\u00140\u0000\berrorstr\u0000\berrorStr\u0006\u00009\u0000\u0003\n\u0000\u0004\nerrn\u000b\u0000\u001a0\u0000\u000berrornumber\u0000\u000berrorNumber\u0006\u0000\u0000\n\u0000\u0004\npnam\n\u0000\u0018.ascrcmnt****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0011\u0000M\u0012\u0000I\u0017\u0000Fk*-j\f\u0000\u0002kh\u001c\u0000\u0000*\/,\u0000\u001d\u0000(\u0014\u0000\nj\f\u0000\u0005W\u0000\u001aX\u0000\u0006\u0000\u0007,%%%%%%j\f\u0000\rY\u0000\u0003h[OYU\u000fascr\u0000\u0001\u0000\f\u07ad","new_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0003l\u0000\u0002\u0000\u0000\u0000K\u0000\u0007\r\u0000\u0007\u0000\u0002O\u0000\u0000\u0000\u0000\u0000K\u0000\b\u0000\t\r\u0000\b\u0000\u0003X\u0000\u0000\u0000\u0004\u0000J\u0000\n\u0000\u000b\r\u0000\n\u0000\u0004Z\u0000\u0000\u0000\u0016\u0000E\u0000\f\u0000\r\r\u0000\f\u0000\u0003l\u0000\u0005\u0000\u0016\u0000\u001b\u0000\u000e\r\u0000\u000e\u0000\u0002=\u0000\u0003\u0000\u0016\u0000\u001b\u0000\u000f\u0000\u0010\r\u0000\u000f\u0000\u0002n\u0000\u0000\u0000\u0016\u0000\u0019\u0000\u0011\u0000\u0012\r\u0000\u0011\u0000\u00011\u0000\u0000\u0000\u0017\u0000\u0019\n\u0000\u0004\npKnd\r\u0000\u0012\u0000\u0001o\u0000\u0000\u0000\u0016\u0000\u0017\u000b\u0000\u001c0\u0000\fitunessource\u0000\fiTunesSource\r\u0000\u0010\u0000\u0001m\u0000\u0000\u0000\u0019\u0000\u001a\n\u0000\b\u000beSrckPod\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000\r\u0000\u0003Q\u0000\u0000\u0000\u001e\u0000A\u0000\u0013\u0000\u0014\u0000\u0015\r\u0000\u0013\u0000\u0003I\u0000\u0002\u0000!\u0000&\u0000\u0016\n\u0000\u0018.hookUpdtnull\u0000\u0000\u0000\u0000\u0000cSrc\r\u0000\u0016\u0000\u0001o\u0000\u0000\u0000!\u0000\"\u000b\u0000\u001c0\u0000\fitunessource\u0000\fiTunesSource\u0002\u0000\u0000\r\u0000\u0014\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0017\u0000\u0018\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000\u0017\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00140\u0000\berrorstr\u0000\berrorStr\u0006\u0000\u0018\u0000\u0003\u0000\u0019\n\u0000\u0004\nerrn\r\u0000\u0019\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000berrornumber\u0000\u000berrorNumber\u0006\u0000\u0000\r\u0000\u0015\u0000\u0003I\u0000\u0002\u0000.\u0000A\u0000\u001a\n\u0000\u0018.ascrcmnt****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000\u001a\u0000\u0002b\u0000\u0000\u0000.\u0000=\u0000\u001b\u0000\u001c\r\u0000\u001b\u0000\u0002b\u0000\u0000\u0000.\u0000;\u0000\u001d\u0000\u001e\r\u0000\u001d\u0000\u0002b\u0000\u0000\u0000.\u00009\u0000\u001f\u0000 \r\u0000\u001f\u0000\u0002b\u0000\u0000\u0000.\u00007\u0000!\u0000\"\r\u0000!\u0000\u0002b\u0000\u0000\u0000.\u00005\u0000#\u0000$\r\u0000#\u0000\u0002b\u0000\u0000\u0000.\u00003\u0000%\u0000&\r\u0000%\u0000\u0001m\u0000\u0000\u0000.\u0000\/\u0000'\u000e\u0000'\u0000\u0001\u0000(\u0011\u0000(\u0000\u0016\u0000T\u0000h\u0000e\u0000 \u0000d\u0000e\u0000v\u0000i\u0000c\u0000e\u0000 \r\u0000&\u0000\u0002n\u0000\u0000\u0000\/\u00002\u0000)\u0000*\r\u0000)\u0000\u00011\u0000\u0000\u00000\u00002\n\u0000\u0004\npnam\r\u0000*\u0000\u0001o\u0000\u0000\u0000\/\u00000\u000b\u0000\u001c0\u0000\fitunessource\u0000\fiTunesSource\r\u0000$\u0000\u0001m\u0000\u0000\u00003\u00004\u0000+\u000e\u0000+\u0000\u0001\u0000,\u0011\u0000,\u0000*\u0000 \u0000w\u0000a\u0000s\u0000 \u0000u\u0000n\u0000a\u0000b\u0000l\u0000e\u0000 \u0000t\u0000o\u0000 \u0000s\u0000y\u0000n\u0000c\u0000 \u0000(\r\u0000\"\u0000\u0001o\u0000\u0000\u00005\u00006\u000b\u0000\u00140\u0000\berrorstr\u0000\berrorStr\r\u0000 \u0000\u0001m\u0000\u0000\u00007\u00008\u0000-\u000e\u0000-\u0000\u0001\u0000.\u0011\u0000.\u0000\u0002\u0000:\r\u0000\u001e\u0000\u0001o\u0000\u0000\u00009\u0000:\u000b\u0000\u001a0\u0000\u000berrornumber\u0000\u000berrorNumber\r\u0000\u001c\u0000\u0001m\u0000\u0000\u0000;\u0000<\u0000\/\u000e\u0000\/\u0000\u0001\u00000\u0011\u00000\u0000\u0002\u0000)\u0002\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u000b\u0000\u001c0\u0000\fitunessource\u0000\fiTunesSource\r\u0000\u000b\u0000\u00012\u0000\u0001\u0000\u0007\u0000\n\n\u0000\u0004\ncSrc\r\u0000\t\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u00001\u000f\u00001\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000hook\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001N\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000QH+\u0000\u0000\u0000\u0000\u0000\\\niTunes.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fApplications\u0000\u0010\u0000\b\u0000\u00001\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u000br\u0000\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000\\\u0000\u0002\u0000%Macintosh HD:Applications:\u0000iTunes.app\u0000\u0000\u000e\u0000\u0016\u0000\n\u0000i\u0000T\u0000u\u0000n\u0000e\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000\u0017Applications\/iTunes.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u00002\r\u00002\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0003\u00003\u00004\u0001\u0000\u0000\u0010\u00003\u0000\u0001\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000e\u00004\u0000\u0007\u0010\u00005\u00006\u00007\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u00005\u0000\u0001k\u0000\u0000\u0000\u0000\u0000K\u00008\u0002\u00008\u0000\u0002\u0000\u0005\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u00006\u0000\u0003\u000b\u0000\u001c0\u0000\fitunessource\u0000\fiTunesSource\u000b\u0000\u00140\u0000\berrorstr\u0000\berrorStr\u000b\u0000\u001a0\u0000\u000berrornumber\u0000\u000berrorNumber\u0010\u00007\u0000\u0010\u00001\u00009\u0000'\u0000+\u0000-\u0000\/\n\u0000\u0004\ncSrc\n\u0000\u0004\nkocl\n\u0000\u0004\ncobj\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\n\u0000\u0004\npKnd\n\u0000\b\u000beSrckPod\n\u0000\u0018.hookUpdtnull\u0000\u0000\u0000\u0000\u0000cSrc\u000b\u0000\u00140\u0000\berrorstr\u0000\berrorStr\u0006\u00009\u0000\u0003\n\u0000\u0004\nerrn\u000b\u0000\u001a0\u0000\u000berrornumber\u0000\u000berrorNumber\u0006\u0000\u0000\n\u0000\u0004\npnam\n\u0000\u0018.ascrcmnt****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0011\u0000L\u0012\u0000H\u0017\u0000E*-[l\f\u0000\u0004kh\u001b\u0000\u0000,\u0000\u001d\u0000(\u0014\u0000\nj\f\u0000\u0007W\u0000\u001aX\u0000\b\u0000\t,%%%%%%j\f\u0000\u000fY\u0000\u0003h[OYU\u000f\u0000ascr\u0000\u0001\u0000\r\u07ad","subject":"Refactor script to use proper AppleScript types and iTunes idioms.","message":"TIMOB-12740: Refactor script to use proper AppleScript types and iTunes idioms.\n","lang":"AppleScript","license":"apache-2.0","repos":"smit1625\/titanium_mobile,KangaCoders\/titanium_mobile,kopiro\/titanium_mobile,pinnamur\/titanium_mobile,bhatfield\/titanium_mobile,jvkops\/titanium_mobile,jhaynie\/titanium_mobile,KoketsoMabuela92\/titanium_mobile,prop\/titanium_mobile,benbahrenburg\/titanium_mobile,pinnamur\/titanium_mobile,indera\/titanium_mobile,openbaoz\/titanium_mobile,sriks\/titanium_mobile,benbahrenburg\/titanium_mobile,pec1985\/titanium_mobile,linearhub\/titanium_mobile,jhaynie\/titanium_mobile,ashcoding\/titanium_mobile,taoger\/titanium_mobile,prop\/titanium_mobile,ashcoding\/titanium_mobile,emilyvon\/titanium_mobile,bhatfield\/titanium_mobile,mvitr\/titanium_mobile,openbaoz\/titanium_mobile,indera\/titanium_mobile,openbaoz\/titanium_mobile,peymanmortazavi\/titanium_mobile,falkolab\/titanium_mobile,jhaynie\/titanium_mobile,AngelkPetkov\/titanium_mobile,formalin14\/titanium_mobile,taoger\/titanium_mobile,shopmium\/titanium_mobile,peymanmortazavi\/titanium_mobile,falkolab\/titanium_mobile,mano-mykingdom\/titanium_mobile,KangaCoders\/titanium_mobile,shopmium\/titanium_mobile,AngelkPetkov\/titanium_mobile,csg-coder\/titanium_mobile,perdona\/titanium_mobile,pec1985\/titanium_mobile,prop\/titanium_mobile,mano-mykingdom\/titanium_mobile,falkolab\/titanium_mobile,ashcoding\/titanium_mobile,jvkops\/titanium_mobile,openbaoz\/titanium_mobile,bhatfield\/titanium_mobile,AngelkPetkov\/titanium_mobile,taoger\/titanium_mobile,KangaCoders\/titanium_mobile,bright-sparks\/titanium_mobile,benbahrenburg\/titanium_mobile,cheekiatng\/titanium_mobile,cheekiatng\/titanium_mobile,ashcoding\/titanium_mobile,smit1625\/titanium_mobile,linearhub\/titanium_mobile,openbaoz\/titanium_mobile,FokkeZB\/titanium_mobile,taoger\/titanium_mobile,csg-coder\/titanium_mobile,kopiro\/titanium_mobile,prop\/titanium_mobile,benbahrenburg\/titanium_mobile,prop\/titanium_mobile,indera\/titanium_mobile,linearhub\/titanium_mobile,cheekiatng\/titanium_mobile,formalin14\/titanium_mobile,mvitr\/titanium_mobile,FokkeZB\/titanium_mobile,sriks\/titanium_mobile,jhaynie\/titanium_mobile,formalin14\/titanium_mobile,mvitr\/titanium_mobile,jvkops\/titanium_mobile,FokkeZB\/titanium_mobile,KoketsoMabuela92\/titanium_mobile,mvitr\/titanium_mobile,jhaynie\/titanium_mobile,pec1985\/titanium_mobile,rblalock\/titanium_mobile,bright-sparks\/titanium_mobile,collinprice\/titanium_mobile,KoketsoMabuela92\/titanium_mobile,cheekiatng\/titanium_mobile,rblalock\/titanium_mobile,bright-sparks\/titanium_mobile,KoketsoMabuela92\/titanium_mobile,linearhub\/titanium_mobile,bhatfield\/titanium_mobile,mano-mykingdom\/titanium_mobile,jvkops\/titanium_mobile,ashcoding\/titanium_mobile,csg-coder\/titanium_mobile,perdona\/titanium_mobile,falkolab\/titanium_mobile,falkolab\/titanium_mobile,perdona\/titanium_mobile,jvkops\/titanium_mobile,indera\/titanium_mobile,bright-sparks\/titanium_mobile,FokkeZB\/titanium_mobile,rblalock\/titanium_mobile,benbahrenburg\/titanium_mobile,shopmium\/titanium_mobile,linearhub\/titanium_mobile,taoger\/titanium_mobile,collinprice\/titanium_mobile,shopmium\/titanium_mobile,indera\/titanium_mobile,mano-mykingdom\/titanium_mobile,mano-mykingdom\/titanium_mobile,rblalock\/titanium_mobile,collinprice\/titanium_mobile,emilyvon\/titanium_mobile,csg-coder\/titanium_mobile,FokkeZB\/titanium_mobile,perdona\/titanium_mobile,sriks\/titanium_mobile,emilyvon\/titanium_mobile,openbaoz\/titanium_mobile,kopiro\/titanium_mobile,cheekiatng\/titanium_mobile,formalin14\/titanium_mobile,mano-mykingdom\/titanium_mobile,bright-sparks\/titanium_mobile,perdona\/titanium_mobile,prop\/titanium_mobile,AngelkPetkov\/titanium_mobile,FokkeZB\/titanium_mobile,pinnamur\/titanium_mobile,emilyvon\/titanium_mobile,falkolab\/titanium_mobile,KoketsoMabuela92\/titanium_mobile,csg-coder\/titanium_mobile,AngelkPetkov\/titanium_mobile,peymanmortazavi\/titanium_mobile,jhaynie\/titanium_mobile,csg-coder\/titanium_mobile,mvitr\/titanium_mobile,collinprice\/titanium_mobile,sriks\/titanium_mobile,KangaCoders\/titanium_mobile,sriks\/titanium_mobile,peymanmortazavi\/titanium_mobile,indera\/titanium_mobile,KangaCoders\/titanium_mobile,bhatfield\/titanium_mobile,collinprice\/titanium_mobile,AngelkPetkov\/titanium_mobile,openbaoz\/titanium_mobile,cheekiatng\/titanium_mobile,collinprice\/titanium_mobile,linearhub\/titanium_mobile,KoketsoMabuela92\/titanium_mobile,formalin14\/titanium_mobile,falkolab\/titanium_mobile,rblalock\/titanium_mobile,pinnamur\/titanium_mobile,rblalock\/titanium_mobile,jhaynie\/titanium_mobile,KangaCoders\/titanium_mobile,pec1985\/titanium_mobile,emilyvon\/titanium_mobile,kopiro\/titanium_mobile,benbahrenburg\/titanium_mobile,jvkops\/titanium_mobile,taoger\/titanium_mobile,shopmium\/titanium_mobile,benbahrenburg\/titanium_mobile,peymanmortazavi\/titanium_mobile,pinnamur\/titanium_mobile,jvkops\/titanium_mobile,pec1985\/titanium_mobile,bhatfield\/titanium_mobile,shopmium\/titanium_mobile,FokkeZB\/titanium_mobile,emilyvon\/titanium_mobile,perdona\/titanium_mobile,linearhub\/titanium_mobile,ashcoding\/titanium_mobile,smit1625\/titanium_mobile,kopiro\/titanium_mobile,smit1625\/titanium_mobile,formalin14\/titanium_mobile,cheekiatng\/titanium_mobile,smit1625\/titanium_mobile,mvitr\/titanium_mobile,falkolab\/titanium_mobile,pec1985\/titanium_mobile,peymanmortazavi\/titanium_mobile,mano-mykingdom\/titanium_mobile,bhatfield\/titanium_mobile,smit1625\/titanium_mobile,smit1625\/titanium_mobile,bright-sparks\/titanium_mobile,rblalock\/titanium_mobile,pec1985\/titanium_mobile,sriks\/titanium_mobile,pec1985\/titanium_mobile,emilyvon\/titanium_mobile,bright-sparks\/titanium_mobile,shopmium\/titanium_mobile,kopiro\/titanium_mobile,mvitr\/titanium_mobile,ashcoding\/titanium_mobile,prop\/titanium_mobile,rblalock\/titanium_mobile,formalin14\/titanium_mobile,taoger\/titanium_mobile,AngelkPetkov\/titanium_mobile,cheekiatng\/titanium_mobile,peymanmortazavi\/titanium_mobile,mvitr\/titanium_mobile,ashcoding\/titanium_mobile,collinprice\/titanium_mobile,bright-sparks\/titanium_mobile,pinnamur\/titanium_mobile,pinnamur\/titanium_mobile,indera\/titanium_mobile,bhatfield\/titanium_mobile,emilyvon\/titanium_mobile,KoketsoMabuela92\/titanium_mobile,KangaCoders\/titanium_mobile,KoketsoMabuela92\/titanium_mobile,pec1985\/titanium_mobile,AngelkPetkov\/titanium_mobile,taoger\/titanium_mobile,csg-coder\/titanium_mobile,peymanmortazavi\/titanium_mobile,prop\/titanium_mobile,kopiro\/titanium_mobile,formalin14\/titanium_mobile,jvkops\/titanium_mobile,KangaCoders\/titanium_mobile,collinprice\/titanium_mobile,jhaynie\/titanium_mobile,sriks\/titanium_mobile,perdona\/titanium_mobile,sriks\/titanium_mobile,pinnamur\/titanium_mobile,smit1625\/titanium_mobile,indera\/titanium_mobile,linearhub\/titanium_mobile,mano-mykingdom\/titanium_mobile,perdona\/titanium_mobile,csg-coder\/titanium_mobile,kopiro\/titanium_mobile,shopmium\/titanium_mobile,benbahrenburg\/titanium_mobile,FokkeZB\/titanium_mobile,pinnamur\/titanium_mobile,openbaoz\/titanium_mobile"}
{"commit":"a5d990cebb620ca071306a74178f32db58abcdd1","old_file":"play_song.scpt","new_file":"play_song.scpt","old_contents":"on run argv\n\tset song_title to item 1 in argv\n\n\ttry\n\t\ttell application \"iTunes\" to play track song_title of current playlist\n\ton error error_message\n\t\ttell application \"iTunes\" to play playlist song_title\n\tend try\nend run","new_contents":"on run argv\n\tset song_title to item 1 in argv\n\n\ttell application \"iTunes\" to set playlist_list to the name of every user playlist\n\n\tif playlist_list does not contain song_title then\n\t\ttell application \"iTunes\" to play track song_title of current playlist\n\telse\n\t\ttell application \"iTunes\" to play playlist song_title\n\tend if\n\nend run","subject":"improve readability of play_song.scpt","message":"improve readability of play_song.scpt\n","lang":"AppleScript","license":"bsd-3-clause","repos":"kasoki\/Maestro"}
{"commit":"29911ebaa647ac12946ddadca8acb682837535dc","old_file":"kalabox\/utils\/task-runner\/sudo-pass.scpt","new_file":"kalabox\/utils\/task-runner\/sudo-pass.scpt","old_contents":"set kalaicon to 2\ntell application \"System Events\" to set itExists to \u00ac\n  exists of alias ((path to me as text) & \":app.icns\")\nif itExists\n  set kalaicon to alias ((path to me as text) & \":app.icns\")\nend if\ntell application \"SystemUIServer\"\n  activate\n  set my_password to display dialog \u00ac\n    \"Please enter your administrator password:\" with title \u00ac\n    \"Password\" with icon kalaicon \u00ac\n    default answer \u00ac\n    \"\" buttons {\"Cancel\", \"OK\"} default button 2 \u00ac\n    giving up after 295 \u00ac\n    with hidden answer\nend tell\n","new_contents":"set kalaicon to 2\ntell application \"System Events\" to set itExists to \u00ac\n  exists of alias ((path to me as text) & \":app.icns\")\nif itExists\n  set kalaicon to alias ((path to me as text) & \":app.icns\")\nend if\ntell application \"SystemUIServer\"\n  activate\n  set my_password to display dialog \u00ac\n    \"Please enter your Mac user account password. Installation will fail if your account does not have administrative privileges.\" with title \u00ac\n    \"Password\" with icon kalaicon \u00ac\n    default answer \u00ac\n    \"\" buttons {\"Cancel\", \"OK\"} default button 2 \u00ac\n    giving up after 295 \u00ac\n    with hidden answer\nend tell\n","subject":"Fix #73","message":"Fix #73","lang":"AppleScript","license":"mit","repos":"kalamuna\/kalaboxv1,kalamuna\/kalaboxv1,kalamuna\/kalaboxv1"}
{"commit":"244fae96404c15c168d5d79768dc1bbe854b6828","old_file":"applescripts\/halt_vagrant.applescript","new_file":"applescripts\/halt_vagrant.applescript","old_contents":"set close_ubervu_vagrant to \"cd ~\/uberVU\/puppet; vagrant halt -f;\"\nset close_hs_vagrant to \"cd ~\/hootsuite\/dash-board; vagrant halt -f;\"\n\n-- close vagrant\ntell application \"iTerm\"\n\tactivate\n\tset myterm to (make new terminal)\n\ttell myterm\n\t\tlaunch session \"Default\"\n\t\tset mysession to current session\n\tend tell\n\n\ttell mysession\n\t\twrite text close_ubervu_vagrant\n\t\twrite text close_hs_vagrant\n\tend tell\nend tell\n","new_contents":"set close_ubervu_vagrant to \"cd ~\/uberVU\/puppet\/hs_analytics_vagrant; vagrant halt -f;\"\n\n-- close vagrant\ntell application \"iTerm\"\n\tactivate\n\tset myterm to (make new terminal)\n\ttell myterm\n\t\tlaunch session \"Default\"\n\t\tset mysession to current session\n\tend tell\n\n\ttell mysession\n\t\twrite text close_ubervu_vagrant\n\tend tell\nend tell\n","subject":"Update halt_vagrant.applescript","message":"Update halt_vagrant.applescript\n","lang":"AppleScript","license":"mit","repos":"smathson\/dotfiles"}
{"commit":"aeb09d5d41b5f39a01eaae5c836f4c3f1da3e6f4","old_file":"etc\/pdf.scpt","new_file":"etc\/pdf.scpt","old_contents":"############################\n# How to generate the PDFs #\n############################\n# 1. Update cover.html with the new version date\n# 2. Open cover.html in safari and generate Cover.pdf\n# 3. Place Cover.pdf in ~\/Downloads folder\n# 4. Ensure \"Downloads\" folder is an option when \"Export to PDF\u2026\" in Safari\n# 5. In terminal, run \"osascript pdf.scpt\"\n\n\nset theChaptersStr to \"index\nwho-is-this-guide-for\nwhat-does-this-guide-cover\nhow-to-get-help\nwhat-is-serverless\nwhy-create-serverless-apps\ncreate-an-aws-account\ncreate-an-iam-user\nwhat-is-iam\nwhat-is-an-arn\nconfigure-the-aws-cli\ncreate-a-dynamodb-table\ncreate-an-s3-bucket-for-file-uploads\ncreate-a-cognito-user-pool\ncreate-a-cognito-test-user\nsetup-the-serverless-framework\nadd-support-for-es6-es7-javascript\nadd-a-create-note-api\nadd-a-get-note-api\nadd-a-list-all-the-notes-api\nadd-an-update-note-api\nadd-a-delete-note-api\ndeploy-the-apis\ncreate-a-cognito-identity-pool\ncognito-user-pool-vs-identity-pool\ntest-the-apis\ncreate-a-new-reactjs-app\nadd-app-favicons\nsetup-custom-fonts\nsetup-bootstrap\nhandle-routes-with-react-router\ncreate-containers\nadding-links-in-the-navbar\nhandle-404s\ncreate-a-login-page\nlogin-with-aws-cognito\nadd-the-session-to-the-state\nload-the-state-from-the-session\nclear-the-session-on-logout\nredirect-on-login-and-logout\ngive-feedback-while-logging-in\ncreate-a-signup-page\ncreate-the-signup-form\nsignup-with-aws-cognito\nadd-the-create-note-page\nconnect-to-api-gateway-with-iam-auth\ncall-the-create-api\nupload-a-file-to-s3\nclear-aws-credentials-cache\nlist-all-the-notes\ncall-the-list-api\ndisplay-a-note\nrender-the-note-form\nsave-changes-to-a-note\ndelete-a-note\nsetup-secure-pages\ncreate-a-route-that-redirects\nuse-the-redirect-routes\nredirect-on-login\ndeploy-the-frontend\ncreate-an-s3-bucket\ndeploy-to-s3\ncreate-a-cloudfront-distribution\nsetup-your-domain-with-cloudfront\nsetup-www-domain-redirect\nsetup-ssl\ndeploy-updates\nupdate-the-app\ndeploy-again\ncode-splitting-in-create-react-app\nwrapping-up\ngiving-back\nolder-versions\nstaying-up-to-date\nserverless-es7-service\"\n\nset text item delimiters to \"\n\"\n\nset theChapters to text items of theChaptersStr\n\n\n#################\n# Download PDFs #\n#################\n#repeat with theCurrentChapter in theChapters\n#  downloadPdf(theCurrentChapter)\n#end repeat\n\n##############\n# Merge PDFs #\n##############\nset outputFile to \"~\/Downloads\/ServerlessStack.pdf\"\n\nset pdfFiles to \"~\/Downloads\/Cover.pdf\"\nrepeat with theCurrentChapter in theChapters\n  set pdfFiles to pdfFiles & \" ~\/Downloads\/\" & theCurrentChapter & \".pdf\"\nend repeat\n\ndo shell script \"\/System\/Library\/Automator\/Combine\\\\ PDF\\\\ Pages.action\/Contents\/Resources\/join.py \" & \"-o \" & outputFile & \" \" & pdfFiles\n\n\non downloadPdf(theChapterName)\n  tell application \"System Events\"\n\n    tell process \"Safari\"\n      set frontmost to true\n\n      if ((theChapterName as string) is equal to \"index\") then\n        set urlPath to theChapterName\n      else\n        set urlPath to \"chapters\/\" & theChapterName\n      end if\n      open location \"https:\/\/serverless-stack.com\/\" & urlPath & \".html\"\n\n      delay 1\n\n      repeat until menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 exists\n        delay 0.2\n      end repeat\n      repeat until menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 is enabled\n        delay 0.2\n      end repeat\n      click menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1\n\n      tell window 1\n        repeat until sheet 1 exists\n        end repeat\n\n        tell sheet 1\n          keystroke theChapterName\n          click pop up button \"Where:\"\n\n          repeat until menu 1 of pop up button \"Where:\" exists\n          end repeat\n          click menu item \"Downloads\" of menu 1 of pop up button \"Where:\"\n          click button \"Save\"\n        end tell\n\n      end tell\n\n      click menu item \"Close Tab\" of menu \"File\" of menu bar 1\n\n    end tell\n\n  end tell\nend downloadPdf\n","new_contents":"############################\n# How to generate the PDFs #\n############################\n# 1. Update cover.html with the new version date\n# 2. Open cover.html in safari and generate Cover.pdf\n# 3. Place Cover.pdf in ~\/Downloads folder\n# 4. Ensure \"Downloads\" folder is an option when \"Export to PDF\u2026\" in Safari\n# 5. In terminal, run \"osascript pdf.scpt\"\n\n\nset theChaptersStr to \"index\nwho-is-this-guide-for\nwhat-does-this-guide-cover\nhow-to-get-help\nwhat-is-serverless\nwhy-create-serverless-apps\ncreate-an-aws-account\ncreate-an-iam-user\nwhat-is-iam\nwhat-is-an-arn\nconfigure-the-aws-cli\ncreate-a-dynamodb-table\ncreate-an-s3-bucket-for-file-uploads\ncreate-a-cognito-user-pool\ncreate-a-cognito-test-user\nsetup-the-serverless-framework\nadd-support-for-es6-es7-javascript\nadd-a-create-note-api\nadd-a-get-note-api\nadd-a-list-all-the-notes-api\nadd-an-update-note-api\nadd-a-delete-note-api\ndeploy-the-apis\ncreate-a-cognito-identity-pool\ncognito-user-pool-vs-identity-pool\ntest-the-apis\ncreate-a-new-reactjs-app\nadd-app-favicons\nsetup-custom-fonts\nsetup-bootstrap\nhandle-routes-with-react-router\ncreate-containers\nadding-links-in-the-navbar\nhandle-404s\nconfigure-aws-amplify\ncreate-a-login-page\nlogin-with-aws-cognito\nadd-the-session-to-the-state\nload-the-state-from-the-session\nclear-the-session-on-logout\nredirect-on-login-and-logout\ngive-feedback-while-logging-in\ncreate-a-signup-page\ncreate-the-signup-form\nsignup-with-aws-cognito\nadd-the-create-note-page\ncall-the-create-api\nupload-a-file-to-s3\nlist-all-the-notes\ncall-the-list-api\ndisplay-a-note\nrender-the-note-form\nsave-changes-to-a-note\ndelete-a-note\nsetup-secure-pages\ncreate-a-route-that-redirects\nuse-the-redirect-routes\nredirect-on-login\ndeploy-the-frontend\ncreate-an-s3-bucket\ndeploy-to-s3\ncreate-a-cloudfront-distribution\nsetup-your-domain-with-cloudfront\nsetup-www-domain-redirect\nsetup-ssl\ndeploy-updates\nupdate-the-app\ndeploy-again\nwrapping-up\ngiving-back\nchangelog\nstaying-up-to-date\napi-gateway-and-lambda-logs\ndebugging-serverless-api-issues\nserverless-environment-variables\nstages-in-serverless-framework\nconfigure-multiple-aws-profiles\ncustomize-the-serverless-iam-policy\ncode-splitting-in-create-react-app\nenvironments-in-create-react-app\nconnect-to-api-gateway-with-iam-auth\nserverless-nodejs-starter\"\n\nset text item delimiters to \"\n\"\n\nset theChapters to text items of theChaptersStr\n\n\n#################\n# Download PDFs #\n#################\n#repeat with theCurrentChapter in theChapters\n#  downloadPdf(theCurrentChapter)\n#end repeat\n\n##############\n# Merge PDFs #\n##############\nset outputFile to \"~\/Downloads\/ServerlessStack.pdf\"\n\nset pdfFiles to \"~\/Downloads\/Cover.pdf\"\nrepeat with theCurrentChapter in theChapters\n  set pdfFiles to pdfFiles & \" ~\/Downloads\/\" & theCurrentChapter & \".pdf\"\nend repeat\n\ndo shell script \"\/System\/Library\/Automator\/Combine\\\\ PDF\\\\ Pages.action\/Contents\/Resources\/join.py \" & \"-o \" & outputFile & \" \" & pdfFiles\n\n\non downloadPdf(theChapterName)\n  tell application \"System Events\"\n\n    tell process \"Safari\"\n      set frontmost to true\n\n      if ((theChapterName as string) is equal to \"index\") then\n        set urlPath to theChapterName\n      else\n        set urlPath to \"chapters\/\" & theChapterName\n      end if\n      open location \"https:\/\/serverless-stack.com\/\" & urlPath & \".html\"\n\n      delay 1\n\n      repeat until menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 exists\n        delay 0.2\n      end repeat\n      repeat until menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 is enabled\n        delay 0.2\n      end repeat\n      click menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1\n\n      tell window 1\n        repeat until sheet 1 exists\n        end repeat\n\n        tell sheet 1\n          keystroke theChapterName\n          click pop up button \"Where:\"\n\n          repeat until menu 1 of pop up button \"Where:\" exists\n          end repeat\n          click menu item \"Downloads\" of menu 1 of pop up button \"Where:\"\n          click button \"Save\"\n        end tell\n\n      end tell\n\n      click menu item \"Close Tab\" of menu \"File\" of menu bar 1\n\n    end tell\n\n  end tell\nend downloadPdf\n","subject":"Update chapter list for PDF","message":"Update chapter list for PDF\n","lang":"AppleScript","license":"mit","repos":"AnomalyInnovations\/serverless-stack-com,AnomalyInnovations\/serverless-stack-com"}
{"commit":"a2ec45c0fa19bdde02fa206ac453c13f95e688aa","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\n-- workflow folders\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\n\n-- the default icon used for search results without album artwork\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and use it to fetch album artwork\n\t\t\tset songId to persistent ID of theSong\n\t\t\t-- the base path to the artwork file (without extension)\n\t\t\tset artworkPath to (do shell script \".\/resources\/get-song-artwork-path.sh\" & space & songId & space & defaultIconName)\n\n\t\tend tell\n\n\t\treturn artworkPath\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\ttell application \"Music\"\n\n\t\treturn every track of playlist 2 whose genre is genreName\n\n\tend tell\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in artistSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset artistSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName)\n\t\t\tset artistSongs to artistSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\n-- workflow folders\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\n\n-- the default icon used for search results without album artwork\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and use it to fetch album artwork\n\t\t\tset songId to persistent ID of theSong\n\t\t\t-- the base path to the artwork file (without extension)\n\t\t\tset artworkPath to (do shell script \".\/resources\/get-song-artwork-path.sh\" & space & songId & space & defaultIconName)\n\n\t\tend tell\n\n\t\treturn artworkPath\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\ttell application \"Music\"\n\n\t\treturn every track of playlist 2 whose genre is genreName\n\n\tend tell\n\nend getGenreSongs\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","subject":"Make playartist filter faster and honor sort order","message":"Make playartist filter faster and honor sort order\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"5ec1c244b021710645dc22e0cc07404ab8e5861f","old_file":"lib\/scripts\/get_track.applescript","new_file":"lib\/scripts\/get_track.applescript","old_contents":"on escape_quotes(string_to_escape)\n\tset AppleScript's text item delimiters to the \"\\\"\"\n\tset the item_list to every text item of string_to_escape\n\tset AppleScript's text item delimiters to the \"\\\\\\\"\"\n\tset string_to_escape to the item_list as string\n\tset AppleScript's text item delimiters to \"\"\n\treturn string_to_escape\nend escape_quotes\n\ntell application \"Spotify\"\n\tset ctrack to \"{\"\n\tset ctrack to ctrack & \"\\\"artist\\\": \\\"\" & my escape_quotes(current track's artist) & \"\\\"\"\n\tset ctrack to ctrack & \",\\\"album\\\": \\\"\" & my escape_quotes(current track's album) & \"\\\"\"\n\tset ctrack to ctrack & \",\\\"disc_number\\\": \" & current track's disc number\n\tset ctrack to ctrack & \",\\\"duration\\\": \" & current track's duration\n\tset ctrack to ctrack & \",\\\"played_count\\\": \" & current track's played count\n\tset ctrack to ctrack & \",\\\"track_number\\\": \" & current track's track number\n\tset ctrack to ctrack & \",\\\"popularity\\\": \" & current track's popularity\n\tset ctrack to ctrack & \",\\\"id\\\": \\\"\" & current track's id & \"\\\"\"\n\tset ctrack to ctrack & \",\\\"name\\\": \\\"\" & my escape_quotes(current track's name) & \"\\\"\"\n\tset ctrack to ctrack & \",\\\"album_artist\\\": \\\"\" & my escape_quotes(current track's album artist) & \"\\\"\"\n\tset ctrack to ctrack & \",\\\"artwork_url\\\": \\\"\" & current track's artwork url & \"\\\"\"\n\tset ctrack to ctrack & \",\\\"spotify_url\\\": \\\"\" & current track's spotify url & \"\\\"\"\n\tset ctrack to ctrack & \"}\"\nend tell\n","new_contents":"on escape_quotes(string_to_escape)\n  set AppleScript's text item delimiters to the \"\\\"\"\n  set the item_list to every text item of string_to_escape\n  set AppleScript's text item delimiters to the \"\\\\\\\"\"\n  set string_to_escape to the item_list as string\n  set AppleScript's text item delimiters to \"\"\n  return string_to_escape\nend escape_quotes\n\ntell application \"Spotify\"\n  set ctrack to \"{\"\n  set ctrack to ctrack & \"\\\"artist\\\": \\\"\" & my escape_quotes(current track's artist) & \"\\\"\"\n  set ctrack to ctrack & \",\\\"album\\\": \\\"\" & my escape_quotes(current track's album) & \"\\\"\"\n  set ctrack to ctrack & \",\\\"disc_number\\\": \" & current track's disc number\n  set ctrack to ctrack & \",\\\"duration\\\": \" & current track's duration\n  set ctrack to ctrack & \",\\\"played_count\\\": \" & current track's played count\n  set ctrack to ctrack & \",\\\"track_number\\\": \" & current track's track number\n  set ctrack to ctrack & \",\\\"popularity\\\": \" & current track's popularity\n  set ctrack to ctrack & \",\\\"id\\\": \\\"\" & current track's id & \"\\\"\"\n  set ctrack to ctrack & \",\\\"name\\\": \\\"\" & my escape_quotes(current track's name) & \"\\\"\"\n  set ctrack to ctrack & \",\\\"album_artist\\\": \\\"\" & my escape_quotes(current track's album artist) & \"\\\"\"\n  set ctrack to ctrack & \",\\\"artwork_url\\\": \\\"\" & current track's artwork url & \"\\\"\"\n  set ctrack to ctrack & \",\\\"spotify_url\\\": \\\"\" & current track's spotify url & \"\\\"\"\n  set ctrack to ctrack & \"}\"\nend tell\n","subject":"remove tab","message":"remove tab\n","lang":"AppleScript","license":"mit","repos":"andrehaveman\/spotify-node-applescript"}
{"commit":"b97c601301bf27c73656787f4350103647b0c445","old_file":"lib\/scripts\/get_artwork.applescript","new_file":"lib\/scripts\/get_artwork.applescript","old_contents":"on replace_chars(this_text, search_string, replacement_string)\n  set AppleScript's text item delimiters to the search_string\n  set the item_list to every text item of this_text\n  set AppleScript's text item delimiters to the replacement_string\n  set this_text to the item_list as string\n  set AppleScript's text item delimiters to \"\"\n  return this_text\nend replace_chars\n\non file_exists(filePath)\n  tell application \"Finder\" to return exists filePath as POSIX file\nend file_exists\n\ntell application \"Spotify\"\n  set currentArtwork to current track's artwork\n  set savePath to POSIX path of (path to temporary items from user domain as string) & my replace_chars(current track's id,\":\",\"_\")\n  set tiffPath to (savePath & \".tiff\")\n  set pngPath to (savePath & \".png\")\nend tell\n\n-- don't do the image events dance when the file already exists\nif my file_exists(pngPath) then return pngPath\n\ntell application \"System Events\"\n  if not (my file_exists(tiffPath)) then\n    set fileRef to (open for access tiffPath with write permission)\n    write currentArtwork to fileRef\n    close access fileRef\n  end\n\n  tell application \"Image Events\"\n    launch\n    set theImage to open tiffPath\n    save theImage as PNG in pngPath\n    quit\n  end tell\n\n  delete file tiffPath\n  quit\nend tell\n\nreturn pngPath\n","new_contents":"on replace_chars(this_text, search_string, replacement_string)\n  set AppleScript's text item delimiters to the search_string\n  set the item_list to every text item of this_text\n  set AppleScript's text item delimiters to the replacement_string\n  set this_text to the item_list as string\n  set AppleScript's text item delimiters to \"\"\n  return this_text\nend replace_chars\n\non file_exists(filePath)\n  tell application \"Finder\" to return exists filePath as POSIX file\nend file_exists\n\ntell application \"Spotify\"\n  set currentArtwork to current track's artwork\n  set savePath to POSIX path of (path to temporary items from user domain as string) & my replace_chars(current track's id,\":\",\"_\")\n  set tiffPath to (savePath & \".tiff\")\n  set pngPath to (savePath & \".png\")\nend tell\n\n-- don't do the image events dance when the file already exists\nif my file_exists(pngPath) then return pngPath\n\nif not (my file_exists(tiffPath)) then\n  set fileRef to (open for access tiffPath with write permission)\n  write currentArtwork to fileRef\n  close access fileRef\nend\n\ntell application \"Image Events\"\n  launch\n  set theImage to open tiffPath\n  save theImage as PNG in pngPath\n  delete file tiffPath\n  quit\nend tell\n\nreturn pngPath\n","subject":"remove unnecessary usage of System Events","message":"remove unnecessary usage of System Events\n","lang":"AppleScript","license":"mit","repos":"andrehaveman\/spotify-node-applescript"}
{"commit":"ab9e11ce88fb10bd5ed9915044fa88da99179725","old_file":"library\/fmGUI_ManageScripts\/fmGUI_ManageScripts_FmScript_Select.applescript","new_file":"library\/fmGUI_ManageScripts\/fmGUI_ManageScripts_FmScript_Select.applescript","old_contents":"-- fmGUI_ManageScripts_FmScript_Select({})\n-- Daniel A. Shockley, NYHTC\n-- Select an existing script in the Script Workspace.\n\n\n(*\nHISTORY:\n\t2020-03-03 ( dshockley, hdu ): Updated as standalone function for fm-scripts git repository.\n\t1.3.1 - 2017-06-05 ( eshagdar ): the name of the script is the name of UI elemnt, not the value of a text field.\n\t1.3 - 2017-01-12 ( eshagdar ): updated for FM15 - script names are now in a splitter group.\n\t2017-06-05 ( eshagdar ): we should just be using the search bar instead of scanning through the list\n\nREQUIRES:\n\tfmGUI_AppFrontMost\n\tfmGUI_DataViewer_Close\n\tfmGUI_Inspector_Close\n\tfmGUI_ManageScripts_Open\n\tfmGUI_ManageScripts_ScriptListFocus\n\tfmGUI_ManageScripts_SearchBoxClear\n\tfmGUI_ManageScripts_SearchBoxFind\n\tunParseChars\n\t\n*)\n\nproperty debugMode : true\nproperty ScriptName : \"fmGUI_ManageScripts_FmScript_Select\"\n\non run\n\tfmGUI_ManageScripts_FmScript_Select({})\nend run\n\n--------------------\n-- START OF CODE\n--------------------\n\non fmGUI_ManageScripts_FmScript_Select(prefs)\n\t-- version 1.3.1\n\t\n\t-- Attempt to select a FileMaker Script based on name or, alternatively, other partial matches.\n\t\n\t\n\tset defaultPrefs to {fmScriptName:null, altPatterns:null}\n\tset prefs to prefs & defaultPrefs\n\t(* EXAMPLE:\n\taltPatterns:{\n\t\t{pattern:{{testType:\"is\", testMatch:\"z_Auto1\"}}},\n\t\t{pattern:{{testType:\"startsWith\", testMatch:\"z\"},{testType:\"endsWith\", testMatch:\"_Auto1\"}}}\n\t\t}\n\t*)\n\t\n\t\n\t-- CONSTANTS: \n\tset testCodeHeader to \"tell application \\\"System Events\\\"\" & return & \"tell application process \\\"FileMaker Pro Advanced\\\"\" & return\n\tset selectCode to \"select (\"\n\tset rowRefCode to \"first row of (outline 1 of scroll area 1 of splitter group 1 of window 1)\"\n\tset whoseCode to \" whose \"\n\tset scriptNameObjectCode to \"name of UI Element 1\"\n\t-- (then some test will be inserted)\n\tset betweenTestsCode to \" and \"\n\t-- (then possibly some other test will be inserted)\n\tset afterAllTestsCode to \")\"\n\tset testCodeFooter to return & \"end tell\" & return & \"end tell\"\n\t\n\t\n\ttry\n\t\tif fmScriptName of prefs is equal to \"-\" then error \"This is a SEPARATOR SCRIPT - don't try to edit it!\" number -1024\n\t\t\n\t\ttell application \"htcLib\"\n\t\t\tfmGUI_AppFrontMost()\n\t\t\tfmGUI_Inspector_Close()\n\t\t\tfmGUI_DataViewer_Close()\n\t\t\tfmGUI_ManageScripts_Open({})\n\t\t\tfmGUI_ManageScripts_ScriptListFocus({})\n\t\tend tell\n\t\t\n\t\t\n\t\tfmGUI_ManageScripts_SearchBoxFind({searchCriteria:fmScriptName of prefs})\n\t\ttell application \"System Events\"\n\t\t\ttell application process \"FileMaker Pro Advanced\"\n\t\t\t\t(*\n\t\t\t\tset searchField to text field 1 of splitter group 1 of window 1\n\t\t\t\tset focused of searchField to true\n\t\t\t\tdelay 0.25\n\t\t\t\tkeystroke \"a\" using command down\n\t\t\t\tkey code 51 -- clear the search box\n\t\t\t\tdelay 0.25\n\t\t\t\tset value of searchField to fmScriptName of prefs\n\t\t\t\tkeystroke tab\n\t\t\t\t*)\n\t\t\t\t\n\t\t\t\t-- SELECT the easy way if the object is directly available:\n\t\t\t\tif (exists (first row of (outline 1 of scroll area 1 of splitter group 1 of window 1) whose name of UI element 1 is fmScriptName of prefs)) then\n\t\t\t\t\tselect (first row of (outline 1 of scroll area 1 of splitter group 1 of window 1) whose name of UI element 1 is fmScriptName of prefs)\n\t\t\t\t\treturn true\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\telse -- if NOT found, then seek by alternate patterns, if specified: \n\t\t\t\t\t\n\t\t\t\t\t-- NOT FOUND, so try each altPattern: \n\t\t\t\t\tset scriptNowSelected to false\n\t\t\t\t\t\n\t\t\t\t\tmy fmGUI_ManageScripts_SearchBoxClear({})\n\t\t\t\t\trepeat with oneAltPattern in altPatterns of prefs\n\t\t\t\t\t\tset testList to contents of pattern of oneAltPattern\n\t\t\t\t\t\tif testList is equal to {{}} then\n\t\t\t\t\t\t\t--list of empty list, so we can't do anything with it\t\t\t\t\t\t\t\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t-- there are some valid items, so loop over them\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t\t-- BEGIN: try oneAltPattern: \n\t\t\t\t\t\t\t\tset testCode to {}\n\t\t\t\t\t\t\t\ttell application \"htcLib\"\n\t\t\t\t\t\t\t\t\trepeat with oneTestRec in testList\n\t\t\t\t\t\t\t\t\t\tcopy (\"\" & testType of oneTestRec & \" \" & quoteString(testMatch of oneTestRec)) to end of testCode\n\t\t\t\t\t\t\t\t\tend repeat\n\t\t\t\t\t\t\t\tend tell\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\ttell application \"htcLib\" to set testCode to unParseChars(testCode, betweenTestsCode & scriptNameObjectCode & \" \")\n\t\t\t\t\t\t\t\tset testCode to selectCode & rowRefCode & whoseCode & scriptNameObjectCode & \" \" & testCode & afterAllTestsCode\n\t\t\t\t\t\t\t\tset testCode to testCodeHeader & testCode & testCodeFooter\n\t\t\t\t\t\t\t\ttell me to run script testCode\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tset scriptNowSelected to true -- no error, so we selected it.\n\t\t\t\t\t\t\t\texit repeat -- no need to keep checking altPatterns\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t-- ERROR: try oneAltPattern. \n\t\t\t\t\t\t\ton error errMsg number errNum\n\t\t\t\t\t\t\t\tif errNum is not -1719 then\n\t\t\t\t\t\t\t\t\t-- some error OTHER than not found in list:\n\t\t\t\t\t\t\t\t\terror errMsg number errNum\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t-- just try the next altPattern, so continue repeat loop.\n\t\t\t\t\t\t\t\tend if\n\t\t\t\t\t\t\t\t-- END OF: try oneAltPattern. \n\t\t\t\t\t\t\tend try\n\t\t\t\t\t\t\t-- END OF: List had things. \n\t\t\t\t\t\tend if\n\t\t\t\t\tend repeat\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend tell\n\t\t\n\t\treturn scriptNowSelected\n\ton error errMsg number errNum\n\t\terror \"unable to fmGUI_ManageScripts_FmScript_Select '\" & fmScriptName of prefs & \"' - \" & errMsg number errNum\n\tend try\nend fmGUI_ManageScripts_FmScript_Select\n\n--------------------\n-- END OF CODE\n--------------------\n\n\n\n\n\n\n\n\n\non fmGUI_AppFrontMost()\n\ttell application \"htcLib\" to fmGUI_AppFrontMost()\nend fmGUI_AppFrontMost\n\non fmGUI_DataViewer_Close()\n\ttell application \"htcLib\" to fmGUI_DataViewer_Close()\nend fmGUI_DataViewer_Close\n\non fmGUI_Inspector_Close()\n\ttell application \"htcLib\" to fmGUI_Inspector_Close()\nend fmGUI_Inspector_Close\n\non fmGUI_ManageScripts_Open(prefs)\n\ttell application \"htcLib\" to fmGUI_ManageScripts_Open(prefs)\nend fmGUI_ManageScripts_Open\n\non fmGUI_ManageScripts_ScriptListFocus(prefs)\n\ttell application \"htcLib\" to fmGUI_ManageScripts_ScriptListFocus(prefs)\nend fmGUI_ManageScripts_ScriptListFocus\n\non fmGUI_ManageScripts_SearchBoxClear(prefs)\n\ttell application \"htcLib\" to fmGUI_ManageScripts_SearchBoxClear(prefs)\nend fmGUI_ManageScripts_SearchBoxClear\n\non fmGUI_ManageScripts_SearchBoxFind(prefs)\n\ttell application \"htcLib\" to fmGUI_ManageScripts_SearchBoxFind(prefs)\nend fmGUI_ManageScripts_SearchBoxFind\n\non unParseChars(prefs)\n\ttell application \"htcLib\" to unParseChars(prefs)\nend unParseChars\n\n\n\n","new_contents":"-- fmGUI_ManageScripts_FmScript_Select({})\n-- Daniel A. Shockley, NYHTC\n-- Select an existing script in the Script Workspace.\n\n\n(*\nHISTORY:\n\t2020-03-03 ( dshockley, hdu ): Updated as standalone function for fm-scripts git repository.\n\t1.3.1 - 2017-06-05 ( eshagdar ): the name of the script is the name of UI elemnt, not the value of a text field.\n\t1.3 - 2017-01-12 ( eshagdar ): updated for FM15 - script names are now in a splitter group.\n\t2017-06-05 ( eshagdar ): we should just be using the search bar instead of scanning through the list\n\nREQUIRES:\n\tfmGUI_AppFrontMost\n\tfmGUI_DataViewer_Close\n\tfmGUI_Inspector_Close\n\tfmGUI_ManageScripts_Open\n\tfmGUI_ManageScripts_ScriptListFocus\n\tfmGUI_ManageScripts_SearchBoxClear\n\tfmGUI_ManageScripts_SearchBoxFind\n\tquoteString\n\tunParseChars\n\t\n*)\n\nproperty debugMode : true\nproperty ScriptName : \"fmGUI_ManageScripts_FmScript_Select\"\n\non run\n\tfmGUI_ManageScripts_FmScript_Select({})\nend run\n\n--------------------\n-- START OF CODE\n--------------------\n\non fmGUI_ManageScripts_FmScript_Select(prefs)\n\t-- version 1.3.1\n\t\n\t-- Attempt to select a FileMaker Script based on name or, alternatively, other partial matches.\n\t\n\t\n\tset defaultPrefs to {fmScriptName:null, altPatterns:null}\n\tset prefs to prefs & defaultPrefs\n\t(* EXAMPLE:\n\taltPatterns:{\n\t\t{pattern:{{testType:\"is\", testMatch:\"z_Auto1\"}}},\n\t\t{pattern:{{testType:\"startsWith\", testMatch:\"z\"},{testType:\"endsWith\", testMatch:\"_Auto1\"}}}\n\t\t}\n\t*)\n\t\n\t\n\t-- CONSTANTS: \n\tset testCodeHeader to \"tell application \\\"System Events\\\"\" & return & \"tell application process \\\"FileMaker Pro Advanced\\\"\" & return\n\tset selectCode to \"select (\"\n\tset rowRefCode to \"first row of (outline 1 of scroll area 1 of splitter group 1 of window 1)\"\n\tset whoseCode to \" whose \"\n\tset scriptNameObjectCode to \"name of UI Element 1\"\n\t-- (then some test will be inserted)\n\tset betweenTestsCode to \" and \"\n\t-- (then possibly some other test will be inserted)\n\tset afterAllTestsCode to \")\"\n\tset testCodeFooter to return & \"end tell\" & return & \"end tell\"\n\t\n\t\n\ttry\n\t\tif fmScriptName of prefs is equal to \"-\" then error \"This is a SEPARATOR SCRIPT - don't try to edit it!\" number -1024\n\t\t\n\t\tfmGUI_AppFrontMost()\n\t\tfmGUI_Inspector_Close()\n\t\tfmGUI_DataViewer_Close()\n\t\tfmGUI_ManageScripts_Open({})\n\t\tfmGUI_ManageScripts_ScriptListFocus({})\n\t\t\n\t\t\n\t\tfmGUI_ManageScripts_SearchBoxFind({searchCriteria:fmScriptName of prefs})\n\t\ttell application \"System Events\"\n\t\t\ttell application process \"FileMaker Pro Advanced\"\n\t\t\t\t(*\n\t\t\t\tset searchField to text field 1 of splitter group 1 of window 1\n\t\t\t\tset focused of searchField to true\n\t\t\t\tdelay 0.25\n\t\t\t\tkeystroke \"a\" using command down\n\t\t\t\tkey code 51 -- clear the search box\n\t\t\t\tdelay 0.25\n\t\t\t\tset value of searchField to fmScriptName of prefs\n\t\t\t\tkeystroke tab\n\t\t\t\t*)\n\t\t\t\t\n\t\t\t\t-- SELECT the easy way if the object is directly available:\n\t\t\t\tif (exists (first row of (outline 1 of scroll area 1 of splitter group 1 of window 1) whose name of UI element 1 is fmScriptName of prefs)) then\n\t\t\t\t\tselect (first row of (outline 1 of scroll area 1 of splitter group 1 of window 1) whose name of UI element 1 is fmScriptName of prefs)\n\t\t\t\t\treturn true\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\telse -- if NOT found, then seek by alternate patterns, if specified: \n\t\t\t\t\t\n\t\t\t\t\t-- NOT FOUND, so try each altPattern: \n\t\t\t\t\tset scriptNowSelected to false\n\t\t\t\t\t\n\t\t\t\t\tmy fmGUI_ManageScripts_SearchBoxClear({})\n\t\t\t\t\trepeat with oneAltPattern in altPatterns of prefs\n\t\t\t\t\t\tset testList to contents of pattern of oneAltPattern\n\t\t\t\t\t\tif testList is equal to {{}} then\n\t\t\t\t\t\t\t--list of empty list, so we can't do anything with it\t\t\t\t\t\t\t\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t-- there are some valid items, so loop over them\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t\t-- BEGIN: try oneAltPattern: \n\t\t\t\t\t\t\t\tset testCode to {}\n\t\t\t\t\t\t\t\trepeat with oneTestRec in testList\n\t\t\t\t\t\t\t\t\tcopy (\"\" & testType of oneTestRec & \" \" & quoteString(testMatch of oneTestRec)) to end of testCode\n\t\t\t\t\t\t\t\tend repeat\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tset testCode to unParseChars(testCode, betweenTestsCode & scriptNameObjectCode & \" \")\n\t\t\t\t\t\t\t\tset testCode to selectCode & rowRefCode & whoseCode & scriptNameObjectCode & \" \" & testCode & afterAllTestsCode\n\t\t\t\t\t\t\t\tset testCode to testCodeHeader & testCode & testCodeFooter\n\t\t\t\t\t\t\t\ttell me to run script testCode\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tset scriptNowSelected to true -- no error, so we selected it.\n\t\t\t\t\t\t\t\texit repeat -- no need to keep checking altPatterns\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t-- ERROR: try oneAltPattern. \n\t\t\t\t\t\t\ton error errMsg number errNum\n\t\t\t\t\t\t\t\tif errNum is not -1719 then\n\t\t\t\t\t\t\t\t\t-- some error OTHER than not found in list:\n\t\t\t\t\t\t\t\t\terror errMsg number errNum\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t-- just try the next altPattern, so continue repeat loop.\n\t\t\t\t\t\t\t\tend if\n\t\t\t\t\t\t\t\t-- END OF: try oneAltPattern. \n\t\t\t\t\t\t\tend try\n\t\t\t\t\t\t\t-- END OF: List had things. \n\t\t\t\t\t\tend if\n\t\t\t\t\tend repeat\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend tell\n\t\t\n\t\treturn scriptNowSelected\n\ton error errMsg number errNum\n\t\terror \"unable to fmGUI_ManageScripts_FmScript_Select '\" & fmScriptName of prefs & \"' - \" & errMsg number errNum\n\tend try\nend fmGUI_ManageScripts_FmScript_Select\n\n--------------------\n-- END OF CODE\n--------------------\n\non fmGUI_AppFrontMost()\n\ttell application \"htcLib\" to fmGUI_AppFrontMost()\nend fmGUI_AppFrontMost\n\non fmGUI_DataViewer_Close()\n\ttell application \"htcLib\" to fmGUI_DataViewer_Close()\nend fmGUI_DataViewer_Close\n\non fmGUI_Inspector_Close()\n\ttell application \"htcLib\" to fmGUI_Inspector_Close()\nend fmGUI_Inspector_Close\n\non fmGUI_ManageScripts_Open(prefs)\n\ttell application \"htcLib\" to fmGUI_ManageScripts_Open(prefs)\nend fmGUI_ManageScripts_Open\n\non fmGUI_ManageScripts_ScriptListFocus(prefs)\n\ttell application \"htcLib\" to fmGUI_ManageScripts_ScriptListFocus(prefs)\nend fmGUI_ManageScripts_ScriptListFocus\n\non fmGUI_ManageScripts_SearchBoxClear(prefs)\n\ttell application \"htcLib\" to fmGUI_ManageScripts_SearchBoxClear(prefs)\nend fmGUI_ManageScripts_SearchBoxClear\n\non fmGUI_ManageScripts_SearchBoxFind(prefs)\n\ttell application \"htcLib\" to fmGUI_ManageScripts_SearchBoxFind(prefs)\nend fmGUI_ManageScripts_SearchBoxFind\n\non quoteString(prefs)\n\ttell application \"htcLib\" to quoteString(prefs)\nend quoteString\n\non unParseChars(prefs)\n\ttell application \"htcLib\" to unParseChars(prefs)\nend unParseChars\n\n","subject":"update fmGUI_ManageScripts_FmScript_Select","message":"update fmGUI_ManageScripts_FmScript_Select\n","lang":"AppleScript","license":"mit","repos":"NYHTC\/applescript-fm-helper"}
{"commit":"463d7d022de91452af3d57bc998646a891baca9f","old_file":"lib\/waddup\/sources\/apple_mail\/sent_mail.applescript","new_file":"lib\/waddup\/sources\/apple_mail\/sent_mail.applescript","old_contents":"on run argv\n  set window_from to date (item 1 of argv)\n  set window_to   to date (item 2 of argv)\n\n  tell application \"Mail\"\n    set results to {}\n\n    repeat with acct in every account\n      set username to user name of acct\n      try\n        set mbox to mailbox \"[Gmail]\/All Mail\" of acct\n      on error\n        set mbox to mailbox \"Sent\" of acct\n      end try\n\n      set msgs to (messages whose sender contains username and date sent >= window_from and date sent <= window_to) in mbox\n      repeat with msg in msgs\n        set the end of results to {subject:subject of msg, datetime:date sent of msg as string}\n      end repeat\n    end repeat\n\n    results\n  end tell\nend run\n","new_contents":"on run argv\n  set window_from to date (item 1 of argv)\n  set window_to   to date (item 2 of argv)\n\n  tell application \"Mail\"\n    set results to {}\n\n    set msgs to (messages of sent mailbox whose date sent >= window_from and date sent <= window_to)\n    repeat with msg in msgs\n      set the end of results to {subject:subject of msg, datetime:date sent of msg as string}\n    end repeat\n\n    results\n  end tell\nend run\n","subject":"Simplify sent mail script","message":"Simplify sent mail script\n","lang":"AppleScript","license":"mit","repos":"timkurvers\/waddup"}
{"commit":"a78b011c7b4b1f132799f7568d2fb6f0a736efab","old_file":"bundler\/AlfredBundler.applescript","new_file":"bundler\/AlfredBundler.applescript","old_contents":"(* GLOBAL PROPERTIES \n\n&& $? for bash status codes\n\n*)\nproperty BUNDLER_VERSION : \"devel\"\n--# Bundler paths\nproperty _home : POSIX path of (path to \"cusr\" as text)\nproperty BUNDLER_DIR : (_home) & \"Library\/Application Support\/Alfred 2\/Workflow Data\/alfred.bundler-\" & BUNDLER_VERSION\nproperty DATA_DIR : BUNDLER_DIR & \"\/data\"\nproperty CACHE_DIR : (_home) & \"Library\/Caches\/com.runningwithcrayons.Alfred-2\/Workflow Data\/alfred.bundler-\" & BUNDLER_VERSION\n--# Main Applescript Bundler\nproperty AS_BUNDLER : BUNDLER_DIR & \"\/bundler\/AlfredBundler.scpt\"\n--# Root directory under which workflow-specific applescript libraries are installed\nproperty APPLESCRIPT_DIR : DATA_DIR & \"\/assets\/applescript\"\n--# Root directory under which Bundler utilities are installed\nproperty UTILITIES_DIR : DATA_DIR & \"\/assets\/utility\"\n--# Directory for Bundler icons\nproperty ICONS_DIR : DATA_DIR & \"\/assets\/icons\"\n--# Where color alternatives are cached\nproperty COLOR_CACHE : DATA_DIR & \"\/color-cache\"\n\n(* GLOBAL VARIABLES *)\n\n--# Where installer.sh can be downloaded from\nglobal BASH_BUNDLET_URL\nset BASH_BUNDLET_URL to my formatter(\"https:\/\/raw.githubusercontent.com\/shawnrice\/alfred-bundler\/{}\/bundler\/bundlets\/alfred.bundler.sh\", BUNDLER_VERSION)\n\n--# Bundler log file\nglobal BUNDLER_LOGFILE\nset BUNDLER_LOGFILE to my formatter((DATA_DIR & \"\/logs\/bundler-{}.log\"), BUNDLER_VERSION)\n\n\n(* \/\/\/\nUSER API\n\/\/\/ *)\n\non utility(_name, _version, _json)\n\t--# partial support for \"optional\" args in Applescript\n\tif my is_empty(_version) then\n\t\tset _version to \"latest\"\n\tend if\n\tif my is_empty(_json) then\n\t\tset _json to \"\"\n\tend if\n\t--# path to specific utility\n\tset utility to my joiner({UTILITIES_DIR, _name, _version}, \"\/\")\n\tif my folder_exists(utility) = false then\n\t\t--# if utility isn't already installed\n\t\tmy logger(\"utility\", \"INFO\", my formatter(\"Utility at `{}` not found...\", utility))\n\t\tset bash_bundlet to (my dirname(AS_BUNDLER)) & \"bundlets\/alfred.bundler.sh\"\n\t\tif my file_exists(bash_bundlet) = true then\n\t\t\tset bash_bundlet_cmd to quoted form of bash_bundlet\n\t\t\tset cmd to my joiner({bash_bundlet_cmd, \"utility\", _name, _version, _json}, space)\n\t\t\tset cmd to my prepare_cmd(cmd)\n\t\t\tmy logger(\"utility\", \"INFO\", my formatter(\"Running shell command: `{}`...\", cmd))\n\t\t\tset full_path to (do shell script cmd)\n\t\t\treturn full_path\n\t\telse\n\t\t\tset error_msg to my logger(\"utility\", \"DEBUG\", my formatter(\"Internal bash bundlet `{}` does not exist.\", bash_bundlet))\n\t\t\terror error_msg number 1\n\t\t\t--##TODO: need a stable error number schema\n\t\tend if\n\telse\n\t\t--# if utility is already installed\n\t\tmy logger(\"utility\", \"INFO\", my formatter(\"Utility at `{}` found...\", utility))\n\t\t--# read utilities invoke file\n\t\tset invoke_file to utility & \"\/invoke\"\n\t\tif my file_exists(invoke_file) = true then\n\t\t\tset invoke_path to my read_file(invoke_file)\n\t\t\t--# combine utility path with invoke path\n\t\t\tset full_path to utility & \"\/\" & invoke_path\n\t\t\treturn full_path\n\t\telse\n\t\t\tset error_msg to my logger(\"utility\", \"DEBUG\", my formatter(\"Internal invoke file `{}` does not exist.\", invoke_file))\n\t\t\terror error_msg number 1\n\t\t\t--##TODO: need a stable error number schema\n\t\tend if\n\tend if\nend utility\n\n\non icon(_font, _name, _color, _alter)\n\t--# partial support for \"optional\" args in Applescript\n\tif my is_empty(_color) then\n\t\tset _color to \"000000\"\n\t\tif my is_empty(_alter) then\n\t\t\tset _alter to true\n\t\tend if\n\tend if\n\tif my is_empty(_alter) then\n\t\tset _alter to false\n\tend if\n\t--# path to specific icon\n\tset icon to my joiner({ICONS_DIR, _font, _color, _name}, \"\/\")\n\tif my folder_exists(icon) = false then\n\t\t--# if icon isn't already installed\n\t\tmy logger(\"icon\", \"INFO\", my formatter(\"Icon at `{}` not found...\", icon))\n\t\tset bash_bundlet to (my dirname(AS_BUNDLER)) & \"bundlets\/alfred.bundler.sh\"\n\t\tif my file_exists(bash_bundlet) = true then\n\t\t\tset bash_bundlet_cmd to quoted form of bash_bundlet\n\t\t\tset cmd to my joiner({bash_bundlet_cmd, \"icon\", _font, _name, _color, _alter}, space)\n\t\t\tset cmd to my prepare_cmd(cmd)\n\t\t\tmy logger(\"icon\", \"INFO\", my formatter(\"Running shell command: `{}`...\", cmd))\n\t\t\tset full_path to (do shell script cmd)\n\t\telse\n\t\t\tset error_msg to my logger(\"icon\", \"DEBUG\", my formatter(\"Internal bash bundlet `{}` does not exist.\", bash_bundlet))\n\t\t\terror error_msg number 1\n\t\t\t--##TODO: need a stable error number schema\n\t\tend if\n\telse\n\t\t--# if icon is already installed\n\t\tmy logger(\"icon\", \"INFO\", my formatter(\"Icon at `{}` found...\", icon))\n\t\treturn icon\n\tend if\nend icon\n\n\n\n(* \/\/\/\nLOGGING HANDLER\n\/\/\/ *)\n\non logger(_handler, _level, _message)\n\t--# Ensure log file exists, with\n\t--# checking for scope of global var\n\ttry\n\t\tmy check_file(BUNDLER_LOGFILE)\n\ton error\n\t\tset BUNDLER_LOGFILE to my formatter((DATA_DIR & \"\/logs\/bundler-{}.log\"), BUNDLER_VERSION)\n\t\tmy check_file(BUNDLER_LOGFILE)\n\tend try\n\tdelay 0.1 -- delay to ensure IO action is completed\n\t--# Prepare time string format %Y-%m-%d %H:%M:%S\n\tset log_time to \"[\" & (my date_formatter()) & \"]\"\n\tset formatterted_time to text items 1 thru -4 of (time string of (current date)) as string\n\tset error_time to \"[\" & formatterted_time & \"]\"\n\t--# Prepare location message\n\tset _location to \"[bundler.scpt:\" & _handler & \"]\"\n\t--# Prepare level message\n\tset _level to \"[\" & _level & \"]\"\n\t--# Generate full error message for logging\n\tset log_msg to (my joiner({log_time, _location, _level, _message}, space)) & (ASCII character 10)\n\tmy write_to_file(log_msg, BUNDLER_LOGFILE, true)\n\t--# Generate regular error message for returning to user\n\tset error_msg to error_time & space & _location & space & _level & space & _message\n\treturn error_msg\nend logger\n\n(* \/\/\/\nSUB-ACTION HANDLERS\n\/\/\/ *)\n\non date_formatter()\n\tset {year:y, month:m, day:d} to current date\n\tset date_num to (y * 10000 + m * 100 + d) as string\n\tset formatterted_date to ((text 1 thru 4 of date_num) & \"-\" & (text 5 thru 6 of date_num) & \"-\" & (text 7 thru 8 of date_num))\n\tset formatterted_time to text items 1 thru -4 of (time string of (current date)) as string\n\treturn formatterted_date & space & formatterted_time\nend date_formatter\n\non read_file(target_file)\n\topen for access POSIX file target_file\n\tset _contents to (read target_file)\n\tclose access target_file\n\treturn _contents\nend read_file\n\non prepare_cmd(cmd)\n\tset pwd to quoted form of (my _pwd())\n\treturn \"cd \" & pwd & \"; bash \" & cmd\nend prepare_cmd\n\n\n(* \/\/\/\nIO HELPER FUNCTIONS\n\/\/\/ *)\n\non write_to_file(this_data, target_file, append_data)\n\ttry\n\t\tset the target_file to the target_file as string\n\t\tset the open_target_file to open for access POSIX file target_file with write permission\n\t\tif append_data is false then set eof of the open_target_file to 0\n\t\twrite this_data to the open_target_file starting at eof\n\t\tclose access the open_target_file\n\t\treturn true\n\ton error\n\t\ttry\n\t\t\tclose access file target_file\n\t\tend try\n\t\treturn false\n\tend try\nend write_to_file\n\n--# \non pwd()\n\tset {ASTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, \"\/\"}\n\tset _path to (text items 1 thru -2 of (POSIX path of (path to me)) as string) & \"\/\"\n\tset AppleScript's text item delimiters to ASTID\n\treturn _path\nend pwd\n\non dirname(_file)\n\tset {ASTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, \"\/\"}\n\tset _path to (text items 1 thru -2 of _file as string) & \"\/\"\n\tset AppleScript's text item delimiters to ASTID\n\treturn _path\nend dirname\n\non check_dir(_folder)\n\tif not my folder_exists(_folder) then\n\t\tdo shell script \"mkdir -p \" & (quoted form of _folder)\n\tend if\n\treturn _folder\nend check_dir\n\non check_file(_path)\n\tif not my file_exists(_path) then\n\t\tset _dir to dirname(_path)\n\t\tmy check_dir(_dir)\n\t\tdelay 0.1\n\t\tdo shell script \"touch \" & (quoted form of _path)\n\tend if\nend check_file\n\n--#  handler to check if a folder exists\non folder_exists(_folder)\n\tif my path_exists(_folder) then\n\t\ttell application \"System Events\"\n\t\t\treturn (class of (disk item _folder) is folder)\n\t\tend tell\n\tend if\n\treturn false\nend folder_exists\n\n--# handler to check if a file exists\non file_exists(_file)\n\tif my path_exists(_file) then\n\t\ttell application \"System Events\"\n\t\t\treturn (class of (disk item _file) is file)\n\t\tend tell\n\tend if\n\treturn false\nend file_exists\n\n--#  handler to check if a path exists\non path_exists(_path)\n\tif _path is missing value or my is_empty(_path) then return false\n\t\n\ttry\n\t\tif class of _path is alias then return true\n\t\tif _path contains \":\" then\n\t\t\talias _path\n\t\t\treturn true\n\t\telse if _path contains \"\/\" then\n\t\t\tPOSIX file _path as alias\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend if\n\ton error msg\n\t\treturn false\n\tend try\nend path_exists\n\n(* \/\/\/\nTEXT HELPER FUNCTIONS\n\/\/\/ *)\n\non split(str, delimiter)\n\tlocal delimiter, str, ASTID\n\tset ASTID to AppleScript's text item delimiters\n\ttry\n\t\tset AppleScript's text item delimiters to delimiter\n\t\tset str to text items of str\n\t\tset AppleScript's text item delimiters to ASTID\n\t\treturn str --> list\n\ton error msg number num\n\t\tset AppleScript's text item delimiters to ASTID\n\t\terror \"Can't explode: \" & msg number num\n\tend try\nend split\n\n--# format string \u00e1 la Python\non formatter(str, arg)\n\tlocal ASTID, str, arg, lst\n\tset ASTID to AppleScript's text item delimiters\n\ttry\n\t\tconsidering case\n\t\t\tset AppleScript's text item delimiters to \"{}\"\n\t\t\tset lst to every text item of str\n\t\t\tset AppleScript's text item delimiters to arg\n\t\t\tset str to lst as string\n\t\tend considering\n\t\tset AppleScript's text item delimiters to ASTID\n\t\treturn str\n\ton error msg number num\n\t\tset AppleScript's text item delimiters to ASTID\n\t\terror \"Can't replaceString: \" & msg number num\n\tend try\nend formatter\n\n--# removes white space surrounding a string\non trim(str)\n\tif class of str is not text or class of str is not string or str is missing value then return str\n\tif str is \"\" then return str\n\trepeat while str begins with \" \"\n\t\ttry\n\t\t\tset str to items 2 thru -1 of str as text\n\t\ton error msg\n\t\t\treturn \"\"\n\t\tend try\n\tend repeat\n\trepeat while str ends with \" \"\n\t\ttry\n\t\t\tset str to items 1 thru -2 of str as text\n\t\ton error\n\t\t\treturn \"\"\n\t\tend try\n\tend repeat\n\treturn str\nend trim\n\non joiner(pieces, delim)\n\tlocal delim, pieces, ASTID\n\tset ASTID to AppleScript's text item delimiters\n\ttry\n\t\tset AppleScript's text item delimiters to delim\n\t\tset pieces to \"\" & pieces\n\t\tset AppleScript's text item delimiters to ASTID\n\t\treturn pieces --> text\n\ton error emsg number eNum\n\t\tset AppleScript's text item delimiters to ASTID\n\t\terror \"Can't implode: \" & emsg number eNum\n\tend try\nend joiner\n\n(* \/\/\/\nLOWER LEVEL HELPER FUNCTIONS\n\/\/\/ *)\n\n--# checks if a value is empty\non is_empty(str)\n\tif {true, false} contains str then return false\n\tif str is missing value then return true\n\treturn length of (my trim(str)) is 0\nend is_empty\n\n--TESTING!!\non test()\n\tset as_pwd to POSIX path of (path to me) as string\n\tset pwd to quoted form of my dirname(as_pwd)\n\tset cmd to quoted form of \"\/Users\/smargheim\/Documents\/DEVELOPMENT\/GitHub\/alfred-bundler\/bundler\/bundlets\/TEST.sh\"\n\tset sh_pwd to do shell script \"cd \" & pwd & \"; bash \" & cmd\n\treturn \"Applescript PWD: \" & as_pwd & return & \"Shell PWD: \" & sh_pwd\nend test","new_contents":"(* GLOBAL PROPERTIES \n\n&& $? for bash status codes\n\n*)\nproperty BUNDLER_VERSION : \"devel\"\n--# Bundler paths\nproperty _home : POSIX path of (path to \"cusr\" as text)\nproperty BUNDLER_DIR : (_home) & \"Library\/Application Support\/Alfred 2\/Workflow Data\/alfred.bundler-\" & BUNDLER_VERSION\nproperty DATA_DIR : BUNDLER_DIR & \"\/data\"\nproperty CACHE_DIR : (_home) & \"Library\/Caches\/com.runningwithcrayons.Alfred-2\/Workflow Data\/alfred.bundler-\" & BUNDLER_VERSION\n--# Main Applescript Bundler\nproperty AS_BUNDLER : BUNDLER_DIR & \"\/bundler\/AlfredBundler.scpt\"\n--# Root directory under which workflow-specific applescript libraries are installed\nproperty APPLESCRIPT_DIR : DATA_DIR & \"\/assets\/applescript\"\n--# Root directory under which Bundler utilities are installed\nproperty UTILITIES_DIR : DATA_DIR & \"\/assets\/utility\"\n--# Directory for Bundler icons\nproperty ICONS_DIR : DATA_DIR & \"\/assets\/icons\"\n--# Where color alternatives are cached\nproperty COLOR_CACHE : DATA_DIR & \"\/color-cache\"\n\n(* GLOBAL VARIABLES *)\n\n--# Where installer.sh can be downloaded from\nglobal BASH_BUNDLET_URL\nset BASH_BUNDLET_URL to my formatter(\"https:\/\/raw.githubusercontent.com\/shawnrice\/alfred-bundler\/{}\/bundler\/bundlets\/alfred.bundler.sh\", BUNDLER_VERSION)\n\n--# Bundler log file\nglobal BUNDLER_LOGFILE\nset BUNDLER_LOGFILE to my formatter((DATA_DIR & \"\/logs\/bundler-{}.log\"), BUNDLER_VERSION)\n\n\n(* \/\/\/\nUSER API\n\/\/\/ *)\n\non utility(_name, _version, _json)\n\t--# partial support for \"optional\" args in Applescript\n\tif my is_empty(_version) then\n\t\tset _version to \"latest\"\n\tend if\n\tif my is_empty(_json) then\n\t\tset _json to \"\"\n\tend if\n\t--# path to specific utility\n\tset utility to my joiner({UTILITIES_DIR, _name, _version}, \"\/\")\n\tif my folder_exists(utility) = false then\n\t\t--# if utility isn't already installed\n\t\tmy logger(\"utility\", \"INFO\", my formatter(\"Utility at `{}` not found...\", utility))\n\t\tset bash_bundlet to (my dirname(AS_BUNDLER)) & \"bundlets\/alfred.bundler.sh\"\n\t\tif my file_exists(bash_bundlet) = true then\n\t\t\tset bash_bundlet_cmd to quoted form of bash_bundlet\n\t\t\tset cmd to my joiner({bash_bundlet_cmd, \"utility\", _name, _version, _json}, space)\n\t\t\tset cmd to my prepare_cmd(cmd)\n\t\t\tmy logger(\"utility\", \"INFO\", my formatter(\"Running shell command: `{}`...\", cmd))\n\t\t\tset full_path to (do shell script cmd)\n\t\t\treturn full_path\n\t\telse\n\t\t\tset error_msg to my logger(\"utility\", \"DEBUG\", my formatter(\"Internal bash bundlet `{}` does not exist.\", bash_bundlet))\n\t\t\terror error_msg number 1\n\t\t\t--##TODO: need a stable error number schema\n\t\tend if\n\telse\n\t\t--# if utility is already installed\n\t\tmy logger(\"utility\", \"INFO\", my formatter(\"Utility at `{}` found...\", utility))\n\t\t--# read utilities invoke file\n\t\tset invoke_file to utility & \"\/invoke\"\n\t\tif my file_exists(invoke_file) = true then\n\t\t\tset invoke_path to my _read_file(invoke_file)\n\t\t\t--# combine utility path with invoke path\n\t\t\tset full_path to utility & \"\/\" & invoke_path\n\t\t\treturn full_path\n\t\telse\n\t\t\tset error_msg to my logger(\"utility\", \"DEBUG\", my formatter(\"Internal invoke file `{}` does not exist.\", invoke_file))\n\t\t\terror error_msg number 1\n\t\t\t--##TODO: need a stable error number schema\n\t\tend if\n\tend if\nend utility\n\n\non icon(_font, _name, _color, _alter)\n\t--# partial support for \"optional\" args in Applescript\n\tif my is_empty(_color) then\n\t\tset _color to \"000000\"\n\t\tif my is_empty(_alter) then\n\t\t\tset _alter to true\n\t\tend if\n\tend if\n\tif my is_empty(_alter) then\n\t\tset _alter to false\n\tend if\n\t--# path to specific icon\n\tset icon to my joiner({ICONS_DIR, _font, _color, _name}, \"\/\")\n\tif my folder_exists(icon) = false then\n\t\t--# if icon isn't already installed\n\t\tmy logger(\"icon\", \"INFO\", my formatter(\"Icon at `{}` not found...\", icon))\n\t\tset bash_bundlet to (my dirname(AS_BUNDLER)) & \"bundlets\/alfred.bundler.sh\"\n\t\tif my file_exists(bash_bundlet) = true then\n\t\t\tset bash_bundlet_cmd to quoted form of bash_bundlet\n\t\t\tset cmd to my joiner({bash_bundlet_cmd, \"icon\", _font, _name, _color, _alter}, space)\n\t\t\tset cmd to my prepare_cmd(cmd)\n\t\t\tmy logger(\"icon\", \"INFO\", my formatter(\"Running shell command: `{}`...\", cmd))\n\t\t\tset full_path to (do shell script cmd)\n\t\telse\n\t\t\tset error_msg to my logger(\"icon\", \"DEBUG\", my formatter(\"Internal bash bundlet `{}` does not exist.\", bash_bundlet))\n\t\t\terror error_msg number 1\n\t\t\t--##TODO: need a stable error number schema\n\t\tend if\n\telse\n\t\t--# if icon is already installed\n\t\tmy logger(\"icon\", \"INFO\", my formatter(\"Icon at `{}` found...\", icon))\n\t\treturn icon\n\tend if\nend icon\n\n\n\n(* \/\/\/\nLOGGING HANDLER\n\/\/\/ *)\n\non logger(_handler, _level, _message)\n\t--# Ensure log file exists, with\n\t--# checking for scope of global var\n\ttry\n\t\tmy check_file(BUNDLER_LOGFILE)\n\ton error\n\t\tset BUNDLER_LOGFILE to my formatter((DATA_DIR & \"\/logs\/bundler-{}.log\"), BUNDLER_VERSION)\n\t\tmy check_file(BUNDLER_LOGFILE)\n\tend try\n\tdelay 0.1 -- delay to ensure IO action is completed\n\t--# Prepare time string format %Y-%m-%d %H:%M:%S\n\tset log_time to \"[\" & (my date_formatter()) & \"]\"\n\tset formatterted_time to text items 1 thru -4 of (time string of (current date)) as string\n\tset error_time to \"[\" & formatterted_time & \"]\"\n\t--# Prepare location message\n\tset _location to \"[bundler.scpt:\" & _handler & \"]\"\n\t--# Prepare level message\n\tset _level to \"[\" & _level & \"]\"\n\t--# Generate full error message for logging\n\tset log_msg to (my joiner({log_time, _location, _level, _message}, space)) & (ASCII character 10)\n\tmy write_to_file(log_msg, BUNDLER_LOGFILE, true)\n\t--# Generate regular error message for returning to user\n\tset error_msg to error_time & space & _location & space & _level & space & _message\n\treturn error_msg\nend logger\n\n(* \/\/\/\nSUB-ACTION HANDLERS\n\/\/\/ *)\n\non date_formatter()\n\tset {year:y, month:m, day:d} to current date\n\tset date_num to (y * 10000 + m * 100 + d) as string\n\tset formatterted_date to ((text 1 thru 4 of date_num) & \"-\" & (text 5 thru 6 of date_num) & \"-\" & (text 7 thru 8 of date_num))\n\tset formatterted_time to text items 1 thru -4 of (time string of (current date)) as string\n\treturn formatterted_date & space & formatterted_time\nend date_formatter\n\non _read_file(target_file)\n\topen for access POSIX file target_file\n\tset _contents to (read target_file)\n\tclose access target_file\n\treturn _contents\nend _read_file\n\non prepare_cmd(cmd)\n\tset pwd to quoted form of (my pwd())\n\treturn \"cd \" & pwd & \"; bash \" & cmd\nend prepare_cmd\n\n\n(* \/\/\/\nIO HELPER FUNCTIONS\n\/\/\/ *)\n\non write_to_file(this_data, target_file, append_data)\n\ttry\n\t\tset the target_file to the target_file as string\n\t\tset the open_target_file to open for access POSIX file target_file with write permission\n\t\tif append_data is false then set eof of the open_target_file to 0\n\t\twrite this_data to the open_target_file starting at eof\n\t\tclose access the open_target_file\n\t\treturn true\n\ton error\n\t\ttry\n\t\t\tclose access file target_file\n\t\tend try\n\t\treturn false\n\tend try\nend write_to_file\n\n--# \non pwd()\n\tset {ASTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, \"\/\"}\n\tset _path to (text items 1 thru -2 of (POSIX path of (path to me)) as string) & \"\/\"\n\tset AppleScript's text item delimiters to ASTID\n\treturn _path\nend pwd\n\non dirname(_file)\n\tset {ASTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, \"\/\"}\n\tset _path to (text items 1 thru -2 of _file as string) & \"\/\"\n\tset AppleScript's text item delimiters to ASTID\n\treturn _path\nend dirname\n\non check_dir(_folder)\n\tif not my folder_exists(_folder) then\n\t\tdo shell script \"mkdir -p \" & (quoted form of _folder)\n\tend if\n\treturn _folder\nend check_dir\n\non check_file(_path)\n\tif not my file_exists(_path) then\n\t\tset _dir to dirname(_path)\n\t\tmy check_dir(_dir)\n\t\tdelay 0.1\n\t\tdo shell script \"touch \" & (quoted form of _path)\n\tend if\nend check_file\n\n--#  handler to check if a folder exists\non folder_exists(_folder)\n\tif my path_exists(_folder) then\n\t\ttell application \"System Events\"\n\t\t\treturn (class of (disk item _folder) is folder)\n\t\tend tell\n\tend if\n\treturn false\nend folder_exists\n\n--# handler to check if a file exists\non file_exists(_file)\n\tif my path_exists(_file) then\n\t\ttell application \"System Events\"\n\t\t\treturn (class of (disk item _file) is file)\n\t\tend tell\n\tend if\n\treturn false\nend file_exists\n\n--#  handler to check if a path exists\non path_exists(_path)\n\tif _path is missing value or my is_empty(_path) then return false\n\t\n\ttry\n\t\tif class of _path is alias then return true\n\t\tif _path contains \":\" then\n\t\t\talias _path\n\t\t\treturn true\n\t\telse if _path contains \"\/\" then\n\t\t\tPOSIX file _path as alias\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend if\n\ton error msg\n\t\treturn false\n\tend try\nend path_exists\n\n(* \/\/\/\nTEXT HELPER FUNCTIONS\n\/\/\/ *)\n\non split(str, delimiter)\n\tlocal delimiter, str, ASTID\n\tset ASTID to AppleScript's text item delimiters\n\ttry\n\t\tset AppleScript's text item delimiters to delimiter\n\t\tset str to text items of str\n\t\tset AppleScript's text item delimiters to ASTID\n\t\treturn str --> list\n\ton error msg number num\n\t\tset AppleScript's text item delimiters to ASTID\n\t\terror \"Can't explode: \" & msg number num\n\tend try\nend split\n\n--# format string \u00e1 la Python\non formatter(str, arg)\n\tlocal ASTID, str, arg, lst\n\tset ASTID to AppleScript's text item delimiters\n\ttry\n\t\tconsidering case\n\t\t\tset AppleScript's text item delimiters to \"{}\"\n\t\t\tset lst to every text item of str\n\t\t\tset AppleScript's text item delimiters to arg\n\t\t\tset str to lst as string\n\t\tend considering\n\t\tset AppleScript's text item delimiters to ASTID\n\t\treturn str\n\ton error msg number num\n\t\tset AppleScript's text item delimiters to ASTID\n\t\terror \"Can't replaceString: \" & msg number num\n\tend try\nend formatter\n\n--# removes white space surrounding a string\non trim(str)\n\tif class of str is not text or class of str is not string or str is missing value then return str\n\tif str is \"\" then return str\n\trepeat while str begins with \" \"\n\t\ttry\n\t\t\tset str to items 2 thru -1 of str as text\n\t\ton error msg\n\t\t\treturn \"\"\n\t\tend try\n\tend repeat\n\trepeat while str ends with \" \"\n\t\ttry\n\t\t\tset str to items 1 thru -2 of str as text\n\t\ton error\n\t\t\treturn \"\"\n\t\tend try\n\tend repeat\n\treturn str\nend trim\n\non joiner(pieces, delim)\n\tlocal delim, pieces, ASTID\n\tset ASTID to AppleScript's text item delimiters\n\ttry\n\t\tset AppleScript's text item delimiters to delim\n\t\tset pieces to \"\" & pieces\n\t\tset AppleScript's text item delimiters to ASTID\n\t\treturn pieces --> text\n\ton error emsg number eNum\n\t\tset AppleScript's text item delimiters to ASTID\n\t\terror \"Can't implode: \" & emsg number eNum\n\tend try\nend joiner\n\n(* \/\/\/\nLOWER LEVEL HELPER FUNCTIONS\n\/\/\/ *)\n\n--# checks if a value is empty\non is_empty(str)\n\tif {true, false} contains str then return false\n\tif str is missing value then return true\n\treturn length of (my trim(str)) is 0\nend is_empty\n\n--TESTING!!\non test()\n\tset as_pwd to POSIX path of (path to me) as string\n\tset pwd to quoted form of my dirname(as_pwd)\n\tset cmd to quoted form of \"\/Users\/smargheim\/Documents\/DEVELOPMENT\/GitHub\/alfred-bundler\/bundler\/bundlets\/TEST.sh\"\n\tset sh_pwd to do shell script \"cd \" & pwd & \"; bash \" & cmd\n\treturn \"Applescript PWD: \" & as_pwd & return & \"Shell PWD: \" & sh_pwd\nend test","subject":"change `_read_file` to `read_file`","message":"change `_read_file` to `read_file`\n","lang":"AppleScript","license":"mit","repos":"shawnrice\/alfred-bundler,shawnrice\/alfred-bundler,shawnrice\/alfred-bundler,shawnrice\/alfred-bundler,shawnrice\/alfred-bundler"}
{"commit":"48299cd8e44a71d039b0009e2fef1cf0f2d8a480","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes XML reserved characters in the given string\non encodeXmlChars(theString)\n\n\tset theString to replace(\"&\", \"&amp;\", theString)\n\tset theString to replace(\"<\", \"&lt;\", theString)\n\tset theString to replace(\">\", \"&gt;\", theString)\n\tset theString to replace(\"\\\"\", \"&quot;\", theString)\n\tset theString to replace(\"'\", \"&apos;\", theString)\n\treturn theString\n\nend encodeXmlChars\n\n-- decodes XML reserved characters in the given string\non decodeXmlChars(theString)\n\n\tset theString to replace(\"&amp;\", \"&\", theString)\n\tset theString to replace(\"&lt;\", \"<\", theString)\n\tset theString to replace(\"&gt;\", \">\", theString)\n\tset theString to replace(\"&quot;\", \"\\\"\", theString)\n\tset theString to replace(\"&apos;\", \"'\", theString)\n\treturn theString\n\nend decodeXmlChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as XML\non getResultXml(theResult)\n\n\t-- encode reserved XML characters\n\tset resultUid to encodeXmlChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeXmlChars(title of theResult)\n\tset resultSubtitle to encodeXmlChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeXmlChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset xml to \"<item uid='\" & resultUid & \"' arg='\" & resultUid & \"' valid='\" & resultValid & \"'>\"\n\tset xml to xml & \"<title>\" & resultTitle & \"<\/title>\"\n\tset xml to xml & \"<subtitle>\" & resultSubtitle & \"<\/subtitle>\"\n\tset xml to xml & \"<icon>\" & resultIcon & \"<\/icon>\"\n\tset xml to xml & \"<\/item>\"\n\treturn xml\n\nend getResultXml\n\n-- retrieves XML document for Alfred results\non getResultListXml()\n\n\tset xml to \"<?xml version='1.0'?><items>\"\n\n\trepeat with theResult in resultList\n\n\t\tset xml to xml & getResultXml(theResult)\n\n\tend repeat\n\n\tset xml to xml & \"<\/items>\"\n\treturn xml\n\nend getResultListXml\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\ttry\n\n\t\tset fileRef to open for access theFile with write permission\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\n\ton error\n\n\t\tclose access fileRef\n\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\n-- brings queue into view in iTunes window\non focusQueue()\n\n\ttell application \"iTunes\"\n\n\t\treveal user playlist workflowPlaylistName\n\n\tend tell\n\nend focusQueue\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to first user playlist whose id is playlistId\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif disc number of theSong is discIndex and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeXmlChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeXmlChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeXmlChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\n\tfocusQueue()\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tfocusQueue()\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes XML reserved characters in the given string\non encodeXmlChars(theString)\n\n\tset theString to replace(\"&\", \"&amp;\", theString)\n\tset theString to replace(\"<\", \"&lt;\", theString)\n\tset theString to replace(\">\", \"&gt;\", theString)\n\tset theString to replace(\"\\\"\", \"&quot;\", theString)\n\tset theString to replace(\"'\", \"&apos;\", theString)\n\treturn theString\n\nend encodeXmlChars\n\n-- decodes XML reserved characters in the given string\non decodeXmlChars(theString)\n\n\tset theString to replace(\"&amp;\", \"&\", theString)\n\tset theString to replace(\"&lt;\", \"<\", theString)\n\tset theString to replace(\"&gt;\", \">\", theString)\n\tset theString to replace(\"&quot;\", \"\\\"\", theString)\n\tset theString to replace(\"&apos;\", \"'\", theString)\n\treturn theString\n\nend decodeXmlChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as XML\non getResultXml(theResult)\n\n\t-- encode reserved XML characters\n\tset resultUid to encodeXmlChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeXmlChars(title of theResult)\n\tset resultSubtitle to encodeXmlChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeXmlChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset xml to \"<item uid='\" & resultUid & \"' arg='\" & resultUid & \"' valid='\" & resultValid & \"'>\"\n\tset xml to xml & \"<title>\" & resultTitle & \"<\/title>\"\n\tset xml to xml & \"<subtitle>\" & resultSubtitle & \"<\/subtitle>\"\n\tset xml to xml & \"<icon>\" & resultIcon & \"<\/icon>\"\n\tset xml to xml & \"<\/item>\"\n\treturn xml\n\nend getResultXml\n\n-- retrieves XML document for Alfred results\non getResultListXml()\n\n\tset xml to \"<?xml version='1.0'?><items>\"\n\n\trepeat with theResult in resultList\n\n\t\tset xml to xml & getResultXml(theResult)\n\n\tend repeat\n\n\tset xml to xml & \"<\/items>\"\n\treturn xml\n\nend getResultListXml\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\n-- brings queue into view in iTunes window\non focusQueue()\n\n\ttell application \"iTunes\"\n\n\t\treveal user playlist workflowPlaylistName\n\n\tend tell\n\nend focusQueue\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to first user playlist whose id is playlistId\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif disc number of theSong is discIndex and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeXmlChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeXmlChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeXmlChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\n\tfocusQueue()\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tfocusQueue()\n\tplayQueue()\n\nend play\n","subject":"Move fileRef outside of try (where it can be accessed)","message":"Move fileRef outside of try (where it can be accessed)\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"c7bc373763eb24309ac63966ae3788ffba33b822","old_file":"Extras\/GrowlTunes\/Scripts\/jackItunesArtwork.scpt","new_file":"Extras\/GrowlTunes\/Scripts\/jackItunesArtwork.scpt","old_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0002l\u0000\u0002\u0000\u0000\u0000H\u0000\u0007\r\u0000\u0007\u0000\u0003Q\u0000\u0000\u0000\u0000\u0000H\u0000\b\u0000\t\u0000\n\r\u0000\b\u0000\u0002O\u0000\u0000\u0000\u0003\u0000=\u0000\u000b\u0000\f\r\u0000\u000b\u0000\u0001k\u0000\u0000\u0000\u0007\u0000<\u0000\r\u0002\u0000\r\u0000\u0002\u0000\u000e\u0000\u000f\r\u0000\u000e\u0000\u0002r\u0000\u0000\u0000\u0007\u0000\n\u0000\u0010\u0000\u0011\r\u0000\u0010\u0000\u0001m\u0000\u0000\u0000\u0007\u0000\b\u0000\u0012\f\u0000\u0012\u0000\n\u0000\u0004fsck\u0000\u0002\u0000\u0000\r\u0000\u0011\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\u0002\u0000\u000f\u0000\u0002\u0000\u0013\u0000\u0014\r\u0000\u0013\u0000\u0002r\u0000\u0000\u0000\u000b\u0000\u0012\u0000\u0015\u0000\u0016\r\u0000\u0015\u0000\u0002n\u0000\u0000\u0000\u000b\u0000\u0010\u0000\u0017\u0000\u0018\r\u0000\u0017\u0000\u00011\u0000\u0000\u0000\u000e\u0000\u0010\n\u0000\u0004\npnam\r\u0000\u0018\u0000\u00011\u0000\u0000\u0000\u000b\u0000\u000e\n\u0000\u0004\npPla\r\u0000\u0016\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00140\u0000\balibrary\u0000\baLibrary\u0002\u0000\u0014\u0000\u0002\u0000\u0019\u0000\u001a\r\u0000\u0019\u0000\u0002r\u0000\u0000\u0000\u0013\u0000\u0018\u0000\u001b\u0000\u001c\r\u0000\u001b\u0000\u00011\u0000\u0000\u0000\u0013\u0000\u0016\n\u0000\u0004\npTrk\r\u0000\u001c\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00100\u0000\u0006atrack\u0000\u0006aTrack\u0002\u0000\u001a\u0000\u0002\u0000\u001d\u0000\u001e\r\u0000\u001d\u0000\u0002r\u0000\u0000\u0000\u0019\u0000\u001c\u0000\u001f\u0000 \r\u0000\u001f\u0000\u0001m\u0000\u0000\u0000\u0019\u0000\u001a\n\u0000\u0004\nnull\r\u0000 \u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001e0\u0000\ratrackartwork\u0000\raTrackArtwork\u0002\u0000\u001e\u0000\u0002\u0000!\u0000\"\r\u0000!\u0000\u0004Z\u0000\u0000\u0000\u001d\u00005\u0000#\u0000$\r\u0000#\u0000\u0002@\u0000\u0000\u0000\u001d\u0000&\u0000%\u0000&\r\u0000%\u0000\u0002l\u0000\u0005\u0000\u001d\u0000$\u0000'\r\u0000'\u0000\u0003I\u0000\u0001\u0000\u001d\u0000$\u0000(\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\r\u0000(\u0000\u0002n\u0000\u0000\u0000\u001d\u0000 \u0000)\u0000*\r\u0000)\u0000\u0001m\u0000\u0000\u0000\u001e\u0000 \n\u0000\u0004\ncArt\r\u0000*\u0000\u0001o\u0000\u0000\u0000\u001d\u0000\u001e\u000b\u0000\u00100\u0000\u0006atrack\u0000\u0006aTrack\u0002\u0000\u0000\u0001\u0000\u0000\r\u0000&\u0000\u0001m\u0000\u0000\u0000$\u0000%\u0003\u0000\u0001\r\u0000$\u0000\u0002r\u0000\u0000\u0000)\u00001\u0000+\u0000,\r\u0000+\u0000\u0002n\u0000\u0000\u0000)\u0000\/\u0000-\u0000.\r\u0000-\u0000\u00011\u0000\u0000\u0000-\u0000\/\n\u0000\u0004\npPCT\r\u0000.\u0000\u0002n\u0000\u0000\u0000)\u0000-\u0000\/\u00000\r\u0000\/\u0000\u00024\u0000\u0000\u0000*\u0000-\u00001\n\u0000\u0004\ncArt\r\u00001\u0000\u0001m\u0000\u0000\u0000+\u0000,\u0003\u0000\u0001\r\u00000\u0000\u0001o\u0000\u0000\u0000)\u0000*\u000b\u0000\u00100\u0000\u0006atrack\u0000\u0006aTrack\r\u0000,\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001e0\u0000\ratrackartwork\u0000\raTrackArtwork\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\"\u0000\u0002\u00002\r\u00002\u0000\u0002r\u0000\u0000\u00006\u0000<\u00003\u00004\r\u00003\u0000\u0001J\u0000\u0000\u00006\u0000:\u00005\u0002\u00005\u0000\u0002\u00006\u00007\r\u00006\u0000\u0001o\u0000\u0000\u00006\u00007\u000b\u0000\u001e0\u0000\ratrackartwork\u0000\raTrackArtwork\u0002\u00007\u0000\u0002\u00008\r\u00008\u0000\u0001o\u0000\u0000\u00007\u00008\u000b\u0000\u00140\u0000\balibrary\u0000\baLibrary\u0002\u0000\u0000\r\u00004\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\u0002\u0000\u0000\r\u0000\f\u0000\u0001m\u0000\u0000\u0000\u0003\u0000\u0004\u00009\u000f\u00009\u0001\bnull\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0005:\niTunes.app0\u00000\b\u00007\u0010`\u00002\u00000$\u0000\u0000\u0000)\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000e\u0002\u0002|(\u0007 \u07c0\u0000hook\u0000\u0000\u0011\u0000alis\u0000\u0000\u0000\u0000\u0001>\u0000\u0002\u0000\u0001\u0007Saulire\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000H+\u0000\u0000\u0000\u0000\u0005:\niTunes.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\/\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fApplications\u0000\u0010\u0000\b\u0000\u0000M\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0005:\u0000\u0002\u0000\u001fSaulire:Applications:iTunes.app\u0000\u0000\u000e\u0000\u0016\u0000\n\u0000i\u0000T\u0000u\u0000n\u0000e\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u0010\u0000\u0007\u0000S\u0000a\u0000u\u0000l\u0000i\u0000r\u0000e\u0000\u0012\u0000\u0017Applications\/iTunes.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\r\u0000\t\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000\n\u0000\u0002r\u0000\u0000\u0000E\u0000H\u0000:\u0000;\r\u0000:\u0000\u0001m\u0000\u0000\u0000E\u0000F\u0000<\f\u0000<\u0000\n\u0000\u0004fsck\u0000\u0002\u0000\u0000\r\u0000;\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\u0001\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000=\u0000>\r\u0000=\u0000\u0002l\u0000\u0002\u0000I\u0000K\u0000?\r\u0000?\u0000\u0001L\u0000\u0000\u0000I\u0000K\u0000@\r\u0000@\u0000\u0001o\u0000\u0000\u0000I\u0000J\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\u0001\u0000\u0000\u0002\u0000>\u0000\u0002\u0000A\r\u0000A\u0000\u0002l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0003\u0000B\u0000C\u0001\u0000\u0000\u0010\u0000B\u0000\u0001\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000e\u0000C\u0000\u0007\u0010\u0000D\u0000E\u0000F\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000D\u0000\u0001k\u0000\u0000\u0000\u0000\u0000K\u0000G\u0002\u0000G\u0000\u0002\u0000\u0005\u0000H\u0002\u0000H\u0000\u0002\u0000=\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000E\u0000\u0000\u0010\u0000F\u0000\u0010\u00009\u0000\u0012\u0000<\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\n\u0000\u0004\npPla\n\u0000\u0004\npnam\u000b\u0000\u00140\u0000\balibrary\u0000\baLibrary\n\u0000\u0004\npTrk\u000b\u0000\u00100\u0000\u0006atrack\u0000\u0006aTrack\n\u0000\u0004\nnull\u000b\u0000\u001e0\u0000\ratrackartwork\u0000\raTrackArtwork\n\u0000\u0004\ncArt\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\n\u0000\u0004\npPCT\u0001\u0000\u0000\u0002\u0000\u0000\u0011\u0000L\u0014\u0000?\u0012\u00007EO*,,EO*,EOEO,j\f\u0000\u000bk\u0003\u001d\u0000\rk\/,EY\u0000\u0003hOlvEUW\u0000\nX\u0000\r\u0000\u000eEO\u000f\u000fascr\u0000\u0001\u0000\f\u07ad","new_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0003l\u0000\u0002\u0000\u0000\u0000H\u0000\u0007\r\u0000\u0007\u0000\u0003Q\u0000\u0000\u0000\u0000\u0000H\u0000\b\u0000\t\u0000\n\r\u0000\b\u0000\u0002O\u0000\u0000\u0000\u0003\u0000=\u0000\u000b\u0000\f\r\u0000\u000b\u0000\u0001k\u0000\u0000\u0000\u0007\u0000<\u0000\r\u0002\u0000\r\u0000\u0002\u0000\u000e\u0000\u000f\r\u0000\u000e\u0000\u0002r\u0000\u0000\u0000\u0007\u0000\n\u0000\u0010\u0000\u0011\r\u0000\u0010\u0000\u0001m\u0000\u0000\u0000\u0007\u0000\b\u0000\u0012\u000e\u0000\u0012\u0000\u0001\u0000\u0013\u0011\u0000\u0013\u0000\b\u0000f\u0000s\u0000c\u0000k\r\u0000\u0011\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\u0002\u0000\u000f\u0000\u0002\u0000\u0014\u0000\u0015\r\u0000\u0014\u0000\u0002r\u0000\u0000\u0000\u000b\u0000\u0012\u0000\u0016\u0000\u0017\r\u0000\u0016\u0000\u0002n\u0000\u0000\u0000\u000b\u0000\u0010\u0000\u0018\u0000\u0019\r\u0000\u0018\u0000\u00011\u0000\u0000\u0000\u000e\u0000\u0010\n\u0000\u0004\npnam\r\u0000\u0019\u0000\u00011\u0000\u0000\u0000\u000b\u0000\u000e\n\u0000\u0004\npPla\r\u0000\u0017\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00140\u0000\balibrary\u0000\baLibrary\u0002\u0000\u0015\u0000\u0002\u0000\u001a\u0000\u001b\r\u0000\u001a\u0000\u0002r\u0000\u0000\u0000\u0013\u0000\u0018\u0000\u001c\u0000\u001d\r\u0000\u001c\u0000\u00011\u0000\u0000\u0000\u0013\u0000\u0016\n\u0000\u0004\npTrk\r\u0000\u001d\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00100\u0000\u0006atrack\u0000\u0006aTrack\u0002\u0000\u001b\u0000\u0002\u0000\u001e\u0000\u001f\r\u0000\u001e\u0000\u0002r\u0000\u0000\u0000\u0019\u0000\u001c\u0000 \u0000!\r\u0000 \u0000\u0001m\u0000\u0000\u0000\u0019\u0000\u001a\n\u0000\u0004\nnull\r\u0000!\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001e0\u0000\ratrackartwork\u0000\raTrackArtwork\u0002\u0000\u001f\u0000\u0002\u0000\"\u0000#\r\u0000\"\u0000\u0004Z\u0000\u0000\u0000\u001d\u00005\u0000$\u0000%\r\u0000$\u0000\u0002@\u0000\u0000\u0000\u001d\u0000&\u0000&\u0000'\r\u0000&\u0000\u0003l\u0000\u0005\u0000\u001d\u0000$\u0000(\r\u0000(\u0000\u0003I\u0000\u0001\u0000\u001d\u0000$\u0000)\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\r\u0000)\u0000\u0002n\u0000\u0000\u0000\u001d\u0000 \u0000*\u0000+\r\u0000*\u0000\u0001m\u0000\u0000\u0000\u001e\u0000 \n\u0000\u0004\ncArt\r\u0000+\u0000\u0001o\u0000\u0000\u0000\u001d\u0000\u001e\u000b\u0000\u00100\u0000\u0006atrack\u0000\u0006aTrack\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000'\u0000\u0001m\u0000\u0000\u0000$\u0000%\u0003\u0000\u0001\r\u0000%\u0000\u0002r\u0000\u0000\u0000)\u00001\u0000,\u0000-\r\u0000,\u0000\u0002n\u0000\u0000\u0000)\u0000\/\u0000.\u0000\/\r\u0000.\u0000\u00011\u0000\u0000\u0000-\u0000\/\n\u0000\u0004\npRaw\r\u0000\/\u0000\u0002n\u0000\u0000\u0000)\u0000-\u00000\u00001\r\u00000\u0000\u00024\u0000\u0000\u0000*\u0000-\u00002\n\u0000\u0004\ncArt\r\u00002\u0000\u0001m\u0000\u0000\u0000+\u0000,\u0003\u0000\u0001\r\u00001\u0000\u0001o\u0000\u0000\u0000)\u0000*\u000b\u0000\u00100\u0000\u0006atrack\u0000\u0006aTrack\r\u0000-\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001e0\u0000\ratrackartwork\u0000\raTrackArtwork\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000#\u0000\u0002\u00003\r\u00003\u0000\u0002r\u0000\u0000\u00006\u0000<\u00004\u00005\r\u00004\u0000\u0001J\u0000\u0000\u00006\u0000:\u00006\u0002\u00006\u0000\u0002\u00007\u00008\r\u00007\u0000\u0001o\u0000\u0000\u00006\u00007\u000b\u0000\u001e0\u0000\ratrackartwork\u0000\raTrackArtwork\u0002\u00008\u0000\u0002\u00009\r\u00009\u0000\u0001o\u0000\u0000\u00007\u00008\u000b\u0000\u00140\u0000\balibrary\u0000\baLibrary\u0002\u0000\u0000\r\u00005\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\u0002\u0000\u0000\r\u0000\f\u0000\u0001m\u0000\u0000\u0000\u0003\u0000\u0004\u0000:\u000f\u0000:\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000hook\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001L\u0000\u0002\u0000\u0001\fSnow-Leopard\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u01ba8H+\u0000\u0000\u0000\u0000\u0001\niTunes.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002u\u0180*\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fApplications\u0000\u0010\u0000\b\u0000\u0000\u01bb\f\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u0181M\u0000\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0001\u0000\u0002\u0000$Snow-Leopard:Applications:iTunes.app\u0000\u000e\u0000\u0016\u0000\n\u0000i\u0000T\u0000u\u0000n\u0000e\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000S\u0000n\u0000o\u0000w\u0000-\u0000L\u0000e\u0000o\u0000p\u0000a\u0000r\u0000d\u0000\u0012\u0000\u0017Applications\/iTunes.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\r\u0000\t\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000\n\u0000\u0002r\u0000\u0000\u0000E\u0000H\u0000;\u0000<\r\u0000;\u0000\u0001m\u0000\u0000\u0000E\u0000F\u0000=\u000e\u0000=\u0000\u0001\u0000>\u0011\u0000>\u0000\b\u0000f\u0000s\u0000c\u0000k\r\u0000<\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000?\u0000@\r\u0000?\u0000\u0003l\u0000\u0002\u0000I\u0000K\u0000A\r\u0000A\u0000\u0001L\u0000\u0000\u0000I\u0000K\u0000B\r\u0000B\u0000\u0001o\u0000\u0000\u0000I\u0000J\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000@\u0000\u0002\u0000C\r\u0000C\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0003\u0000D\u0000E\u0001\u0000\u0000\u0010\u0000D\u0000\u0001\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000e\u0000E\u0000\u0007\u0010\u0000F\u0000G\u0000H\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000F\u0000\u0001k\u0000\u0000\u0000\u0000\u0000K\u0000I\u0002\u0000I\u0000\u0002\u0000\u0005\u0000J\u0002\u0000J\u0000\u0002\u0000?\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000G\u0000\u0000\u0010\u0000H\u0000\u0010\u0000:\u0000\u0012\u0000=\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\n\u0000\u0004\npPla\n\u0000\u0004\npnam\u000b\u0000\u00140\u0000\balibrary\u0000\baLibrary\n\u0000\u0004\npTrk\u000b\u0000\u00100\u0000\u0006atrack\u0000\u0006aTrack\n\u0000\u0004\nnull\u000b\u0000\u001e0\u0000\ratrackartwork\u0000\raTrackArtwork\n\u0000\u0004\ncArt\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\n\u0000\u0004\npRaw\u0001\u0000\u0000\u0002\u0000\u0000\u0011\u0000L\u0014\u0000?\u0012\u00007EO*,,EO*,EOEO,j\f\u0000\u000bk\u0003\u001d\u0000\rk\/,EY\u0000\u0003hOlvEUW\u0000\nX\u0000\r\u0000\u000eEO\u000f\u000fascr\u0000\u0001\u0000\f\u07ad","subject":"Fix #114: GrowlTunes hanging if pictd has died.","message":"Fix #114: GrowlTunes hanging if pictd has died.\n\nAs noted in the ticket, the fix here is to ask for the raw data, not the PICT data, for the artwork.\n","lang":"AppleScript","license":"bsd-3-clause","repos":"PersonifyInc\/growl,PersonifyInc\/growl,incbee\/Growl,PersonifyInc\/growl,incbee\/Growl,incbee\/Growl,PersonifyInc\/growl,incbee\/Growl,PersonifyInc\/growl,incbee\/Growl"}
{"commit":"5ee8b7a89839a63885d0ef25a1b40ee361cb4a71","old_file":"osx\/switch_personal.scpt","new_file":"osx\/switch_personal.scpt","old_contents":"property thePane : \"com.apple.preferences.bluetooth\"\n\ntell application \"Terminal\"\n  activate\n  my execCmd(\"ssh ${TARGET_2}\", 1)\n  my execCmd(\"${TARGET_2_P}\", 5)\n  my execCmd(\"osascript ~\/.dotfiles\/osx\/bluetooth.scpt\", 0)\n  my toggleBluetooth()\nend tell\n\non execCmd(cmd, pause)\n  tell application \"System Events\"\n    tell application process \"Terminal\"\n      set frontmost to true\n      keystroke cmd\n      keystroke return\n    end tell\n  end tell\n  delay pause\nend execCmd\n\non toggleBluetooth()\n  tell application \"System Preferences\"\n    activate\n    set the current pane to pane id thePane\n  end tell\n  tell application \"System Events\"\n    tell application process \"System Preferences\"\n      try\n        click button \"Turn Bluetooth Off\" of window \"Bluetooth\"\n      on error\n        click button \"Turn Bluetooth On\" of window \"Bluetooth\"\n      end try\n    end tell\n  end tell\nend toggleBluetooth\n","new_contents":"property thePane : \"com.apple.preferences.bluetooth\"\n\ntell application \"Terminal\"\n  activate\n  my execCmd(\"ssh ${TARGET_2}\", 1)\n  set pass to system attribute \"TARGET_2_P\"\n  my execCmd(pass, 5)\n  my execCmd(\"osascript ~\/.dotfiles\/osx\/bluetooth.scpt\", 0)\n  my toggleBluetooth()\nend tell\n\non execCmd(cmd, pause)\n  tell application \"System Events\"\n    tell application process \"Terminal\"\n      set frontmost to true\n      keystroke cmd\n      keystroke return\n    end tell\n  end tell\n  delay pause\nend execCmd\n\non toggleBluetooth()\n  tell application \"System Preferences\"\n    activate\n    set the current pane to pane id thePane\n  end tell\n  tell application \"System Events\"\n    tell application process \"System Preferences\"\n      try\n        click button \"Turn Bluetooth Off\" of window \"Bluetooth\"\n      on error\n        click button \"Turn Bluetooth On\" of window \"Bluetooth\"\n      end try\n    end tell\n  end tell\nend toggleBluetooth\n","subject":"fix personal switch","message":"fix personal switch\n","lang":"AppleScript","license":"mit","repos":"lfender6445\/dotfiles,lfender6445\/dotfiles"}
{"commit":"38be35e0c9d3eb0ff048b271bf46a9b1c746a23f","old_file":"XcodeWayExtensions\/Script\/XcodeWayScript.scpt","new_file":"XcodeWayExtensions\/Script\/XcodeWayScript.scpt","old_contents":"use scripting additions\nuse framework \"Foundation\"\nproperty NSString : a reference to current application's NSString\n\n-- Helper\n\non myRemoveLastPath(myPath)\nset myString to NSString's stringWithString:myPath\nset removedLastPathString to myString's stringByDeletingLastPathComponent\nremovedLastPathString as text\nend myRemoveLastPath\n\non myFolderExists(myFolder) -- (String) as Boolean\ntell application \"System Events\"\nif exists folder myFolder then\nreturn true\nelse\nreturn false\nend if\nend tell\nend myFolderExists\n\n-- Path\n\non myHomePath()\ntell application \"System Events\"\n\"\/Users\/\" & (name of current user)\nend tell\nend myHomePath\n\non myLibraryPath()\nmyHomePath() & \"\/Library\"\nend myLibraryPath\n\non myXcodePath()\nmyLibraryPath() & \"\/Developer\/Xcode\"\nend myXcodePath\n\non myUserDataPath()\nmyXcodePath() & \"\/UserData\"\nend myUserDataPath\n\non myProjectPath()\ntell application \"Xcode\"\ntell active workspace document\nset myPath to path\nend tell\nend tell\nmyRemoveLastPath(myPath)\nend myProjectPath\n\n-- Generic Open\n\non myOpenFolder(myPath)\ntell application \"Finder\"\nactivate\nopen myPath as POSIX file\nend tell\nend myOpenFolder\n\non myOpeniTerm(myPath)\ntell application \"Finder\"\ndo shell script \"open -a iTerm \" & quoted form of myPath\nend tell\nend myOpeniTerm\n\n-- Open\n\non myOpenThemesFolder()\nset myPath to myUserDataPath() & \"\/FontAndColorThemes\/\"\nmyOpenFolder(myPath)\nend myOpenThemesFolder\n\non myOpenCodeSnippetsFolder()\nset myPath to myUserDataPath() & \"\/CodeSnippets\/\"\nmyOpenFolder(myPath)\nend myOpenCodeSnippetsFolder\n\non myOpenDeviceSupportFolder()\nset myPath to \"\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/DeviceSupport\"\nmyOpenFolder(myPath)\nend myOpenDeviceSupportFolder\n\non myOpenArchivesFolder()\nset myPath to myXcodePath() & \"\/Archives\/\"\nmyOpenFolder(myPath)\nend myOpenArchivesFolder\n\non myOpenProvisioningProfileFolder()\nset myPath to myLibraryPath() & \"\/MobileDevice\/Provisioning Profiles\"\nmyOpenFolder(myPath)\nend myOpenProvisioningProfileFolder\n\non myOpenProjectFolder()\nset myPath to myProjectPath()\nmyOpenFolder(myPath)\nend myOpenProjectFolder\n\non myOpeniTermForCurrentProject()\nset myPath to myProjectPath()\nmyOpeniTerm(myPath)\nend myOpeniTermForCurrentProject\n\non myOpenDerivedDataFolder()\nset myRelativePath to myProjectPath() & \"\/DerivedData\/\"\nif myFolderExists(myRelativePath) then\nmyOpenFolder(myRelativePath)\nelse\nmyOpenFolder(myXcodePath() & \"\/DerivedData\/\")\nend if\nend myOpenDerivedDataFolder\n\nmyOpenDerivedDataFolder()\n","new_contents":"use scripting additions\nuse framework \"Foundation\"\nproperty NSString : a reference to current application's NSString\n\n-- Helper\n\non myRemoveLastPath(myPath)\nset myString to NSString's stringWithString:myPath\nset removedLastPathString to myString's stringByDeletingLastPathComponent\nremovedLastPathString as text\nend myRemoveLastPath\n\non myFolderExists(myFolder) -- (String) as Boolean\ntell application \"System Events\"\nif exists folder myFolder then\nreturn true\nelse\nreturn false\nend if\nend tell\nend myFolderExists\n\n-- Path\n\non myHomePath()\ntell application \"System Events\"\n\"\/Users\/\" & (name of current user)\nend tell\nend myHomePath\n\non myLibraryPath()\nmyHomePath() & \"\/Library\"\nend myLibraryPath\n\non myXcodePath()\nmyLibraryPath() & \"\/Developer\/Xcode\"\nend myXcodePath\n\non myUserDataPath()\nmyXcodePath() & \"\/UserData\"\nend myUserDataPath\n\non myProjectPath()\ntell application \"Xcode\"\ntell active workspace document\nset myPath to path\nend tell\nend tell\nmyRemoveLastPath(myPath)\nend myProjectPath\n\n-- Generic Open\n\non myOpenFolder(myPath)\ntell application \"Finder\"\nactivate\nopen myPath as POSIX file\nend tell\nend myOpenFolder\n\non myOpeniTerm(myPath)\ntell application \"Finder\"\ndo shell script \"open -a iTerm \" & quoted form of myPath\nend tell\nend myOpeniTerm\n\n-- Open\n\non myOpenThemesFolder()\nset myPath to myUserDataPath() & \"\/FontAndColorThemes\/\"\nmyOpenFolder(myPath)\nend myOpenThemesFolder\n\non myOpenCodeSnippetsFolder()\nset myPath to myUserDataPath() & \"\/CodeSnippets\/\"\nmyOpenFolder(myPath)\nend myOpenCodeSnippetsFolder\n\non myOpenDeviceSupportFolder()\nset myPath to \"\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/DeviceSupport\"\nmyOpenFolder(myPath)\nend myOpenDeviceSupportFolder\n\non myOpenArchivesFolder()\nset myPath to myXcodePath() & \"\/Archives\/\"\nmyOpenFolder(myPath)\nend myOpenArchivesFolder\n\non myOpenProvisioningProfileFolder()\nset myPath to myLibraryPath() & \"\/MobileDevice\/Provisioning Profiles\"\nmyOpenFolder(myPath)\nend myOpenProvisioningProfileFolder\n\non myOpenProjectFolder()\nset myPath to myProjectPath()\nmyOpenFolder(myPath)\nend myOpenProjectFolder\n\non myOpeniTermForCurrentProject()\nset myPath to myProjectPath()\nmyOpeniTerm(myPath)\nend myOpeniTermForCurrentProject\n\non myOpenDerivedDataFolder()\nset myRelativePath to myProjectPath() & \"\/DerivedData\/\"\nif myFolderExists(myRelativePath) then\nmyOpenFolder(myRelativePath)\nelse\nmyOpenFolder(myXcodePath() & \"\/DerivedData\/\")\nend if\nend myOpenDerivedDataFolder\n\non myOpenGitHub()\nset myUrl to (do shell script \"cd \/Users\/khoa\/XcodeProject2\/XcodeWay; git config --get remote.origin.url\")\nend myOpenGitHub\n","subject":"Add myOpenGitHub","message":"Add myOpenGitHub\n","lang":"AppleScript","license":"mit","repos":"onmyway133\/XcodeWay,onmyway133\/XcodeWay"}
{"commit":"c1ca719baab48f368810b1bcab7022338f30a48a","old_file":"Launcher\/Mac\/jLinuxInstaller.scpt","new_file":"Launcher\/Mac\/jLinuxInstaller.scpt","old_contents":"--jLinuxInstaller.scpt DOES NOT work fully yet\n--Due to the fact that .app files are actually folders, getting them with cURL does not work\n--This will be fixed later but isn't a high priority right now\n--\n-- (c) 2016 Brendan Manning\n-- MIT Liscense\ndisplay dialog \"jLinux Quick Installer...\" with title \"Install jLinux\" buttons {\"Install\", \"Quit\"} default button 1\nif button returned of result = \"Install\" then\n\tdisplay alert \"Downloading files from the Internet...If you do not have Internet access, you may be required to install manually\" giving up after 2\n\ttell application \"Terminal\"\n\t\tquit\n\t\tdelay 5\n\t\tactivate\n\t\tdo script \"mkdir \/Applications\/jLinux\/\"\n\t\tdelay 1\n\t\tdo script \"curl -f http:\/\/thecyberbay.com\/cdn\/jLinux\/latest\/latest.jar -o \/Applications\/jLinux\/latest.jar\"\n\t\tdelay 10\n\t\tdo script \"rm \/Applications\/jLinux\/jLinux.jar\"\n\t\tdo script \"mv \/Applications\/jLinux\/latest.jar \/Applications\/jLinux\/jLinux.jar\"\n\t\t--commented code that doesn't work yet\n\t\t--delay 1\n\t\t--do script \"curl -f http:\/\/thecyberbay.com\/cdn\/jLinux\/latest\/jLinuxLauncher.app -o \/Applications\/jLinux\/jLinuxLauncher.app\"\n\t\t--delay 10\n\t\t--do script \"curl -f http:\/\/thecyberbay.com\/cdn\/jLinux\/latest\/jLinuxUpdater.app -o \/Applications\/jLinux\/jLinuxUpdater.app\"\n\t\tquit\n\t\tdelay 5\n\t\tactivate\n\t\tdo script \"java -jar \/Applications\/jLinux\/jLinux.jar\"\n\t\tdisplay alert \"jLinux Installed!\" buttons {\"Great\", \"ALRIGHT!\", \"Rock on man!\"} default button 3\n\tend tell\nelse\n\tdisplay alert \"You have aborted jLinux installation. If you would like to return, simply reopen this app!\" buttons {\"Acknowledged\", \"Affirmative\", \"10-4\"} default button 2\nend if\n","new_contents":"--jLinuxInstaller.scpt DOES NOT work fully yet\n--Due to the fact that .app files are actually folders, getting them with cURL does not work\n--This will be fixed later but isn't a high priority right now\n-- \n-- (c) 2016 Brendan Manning\n-- MIT Liscense\ndisplay dialog \"jLinux Quick Installer...\" with title \"Install jLinux\" buttons {\"Install\", \"Quit\"} default button 1\nif button returned of result = \"Install\" then\n\tdisplay alert \"Downloading files from the Internet...If you do not have Internet access, you may be required to install manually\" giving up after 2\n\ttell application \"Terminal\"\n\t\tquit\n\t\tdelay 5\n\t\tactivate\n\t\tdo script \"mkdir \/Applications\/jLinux\/\"\n\t\tdelay 1\n\t\tdo script \"curl -f http:\/\/thecyberbay.com\/cdn\/jLinux\/latest\/latest.jar -o \/Applications\/jLinux\/latest.jar\"\n\t\tdelay 10\n\t\tdo script \"rm \/Applications\/jLinux\/jLinux.jar\"\n\t\tdo script \"mv \/Applications\/jLinux\/latest.jar \/Applications\/jLinux\/jLinux.jar\"\n\t\t--commented code that doesn't work yet\n\t\t--delay 1\n\t\t--do script \"curl -f http:\/\/thecyberbay.com\/cdn\/jLinux\/latest\/jLinuxLauncher.app -o \/Applications\/jLinux\/jLinuxLauncher.app\"\n\t\t--delay 10\n\t\t--do script \"curl -f http:\/\/thecyberbay.com\/cdn\/jLinux\/latest\/jLinuxUpdater.app -o \/Applications\/jLinux\/jLinuxUpdater.app\"\n\t\tquit\n\t\tdelay 5\n\t\tactivate\n\t\tdo script \"java -jar \/Applications\/jLinux\/jLinux.jar\"\n\t\tdisplay alert \"jLinux Installed!\" buttons {\"Great\", \"ALRIGHT!\", \"Rock on man!\"} default button 3\n\tend tell\nelse\n\tdisplay alert \"You have aborted jLinux installation. If you would like to return, simply reopen this app!\" buttons {\"Acknowledged\", \"Affirmative\", \"10-4\"} default button 2\nend if\n","subject":"Update jLinuxInstaller.scpt","message":"Update jLinuxInstaller.scpt\n\nBE WARNED, this file does not work yet.","lang":"AppleScript","license":"mit","repos":"brendanmanning\/jLinux"}
{"commit":"a22e8ee5fe8bd5ba6bdf63dbd2044ffcd40c2b25","old_file":"applescript\/resources\/is-iterm2-active.applescript","new_file":"applescript\/resources\/is-iterm2-active.applescript","old_contents":"#!\/usr\/bin\/osascript\n\non run ttyName\n    try \n        set ttyName to first item of ttyName\n    on error\n        set ttyName to \"\"\n    end\n\n    if ttyName is equal to \"\" then error \"Usage: is-iterm2-active.applescript TTY\"\n\n    tell application \"System Events\"\n        tell item 1 of (application processes whose bundle identifier is \"com.googlecode.iterm2\")\n            if frontmost is not true then error \"iTerm is not the frontmost application\"\n        end tell\n    end tell\n\n    tell application id \"com.googlecode.iterm2\"\n        set currentTty to tty of (current session of current tab of current window) as text\n        if currentTty is not equal to ttyName then error \"Current tab TTY '\" & currentTty & \"' does not match expected '\" & ttyName & \"'\" \n    end tell\n\nend run\n","new_contents":"#!\/usr\/bin\/osascript\n\non run ttyName\n    try \n        set ttyName to first item of ttyName\n    on error\n        set ttyName to \"\"\n    end\n\n    if ttyName is equal to \"\" then error \"Usage: is-iterm2-active.applescript TTY\"\n\n    tell application id \"com.googlecode.iterm2\"\n        tell current window\n            set isHotkeyWindow to is hotkey window\n            if isHotkeyWindow and visible is not true then error \"iTerm is not the frontmost application\"\n        end tell\n    end tell\n\n    if isHotkeyWindow is not true then\n        tell application \"System Events\"\n            tell item 1 of (application processes whose bundle identifier is \"com.googlecode.iterm2\")\n                if frontmost is not true then error \"iTerm is not the frontmost application\"\n            end tell\n        end tell\n    end if\n\n    tell application id \"com.googlecode.iterm2\"\n        set currentTty to tty of (current session of current tab of current window) as text\n        if currentTty is not equal to ttyName then error \"Current tab TTY '\" & currentTty & \"' does not match expected '\" & ttyName & \"'\" \n    end tell\n\nend run\n","subject":"Add check for active hotkey window in iTerm2 (#86)","message":"Add check for active hotkey window in iTerm2 (#86)\n\nOld way of checking if terminal window is active didn't work for hotkey\r\nwindow with `Floating window` option active. Used iTerm scripting API\r\nto use different checks, if last used window is the hotkey window.","lang":"AppleScript","license":"mit","repos":"marzocchi\/zsh-notify,mehanoid\/zsh-notify"}
{"commit":"215680372992a4ef82c4e7f2d098dac23601d7b6","old_file":"lib\/scripts\/get_state.applescript","new_file":"lib\/scripts\/get_state.applescript","old_contents":"tell application \"Spotify\"\n  set cstate to \"{\"\n  set cstate to cstate & \"\\\"track_id\\\": \\\"\" & current track's id & \"\\\"\"\n  set cstate to cstate & \",\\\"volume\\\": \" & sound volume\n  set cstate to cstate & \",\\\"position\\\": \" & (player position as integer)\n  set cstate to cstate & \",\\\"state\\\": \\\"\" & player state & \"\\\"\"\n  set cstate to cstate & \"}\"\n\n  return cstate\nend tell\n","new_contents":"tell application \"Spotify\"\n  set cstate to \"{\"\n  set cstate to cstate & \"\\\"track_id\\\": \\\"\" & current track's id & \"\\\"\"\n  set cstate to cstate & \",\\\"volume\\\": \" & sound volume\n  set cstate to cstate & \",\\\"position\\\": \" & (player position)\n  set cstate to cstate & \",\\\"state\\\": \\\"\" & player state & \"\\\"\"\n  set cstate to cstate & \"}\"\n\n  return cstate\nend tell\n","subject":"Update get_state.applescript","message":"Update get_state.applescript\n\nRemove cast to integer for position.","lang":"AppleScript","license":"mit","repos":"andrehaveman\/spotify-node-applescript"}
{"commit":"78b0c50fa62ddbda19b735b8ea96a59a383b3853","old_file":"src\/scripts\/clean-tabs.scpt","new_file":"src\/scripts\/clean-tabs.scpt","old_contents":"tell application \"Safari\"\n    repeat with t in tabs of windows\n        tell t\n            -- If you open lots of windows in Safari, some of this book-\n            -- keeping goes wrong.  It will try to look up tab N, except\n            -- tab N was already closed -- error!\n            --\n            -- For safety, we just catch and discard all errors.\n            {% for url in urls %}\n            try\n                tell t\n                    if (URL starts with \"{{ url }}\") then close\n                end tell\n            end try\n            {% endfor %}\n        end tell\n    end repeat\nend tell\n","new_contents":"tell application \"Safari\"\n    repeat with t in tabs of windows\n        tell t\n            -- If you open lots of windows in Safari, some of this book-\n            -- keeping goes wrong.  It will try to look up tab N, except\n            -- tab N was already closed -- error!\n            --\n            -- For safety, we just catch and discard all errors.\n            {% for url in urls %}\n            try\n                tell t\n                    if (URL contains \"{{ url }}\") then close\n                end tell\n            end try\n            {% endfor %}\n        end tell\n    end repeat\nend tell\n","subject":"Allow fuzzy matching on URLs for clean-tabs","message":"Allow fuzzy matching on URLs for clean-tabs\n","lang":"AppleScript","license":"mit","repos":"alexwlchan\/safari.rs,alexwlchan\/safari.rs"}
{"commit":"7f375e6b72e5b1097205cbd615fbb9a9802f52ec","old_file":"lib\/scripts\/get_state.applescript","new_file":"lib\/scripts\/get_state.applescript","old_contents":"tell application \"Spotify\"\n  set cstate to \"{\"\n  set cstate to cstate & \"\\\"track_id\\\": \\\"\" & current track's id & \"\\\"\"\n  set cstate to cstate & \",\\\"volume\\\": \" & sound volume\n  set cstate to cstate & \",\\\"position\\\": \" & (player position)\n  set cstate to cstate & \",\\\"state\\\": \\\"\" & player state & \"\\\"\"\n  set cstate to cstate & \"}\"\n\n  return cstate\nend tell\n","new_contents":"tell application \"Spotify\"\n  set cstate to \"{\"\n  set cstate to cstate & \"\\\"track_id\\\": \\\"\" & current track's id & \"\\\"\"\n  set cstate to cstate & \",\\\"volume\\\": \" & sound volume\n  set cstate to cstate & \",\\\"position\\\": \" & (player position as integer)\n  set cstate to cstate & \",\\\"state\\\": \\\"\" & player state & \"\\\"\"\n  set cstate to cstate & \"}\"\n\n  return cstate\nend tell\n","subject":"Revert \"Update get_state.applescript\"","message":"Revert \"Update get_state.applescript\"\n","lang":"AppleScript","license":"mit","repos":"andrehaveman\/spotify-node-applescript"}
{"commit":"30454a6a84fb9e634718a2f158bfea3784c85246","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\n-- workflow folders\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\n\n-- the default icon used for search results without album artwork\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and use it to fetch album artwork\n\t\t\tset songId to persistent ID of theSong\n\t\t\t-- the base path to the artwork file (without extension)\n\t\t\tset artworkPath to (do shell script \".\/resources\/get-song-artwork-path.sh\" & space & songId & space & defaultIconName)\n\n\t\tend tell\n\n\t\treturn artworkPath\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"Music\"\n\n\t\tset genreSongs to every track of playlist 2 whose genre is genreName\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in genreSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset genreSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset genreSongs to genreSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn genreSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in artistSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset artistSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName)\n\t\t\tset artistSongs to artistSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\n-- workflow folders\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\n\n-- the default icon used for search results without album artwork\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and use it to fetch album artwork\n\t\t\tset songId to persistent ID of theSong\n\t\t\t-- the base path to the artwork file (without extension)\n\t\t\tset artworkPath to (do shell script \".\/resources\/get-song-artwork-path.sh\" & space & songId & space & defaultIconName)\n\n\t\tend tell\n\n\t\treturn artworkPath\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\ttell application \"Music\"\n\n\t\treturn every track of playlist 2 whose genre is genreName\n\n\tend tell\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in artistSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset artistSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName)\n\t\t\tset artistSongs to artistSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","subject":"Fix playgenre filter including songs from disparate genres","message":"Fix playgenre filter including songs from disparate genres\n\nThis is because the original implementation of playgenre assumed that a\ngiven album contained songs from the same genre. However, there are\nreal-world cases where an album can contain songs from multiple genres.\nFixing this also improved the performance of playgenre substantially.\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"ef7694444938ab899fb5fad6c99fc7e4c5b0148a","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset genreSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in genreSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset genreSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset genreSongs to genreSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn genreSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in artistSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset artistSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset artistSongs to artistSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","subject":"Reduce usage of ambiguous variable name theSongs","message":"Reduce usage of ambiguous variable name theSongs\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"3e9fae2fc86014b80eedc757c3ddc6ad77a54fc4","old_file":"actions\/play-direct.applescript","new_file":"actions\/play-direct.applescript","old_contents":"-- plays selected song or playlist directly (the Play Song v1 behavior)\n-- for songs, this behavior continues playing music after the song finishes\n\non loadConfig()\n\treturn (load script POSIX file (do shell script \".\/resources\/compile-config.sh\"))\nend loadConfig\n\non run query\n\tset config to loadConfig()\n\n\tset typeAndId to parseResultQuery(query as text) of config\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\ttell application \"iTunes\"\n\n\t\tif theType is \"song\" then\n\n\t\t\tset theSong to getSong(theId) of config\n\t\t\tplay theSong\n\n\t\telse if theType is \"playlist\" then\n\n\t\t\tset thePlaylist to getPlaylist(theId) of config\n\t\t\tplay thePlaylist\n\n\t\telse\n\n\t\t\tlog \"Unknown type: \" & theType\n\n\t\tend if\n\n\tend tell\nend run\n","new_contents":"-- plays selected song or playlist directly (the Play Song v1 behavior)\n-- for songs, this behavior continues playing music after the song finishes\n\non loadConfig()\n\treturn (load script POSIX file (do shell script \".\/resources\/compile-config.sh\"))\nend loadConfig\n\non run query\n\tset config to loadConfig()\n\n\tset typeAndId to parseResultQuery(query as text) of config\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\ttell application \"iTunes\"\n\n\t\tif theType is \"song\" then\n\n\t\t\tset theSong to getSong(theId) of config\n\t\t\tplay theSong\n\n\t\telse if theType ends with \"playlist\" then\n\n\t\t\tset thePlaylist to getPlaylist(theId) of config\n\t\t\tplay thePlaylist\n\n\t\telse\n\n\t\t\tlog \"Unknown type: \" & theType\n\n\t\tend if\n\n\tend tell\nend run\n","subject":"Fix bug where Apple Music playlists could not be played","message":"Fix bug where Apple Music playlists could not be played\n\nThe bug in question was a regression introduced in c309730.\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"4035e6259c5f0ac5ee56122621bd5f60199f2d07","old_file":"XcodeWayExtensions\/Script\/XcodeWayScript.scpt","new_file":"XcodeWayExtensions\/Script\/XcodeWayScript.scpt","old_contents":"use scripting additions\nuse framework \"Foundation\"\nproperty NSString : a reference to current application's NSString\n\n-- Helper\n\non myRemoveLastPath(myPath)\nset myString to NSString's stringWithString:myPath\nset removedLastPathString to myString's stringByDeletingLastPathComponent\nremovedLastPathString as text\nend myRemoveLastPath\n\n-- Path\n\non myHomePath()\ntell application \"System Events\"\n\"\/Users\/\" & (name of current user)\nend tell\nend myHomePath\n\non myLibraryPath()\nmyHomePath() & \"\/Library\"\nend myLibraryPath\n\non myXcodePath()\nmyLibraryPath() & \"\/Developer\/Xcode\"\nend myXcodePath\n\non myUserDataPath()\nmyXcodePath() & \"\/UserData\"\nend myUserDataPath\n\non myProjectPath()\ntell application \"Xcode\"\ntell active workspace document\nset myPath to path\nend tell\nend tell\nmyRemoveLastPath(myPath)\nend myProjectPath\n\n-- Generic Open\n\non myOpenFolder(myPath)\ntell application \"Finder\"\nactivate\nopen myPath as POSIX file\nend tell\nend myOpenFolder\n\non myOpeniTerm(myPath)\ntell application \"Finder\"\ndo shell script \"open -a iTerm \" & quoted form of myPath\nend tell\nend myOpeniTerm\n\n-- Open\n\non myOpenThemesFolder()\nset myPath to myUserDataPath() & \"\/FontAndColorThemes\/\"\nmyOpenFolder(myPath)\nend myOpenThemesFolder\n\non myOpenCodeSnippetsFolder()\nset myPath to myUserDataPath() & \"\/CodeSnippets\/\"\nmyOpenFolder(myPath)\nend myOpenCodeSnippetsFolder\n\non myOpenDeviceSupportFolder()\nset myPath to \"\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/DeviceSupport\"\nmyOpenFolder(myPath)\nend myOpenDeviceSupportFolder\n\non myOpenArchivesFolder()\nset myPath to myXcodePath() & \"\/Archives\/\"\nmyOpenFolder(myPath)\nend myOpenArchivesFolder\n\non myOpenProvisioningProfileFolder()\nset myPath to myLibraryPath() & \"\/MobileDevice\/Provisioning Profiles\"\nmyOpenFolder(myPath)\nend myOpenProvisioningProfileFolder\n\non myOpenProjectFolder()\nset myPath to myProjectPath()\nmyOpenFolder(myPath)\nend myOpenProjectFolder\n\non myOpeniTermForCurrentProject()\nset myPath to myProjectPath()\nmyOpeniTerm(myPath)\nend myOpeniTermForCurrentProject\n\n","new_contents":"use scripting additions\nuse framework \"Foundation\"\nproperty NSString : a reference to current application's NSString\n\n-- Helper\n\non myRemoveLastPath(myPath)\nset myString to NSString's stringWithString:myPath\nset removedLastPathString to myString's stringByDeletingLastPathComponent\nremovedLastPathString as text\nend myRemoveLastPath\n\non myFolderExists(myFolder) -- (String) as Boolean\ntell application \"System Events\"\nif exists folder myFolder then\nreturn true\nelse\nreturn false\nend if\nend tell\nend myFolderExists\n\n-- Path\n\non myHomePath()\ntell application \"System Events\"\n\"\/Users\/\" & (name of current user)\nend tell\nend myHomePath\n\non myLibraryPath()\nmyHomePath() & \"\/Library\"\nend myLibraryPath\n\non myXcodePath()\nmyLibraryPath() & \"\/Developer\/Xcode\"\nend myXcodePath\n\non myUserDataPath()\nmyXcodePath() & \"\/UserData\"\nend myUserDataPath\n\non myProjectPath()\ntell application \"Xcode\"\ntell active workspace document\nset myPath to path\nend tell\nend tell\nmyRemoveLastPath(myPath)\nend myProjectPath\n\n-- Generic Open\n\non myOpenFolder(myPath)\ntell application \"Finder\"\nactivate\nopen myPath as POSIX file\nend tell\nend myOpenFolder\n\non myOpeniTerm(myPath)\ntell application \"Finder\"\ndo shell script \"open -a iTerm \" & quoted form of myPath\nend tell\nend myOpeniTerm\n\n-- Open\n\non myOpenThemesFolder()\nset myPath to myUserDataPath() & \"\/FontAndColorThemes\/\"\nmyOpenFolder(myPath)\nend myOpenThemesFolder\n\non myOpenCodeSnippetsFolder()\nset myPath to myUserDataPath() & \"\/CodeSnippets\/\"\nmyOpenFolder(myPath)\nend myOpenCodeSnippetsFolder\n\non myOpenDeviceSupportFolder()\nset myPath to \"\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/DeviceSupport\"\nmyOpenFolder(myPath)\nend myOpenDeviceSupportFolder\n\non myOpenArchivesFolder()\nset myPath to myXcodePath() & \"\/Archives\/\"\nmyOpenFolder(myPath)\nend myOpenArchivesFolder\n\non myOpenProvisioningProfileFolder()\nset myPath to myLibraryPath() & \"\/MobileDevice\/Provisioning Profiles\"\nmyOpenFolder(myPath)\nend myOpenProvisioningProfileFolder\n\non myOpenProjectFolder()\nset myPath to myProjectPath()\nmyOpenFolder(myPath)\nend myOpenProjectFolder\n\non myOpeniTermForCurrentProject()\nset myPath to myProjectPath()\nmyOpeniTerm(myPath)\nend myOpeniTermForCurrentProject\n\non myOpenDerivedDataFolder()\nset myRelativePath to myProjectPath() & \"\/DerivedData\/\"\nif myFolderExists(myRelativePath) then\nmyOpenFolder(myRelativePath)\nelse\nmyOpenFolder(myXcodePath() & \"\/DerivedData\/\")\nend if\nend myOpenDerivedDataFolder\n\nmyOpenDerivedDataFolder()\n","subject":"Update script to open DerivedData folder","message":"Update script to open DerivedData folder\n","lang":"AppleScript","license":"mit","repos":"onmyway133\/XcodeWay,onmyway133\/XcodeWay"}
{"commit":"bbf9ead2c4cfa563f9bd9e08d90c27e16b7ba226","old_file":"applescripts\/open_vagrant.applescript","new_file":"applescripts\/open_vagrant.applescript","old_contents":"set open_vagrant to \"cd ~\/uberVU\/puppet && vagrant up\"\n\ntell application \"iTerm\"\n\tactivate\n\ttry\n\t\tset mysession to current session of current terminal\n\ton error\n\t\tset myterm to (make new terminal)\n\t\ttell myterm\n\t\t\tlaunch session \"Default\"\n\t\t\tset mysession to current session\n\t\tend tell\n\tend try\n\n\ttell mysession\n\t\twrite text open_vagrant\n\tend tell\nend tell\n","new_contents":"set open_vagrant to \"cd ~\/uberVU\/puppet\/hs_analytics_vagrant && git pull && vagrant up\"\n\ntell application \"iTerm\"\n\tactivate\n\ttry\n\t\tset mysession to current session of current terminal\n\ton error\n\t\tset myterm to (make new terminal)\n\t\ttell myterm\n\t\t\tlaunch session \"Default\"\n\t\t\tset mysession to current session\n\t\tend tell\n\tend try\n\n\ttell mysession\n\t\twrite text open_vagrant\n\tend tell\nend tell\n","subject":"Update Vagrant path","message":"Update Vagrant path\n","lang":"AppleScript","license":"mit","repos":"smathson\/dotfiles"}
{"commit":"5c88445e366b15d4a4700b7f9a10a6915ff6b20b","old_file":"Xmod\/Xmod.applescript","new_file":"Xmod\/Xmod.applescript","old_contents":"tell application \"Xcode\"\n\tif not (exists active project document) then \n\t\terror \"No active project. Please open an Xcode project and re-run the script.\"\n\ttry\n\t\tmy updateProjectXmod(project of active project document)\n\ton error errMsg\n\t\tmy logger(\"Xmod.scpt exception: \" & errMsg)\n\tend try\nend tell\n\non updateProjectXmod(_project)\n\ttell application \"Xcode\"\n\t\t-- Iterate over every .xcdatamodel in the project.\n\t\tset modelList to every file reference of _project whose file kind is \"wrapper.xcdatamodel\"\n\t\trepeat with modelIt in modelList\n\t\t\tif comments of modelIt contains \"xmod\" then\n\t\t\t\tset modelSrcDir to my modelSrcDirPath(full path of modelIt)\n\t\t\t\tset targetList to my everyTargetWithBuildFilePath(_project, full path of modelIt)\n\t\t\t\t\n\t\t\t\t-- Create the .xcdatamodel related source group if necessary.\n\t\t\t\tif not (exists (every item reference of group of modelIt whose full path is modelSrcDir)) then\n\t\t\t\t\ttell group of modelIt\n\t\t\t\t\t\tmake new group with properties {full path:modelSrcDir, name:text 1 thru -13 of ((name of modelIt) as string)}\n\t\t\t\t\tend tell\n\t\t\t\tend if\n\t\t\t\tset modelSrcGroup to item 1 of (every item reference of group of modelIt whose full path is modelSrcDir)\n\t\t\t\ttell modelSrcGroup to delete every item reference -- clear it out for population in case we didn't just create it\n\t\t\t\t\n\t\t\t\t--\tMeat.\n\t\t\t\tdo shell script \"\/usr\/bin\/mogenerator --model '\" & full path of modelIt & \"' --output-dir '\" & modelSrcDir & \"'\"\n\t\t\t\t\n\t\t\t\t--\tBuild a list of resulting source files.\n\t\t\t\ttell application \"System Events\"\n\t\t\t\t\tset humanFileList to (every file of (POSIX file modelSrcDir as alias) whose (name ends with \".m\" or name ends with \".mm\") and name does not start with \"_\")\n\t\t\t\t\tset machineFileList to (every file of (POSIX file modelSrcDir as alias) whose (name ends with \".m\" or name ends with \".mm\") and name starts with \"_\")\n\t\t\t\t\tset fileList to humanFileList & machineFileList\n\t\t\t\t\tset pathList to {}\n\t\t\t\t\trepeat with fileItem in fileList\n\t\t\t\t\t\tset pathList to pathList & POSIX path of fileItem\n\t\t\t\t\tend repeat\n\t\t\t\tend tell\n\t\t\t\t\n\t\t\t\t--\tAdd the source files to the model's source group and the model's targets.\n\t\t\t\trepeat with pathIt in pathList\n\t\t\t\t\ttell modelSrcGroup\n\t\t\t\t\t\tset modelSrcFileRef to make new file reference with properties {full path:pathIt, name:name of (info for POSIX file pathIt)}\n\t\t\t\t\t\trepeat with targetIndex from 1 to (count of targetList)\n\t\t\t\t\t\t\tset targetIt to item targetIndex of targetList\n\t\t\t\t\t\t\tadd modelSrcFileRef to targetIt\n\t\t\t\t\t\tend repeat\n\t\t\t\t\tend tell\n\t\t\t\tend repeat\n\t\t\tend if\n\t\tend repeat\n\tend tell\nend updateProjectXmod\n\non everyTargetWithBuildFilePath(_project, _buildFilePath)\n\tset theResult to {}\n\ttell application \"Xcode\"\n\t\trepeat with targetIt in (every target of _project)\n\t\t\trepeat with buildFileIt in build files of targetIt\n\t\t\t\tif full path of file reference of buildFileIt is _buildFilePath then set theResult to theResult & {(targetIt as anything)}\n\t\t\tend repeat\n\t\tend repeat\n\tend tell\n\treturn theResult\nend everyTargetWithBuildFilePath\n\non modelSrcDirPath(modelFileUnixPath)\n\tset modelFilePosixRef to POSIX file modelFileUnixPath\n\tset modelFileAlias to modelFilePosixRef as alias\n\t\n\ttell application \"Finder\"\n\t\tset modelFileFolder to folder of modelFileAlias\n\t\tset modelFileName to name of modelFileAlias\n\t\tset modelSrcFolderName to text 1 thru -13 of modelFileName -- pull off the .xcdatamodel extension\n\t\tif not (exists folder modelSrcFolderName of modelFileFolder) then\n\t\t\tmake folder at modelFileFolder with properties {name:modelSrcFolderName}\n\t\tend if\n\t\tset modelSrcFolder to folder modelSrcFolderName of modelFileFolder\n\tend tell\n\treturn text 1 thru -2 of (POSIX path of (modelSrcFolder as alias)) -- kill the trailing slash\nend modelSrcDirPath\n\non logger(msg)\n\tdo shell script \"logger '\" & msg & \"'\"\nend logger\n","new_contents":"tell application \"Xcode\"\n\tif not (exists active project document) then \n\t\terror \"No active project. Please open an Xcode project and re-run the script.\"\n\ttry\n\t\tmy updateProjectXmod(project of active project document)\n\ton error errMsg\n\t\tmy logger(\"Xmod.scpt exception: \" & errMsg)\n\tend try\nend tell\n\non updateProjectXmod(_project)\n\ttell application \"Xcode\"\n\t\t-- Iterate over every .xcdatamodel in the project.\n\t\tset modelList to every file reference of _project whose file kind is \"wrapper.xcdatamodel\"\n\t\trepeat with modelIt in modelList\n\t\t\tif comments of modelIt contains \"xmod\" then\n\t\t\t\tset modelSrcDir to my modelSrcDirPath(full path of modelIt)\n\t\t\t\tset targetList to my everyTargetWithBuildFilePath(_project, full path of modelIt)\n\t\t\t\t\n\t\t\t\t-- Create the .xcdatamodel related source group if necessary.\n\t\t\t\tif not (exists (every item reference of group of modelIt whose full path is modelSrcDir)) then\n\t\t\t\t\ttell group of modelIt\n\t\t\t\t\t\tmake new group with properties {full path:modelSrcDir, name:text 1 thru -13 of ((name of modelIt) as string)}\n\t\t\t\t\tend tell\n\t\t\t\tend if\n\t\t\t\tset modelSrcGroup to item 1 of (every item reference of group of modelIt whose full path is modelSrcDir)\n\t\t\t\ttell modelSrcGroup to delete every item reference -- clear it out for population in case we didn't just create it\n\t\t\t\t\n\t\t\t\t--\tMeat.\n\t\t\t\tdo shell script \"\/usr\/bin\/mogenerator --model '\" & full path of modelIt & \"' --output-dir '\" & modelSrcDir & \"'\"\n\t\t\t\t\n\t\t\t\t--\tBuild a list of resulting source files.\n\t\t\t\ttell application \"System Events\"\n\t\t\t\t\tset modelSrcDirAlias to POSIX file modelSrcDir as alias\n\t\t\t\t\tset humanHeaderFileList to (every file of modelSrcDirAlias whose name ends with \".h\" and name does not start with \"_\")\n\t\t\t\t\tset humanSourceFileList to (every file of modelSrcDirAlias whose (name ends with \".m\" or name ends with \".mm\") and name does not start with \"_\")\n\t\t\t\t\tset machineHeaderFileList to (every file of modelSrcDirAlias whose name ends with \".h\" and name starts with \"_\")\n\t\t\t\t\tset machineSourceFileList to (every file of modelSrcDirAlias whose (name ends with \".m\" or name ends with \".mm\") and name starts with \"_\")\n\t\t\t\t\tset fileList to humanHeaderFileList & humanSourceFileList & machineHeaderFileList & machineSourceFileList\n\t\t\t\t\tset pathList to {}\n\t\t\t\t\trepeat with fileItem in fileList\n\t\t\t\t\t\tset pathList to pathList & POSIX path of fileItem\n\t\t\t\t\tend repeat\n\t\t\t\tend tell\n\t\t\t\t\n\t\t\t\t--\tAdd the source files to the model's source group and the model's targets.\n\t\t\t\trepeat with pathIt in pathList\n\t\t\t\t\ttell modelSrcGroup\n\t\t\t\t\t\tset modelSrcFileRef to make new file reference with properties {full path:pathIt, name:name of (info for POSIX file pathIt)}\n\t\t\t\t\t\trepeat with targetIndex from 1 to (count of targetList)\n\t\t\t\t\t\t\tset targetIt to item targetIndex of targetList\n\t\t\t\t\t\t\tadd modelSrcFileRef to targetIt\n\t\t\t\t\t\tend repeat\n\t\t\t\t\tend tell\n\t\t\t\tend repeat\n\t\t\tend if\n\t\tend repeat\n\tend tell\nend updateProjectXmod\n\non everyTargetWithBuildFilePath(_project, _buildFilePath)\n\tset theResult to {}\n\ttell application \"Xcode\"\n\t\trepeat with targetIt in (every target of _project)\n\t\t\trepeat with buildFileIt in build files of targetIt\n\t\t\t\tif full path of file reference of buildFileIt is _buildFilePath then set theResult to theResult & {(targetIt as anything)}\n\t\t\tend repeat\n\t\tend repeat\n\tend tell\n\treturn theResult\nend everyTargetWithBuildFilePath\n\non modelSrcDirPath(modelFileUnixPath)\n\tset modelFilePosixRef to POSIX file modelFileUnixPath\n\tset modelFileAlias to modelFilePosixRef as alias\n\t\n\ttell application \"Finder\"\n\t\tset modelFileFolder to folder of modelFileAlias\n\t\tset modelFileName to name of modelFileAlias\n\t\tset modelSrcFolderName to text 1 thru -13 of modelFileName -- pull off the .xcdatamodel extension\n\t\tif not (exists folder modelSrcFolderName of modelFileFolder) then\n\t\t\tmake folder at modelFileFolder with properties {name:modelSrcFolderName}\n\t\tend if\n\t\tset modelSrcFolder to folder modelSrcFolderName of modelFileFolder\n\tend tell\n\treturn text 1 thru -2 of (POSIX path of (modelSrcFolder as alias)) -- kill the trailing slash\nend modelSrcDirPath\n\non logger(msg)\n\tdo shell script \"logger '\" & msg & \"'\"\nend logger\n","subject":"add .h human+machine header files to project (in addition to current .m + .mm files). Closes #1.","message":"[CHANGE] Xmo'd: add .h human+machine header files to project (in addition to current .m + .mm files). Closes #1.\n","lang":"AppleScript","license":"mit","repos":"hardikdevios\/mogenerator,adozenlines\/mogenerator,skywinder\/mogenerator,rentzsch\/mogenerator,iv-mexx\/mogenerator,anton-matosov\/mogenerator,rentzsch\/mogenerator,iv-mexx\/mogenerator,skywinder\/mogenerator,fizker\/mogenerator,anton-matosov\/mogenerator,pronebird\/mogenerator,kostiakoval\/mogenerator,adozenlines\/mogenerator,Erin-Mounts\/mogenerator,casademora\/mogenerator,mjasa\/mogenerator,seanm\/mogenerator,willowtreeapps\/mattgenerator,bgulanowski\/mogenerator,iv-mexx\/mogenerator,seanm\/mogenerator,adozenlines\/mogenerator,bgulanowski\/mogenerator,kostiakoval\/mogenerator,mjasa\/mogenerator,casademora\/mogenerator,casademora\/mogenerator,ef-ctx\/mogenerator,pronebird\/mogenerator,untitledstartup\/mogenerator,bewebste\/mogenerator,VladimirGoncharov\/mogenerator,fizker\/mogenerator,rentzsch\/mogenerator,untitledstartup\/mogenerator,bewebste\/mogenerator,VladimirGoncharov\/mogenerator,anton-matosov\/mogenerator,untitledstartup\/mogenerator,skywinder\/mogenerator,otaran\/mogenerator,ef-ctx\/mogenerator,fizker\/mogenerator,willowtreeapps\/mattgenerator,Erin-Mounts\/mogenerator,VladimirGoncharov\/mogenerator,hardikdevios\/mogenerator,otaran\/mogenerator,seanm\/mogenerator,otaran\/mogenerator,ef-ctx\/mogenerator,pronebird\/mogenerator,willowtreeapps\/mattgenerator,mjasa\/mogenerator,bgulanowski\/mogenerator,iv-mexx\/mogenerator,Erin-Mounts\/mogenerator,kostiakoval\/mogenerator,bewebste\/mogenerator,hardikdevios\/mogenerator,bewebste\/mogenerator"}
{"commit":"ba14cdb482c61dfae762aab976f25299fb11e640","old_file":"scripts\/clear-notifications.scpt","new_file":"scripts\/clear-notifications.scpt","old_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0005\u0000\u0007\r\u0000\u0007\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0005\u0000\b\n\u0000\u0018.miscactvnull\u0000\u0000null\r\u0000\b\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0000\t\u000f\u0000\t\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000@\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001p\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000BD\u0000\u0001\u0016NotificationCenter.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\n cu\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0002\u00005\/:System:Library:CoreServices:NotificationCenter.app\/\u0000\u0000\u000e\u0000.\u0000\u0016\u0000N\u0000o\u0000t\u0000i\u0000f\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000C\u0000e\u0000n\u0000t\u0000e\u0000r\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u00002System\/Library\/CoreServices\/NotificationCenter.app\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000\n\r\u0000\n\u0000\u0003l\u0000\u0002\u0000\u0006\u0000\u0000\u000b\r\u0000\u000b\u0000\u0002O\u0000\u0000\u0000\u0006\u0000\u0000\f\u0000\r\r\u0000\f\u0000\u0002O\u0000\u0000\u0000\n\u0000\u0000\u000e\u0000\u000f\r\u0000\u000e\u0000\u0001T\u0000\u0000\u0000\u0011\u0000\u0000\u0010\r\u0000\u0010\u0000\u0001k\u0000\u0000\u0000\u0016\u0000\u0000\u0011\u0002\u0000\u0011\u0000\u0002\u0000\u0012\u0000\u0013\r\u0000\u0012\u0000\u0003l\u0000\u0002\u0000\u0016\u0000\u0016\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0013\u0000\u0002\u0000\u0014\u0000\u0015\r\u0000\u0014\u0000\u0003Q\u0000\u0000\u0000\u0016\u00001\u0000\u0016\u0000\u0017\u0000\u0018\r\u0000\u0016\u0000\u0002r\u0000\u0000\u0000\u0019\u0000(\u0000\u0019\u0000\u001a\r\u0000\u0019\u0000\u0002n\u0000\u0000\u0000\u0019\u0000&\u0000\u001b\u0000\u001c\r\u0000\u001b\u0000\u00024\u0000\u0000\u0000#\u0000&\u0000\u001d\n\u0000\u0004\nsgrp\r\u0000\u001d\u0000\u0001m\u0000\u0000\u0000$\u0000%\u0003\u0000\u0001\r\u0000\u001c\u0000\u0002n\u0000\u0000\u0000\u0019\u0000#\u0000\u001e\u0000\u001f\r\u0000\u001e\u0000\u00024\u0000\u0000\u0000 \u0000#\u0000 \n\u0000\u0004\nuiel\r\u0000 \u0000\u0001m\u0000\u0000\u0000!\u0000\"\u0003\u0000\u0001\r\u0000\u001f\u0000\u0002n\u0000\u0000\u0000\u0019\u0000 \u0000!\u0000\"\r\u0000!\u0000\u00024\u0000\u0000\u0000\u001d\u0000 \u0000#\n\u0000\u0004\nscra\r\u0000#\u0000\u0001m\u0000\u0000\u0000\u001e\u0000\u001f\u0003\u0000\u0001\r\u0000\"\u0000\u00024\u0000\u0000\u0000\u0019\u0000\u001d\u0000$\n\u0000\u0004\ncwin\r\u0000$\u0000\u0001m\u0000\u0000\u0000\u001b\u0000\u001c\u0000%\u000e\u0000%\u0000\u0001\u0000&\u0011\u0000&\u0000&\u0000N\u0000o\u0000t\u0000i\u0000f\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000 \u0000C\u0000e\u0000n\u0000t\u0000e\u0000r\r\u0000\u001a\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\tthewindow\u0000\ttheWindow\r\u0000\u0017\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000\u0018\u0000\u0000S\u0000\u0000\u00000\u00001\u0002\u0000\u0015\u0000\u0002\u0000'\u0000(\r\u0000'\u0000\u0003l\u0000\u0002\u00002\u00002\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000(\u0000\u0002\u0000)\r\u0000)\u0000\u0003Q\u0000\u0000\u00002\u0000\u0000*\u0000+\r\u0000*\u0000\u0001k\u0000\u0000\u00005\u0000\u0000,\u0002\u0000,\u0000\u0002\u0000-\u0000.\r\u0000-\u0000\u0002r\u0000\u0000\u00005\u0000:\u0000\/\u00000\r\u0000\/\u0000\u0002n\u0000\u0000\u00005\u00008\u00001\u00002\r\u00001\u0000\u00012\u0000\u0001\u00006\u00008\n\u0000\u0004\nactT\r\u00002\u0000\u0001o\u0000\u0000\u00005\u00006\u000b\u0000\u00160\u0000\tthewindow\u0000\ttheWindow\r\u00000\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00180\u0000\ntheactions\u0000\ntheActions\u0002\u0000.\u0000\u0002\u00003\u00004\r\u00003\u0000\u0003l\u0000\u0002\u0000;\u0000;\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u00004\u0000\u0002\u00005\u00006\r\u00005\u0000\u0003l\u0000\u0006\u0000;\u0000;\u00007\u00008\u0001\u0000\u0000\f\u00007\u0000S\u0000M Try to close the whole group first. If that fails, close individual windows.\u0000\u0002\u0000\u0000\u000e\u00008\u0000\u0001\u00009\u0011\u00009\u0000\u0000 \u0000T\u0000r\u0000y\u0000 \u0000t\u0000o\u0000 \u0000c\u0000l\u0000o\u0000s\u0000e\u0000 \u0000t\u0000h\u0000e\u0000 \u0000w\u0000h\u0000o\u0000l\u0000e\u0000 \u0000g\u0000r\u0000o\u0000u\u0000p\u0000 \u0000f\u0000i\u0000r\u0000s\u0000t\u0000.\u0000 \u0000I\u0000f\u0000 \u0000t\u0000h\u0000a\u0000t\u0000 \u0000f\u0000a\u0000i\u0000l\u0000s\u0000,\u0000 \u0000c\u0000l\u0000o\u0000s\u0000e\u0000 \u0000i\u0000n\u0000d\u0000i\u0000v\u0000i\u0000d\u0000u\u0000a\u0000l\u0000 \u0000w\u0000i\u0000n\u0000d\u0000o\u0000w\u0000s\u0000.\u0002\u00006\u0000\u0002\u0000:\u0000;\r\u0000:\u0000\u0003X\u0000\u0000\u0000;\u0000t\u0000<\u0000=\r\u0000<\u0000\u0004Z\u0000\u0000\u0000M\u0000o\u0000>\u0000?\r\u0000>\u0000\u0002=\u0000\u0003\u0000M\u0000V\u0000@\u0000A\r\u0000@\u0000\u0002n\u0000\u0000\u0000M\u0000R\u0000B\u0000C\r\u0000B\u0000\u00011\u0000\u0000\u0000N\u0000R\n\u0000\u0004\ndesc\r\u0000C\u0000\u0001o\u0000\u0000\u0000M\u0000N\u000b\u0000\u00160\u0000\ttheaction\u0000\ttheAction\r\u0000A\u0000\u0001m\u0000\u0000\u0000R\u0000U\u0000D\u000e\u0000D\u0000\u0001\u0000E\u0011\u0000E\u0000\u0012\u0000C\u0000l\u0000e\u0000a\u0000r\u0000 \u0000A\u0000l\u0000l\r\u0000?\u0000\u0001k\u0000\u0000\u0000Y\u0000k\u0000F\u0002\u0000F\u0000\u0002\u0000G\u0000H\r\u0000G\u0000\u0002r\u0000\u0000\u0000Y\u0000^\u0000I\u0000J\r\u0000I\u0000\u0001m\u0000\u0000\u0000Y\u0000Z\n\u0000\b\u000bboovtrue\r\u0000J\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\n0\u0000\u0006closed\u0000\u0000\u0002\u0000H\u0000\u0002\u0000K\u0000L\r\u0000K\u0000\u0002O\u0000\u0000\u0000_\u0000i\u0000M\u0000N\r\u0000M\u0000\u0003I\u0000\u0002\u0000c\u0000h\u0000O\n\u0000\u0018.prcsperfnull\u0000\u0000\u0000\u0000\u0000actT\r\u0000O\u0000\u0001o\u0000\u0000\u0000c\u0000d\u000b\u0000\u00160\u0000\ttheaction\u0000\ttheAction\u0002\u0000\u0000\r\u0000N\u0000\u0001o\u0000\u0000\u0000_\u0000`\u000b\u0000\u00160\u0000\tthewindow\u0000\ttheWindow\u0002\u0000L\u0000\u0002\u0000P\r\u0000P\u0000\u0000S\u0000\u0000\u0000j\u0000k\u0002\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u000b\u0000\u00160\u0000\ttheaction\u0000\ttheAction\r\u0000=\u0000\u0001o\u0000\u0000\u0000>\u0000?\u000b\u0000\u00180\u0000\ntheactions\u0000\ntheActions\u0002\u0000;\u0000\u0002\u0000Q\u0000R\r\u0000Q\u0000\u0003l\u0000\u0002\u0000u\u0000u\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000R\u0000\u0002\u0000S\u0000T\r\u0000S\u0000\u0003X\u0000\u0000\u0000u\u0000\u0000U\u0000V\r\u0000U\u0000\u0004Z\u0000\u0000\u0000\u0000\u0000W\u0000X\r\u0000W\u0000\u0002=\u0000\u0003\u0000\u0000\u0000Y\u0000Z\r\u0000Y\u0000\u0002n\u0000\u0000\u0000\u0000\u0000[\u0000\\\r\u0000[\u0000\u00011\u0000\u0000\u0000\u0000\n\u0000\u0004\ndesc\r\u0000\\\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\ttheaction\u0000\ttheAction\r\u0000Z\u0000\u0001m\u0000\u0000\u0000\u0000\u0000]\u000e\u0000]\u0000\u0001\u0000^\u0011\u0000^\u0000\n\u0000C\u0000l\u0000o\u0000s\u0000e\r\u0000X\u0000\u0001k\u0000\u0000\u0000\u0000\u0000_\u0002\u0000_\u0000\u0002\u0000`\u0000a\r\u0000`\u0000\u0002r\u0000\u0000\u0000\u0000\u0000b\u0000c\r\u0000b\u0000\u0001m\u0000\u0000\u0000\u0000\n\u0000\b\u000bboovtrue\r\u0000c\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\n0\u0000\u0006closed\u0000\u0000\u0002\u0000a\u0000\u0002\u0000d\u0000e\r\u0000d\u0000\u0002O\u0000\u0000\u0000\u0000\u0000f\u0000g\r\u0000f\u0000\u0003I\u0000\u0002\u0000\u0000\u0000h\n\u0000\u0018.prcsperfnull\u0000\u0000\u0000\u0000\u0000actT\r\u0000h\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\ttheaction\u0000\ttheAction\u0002\u0000\u0000\r\u0000g\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\tthewindow\u0000\ttheWindow\u0002\u0000e\u0000\u0002\u0000i\r\u0000i\u0000\u0000S\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u000b\u0000\u00160\u0000\ttheaction\u0000\ttheAction\r\u0000V\u0000\u0001o\u0000\u0000\u0000x\u0000y\u000b\u0000\u00180\u0000\ntheactions\u0000\ntheActions\u0002\u0000T\u0000\u0002\u0000j\r\u0000j\u0000\u0003l\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000+\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000\u000f\u0000\u00024\u0000\u0000\u0000\n\u0000\u000e\u0000k\n\u0000\u0004\nprcs\r\u0000k\u0000\u0001m\u0000\u0000\u0000\f\u0000\r\u0000l\u000e\u0000l\u0000\u0001\u0000m\u0011\u0000m\u0000&\u0000N\u0000o\u0000t\u0000i\u0000f\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000 \u0000C\u0000e\u0000n\u0000t\u0000e\u0000r\r\u0000\r\u0000\u0001m\u0000\u0000\u0000\u0006\u0000\u0007\u0000n\u000f\u0000n\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sevs\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001\\\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000BD\u0000\u0001\u0011System Events.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\n cu\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0002\u00000\/:System:Library:CoreServices:System Events.app\/\u0000\u000e\u0000$\u0000\u0011\u0000S\u0000y\u0000s\u0000t\u0000e\u0000m\u0000 \u0000E\u0000v\u0000e\u0000n\u0000t\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000-System\/Library\/CoreServices\/System Events.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0006\u0000o\u0000p\u0000q\u0000r\u0001\u0000\u0000\u0010\u0000o\u0000\u0004\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000b\u0000\u00160\u0000\tthewindow\u0000\ttheWindow\u000b\u0000\u00180\u0000\ntheactions\u0000\ntheActions\u000b\u0000\n0\u0000\u0006closed\u0000\u0000\u000e\u0000p\u0000\u0007\u0010\u0000s\u0000t\u0000u\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000s\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000v\u0002\u0000v\u0000\u0002\u0000\u0005\u0000w\u0002\u0000w\u0000\u0002\u0000\n\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000t\u0000\u0001\u000b\u0000\u00160\u0000\ttheaction\u0000\ttheAction\u0010\u0000u\u0000\u0017\u0000\t\u0000n\u0000l\u0000%\u0000D\u0000]\n\u0000\u0018.miscactvnull\u0000\u0000null\n\u0000\u0004\nprcs\n\u0000\u0004\ncwin\n\u0000\u0004\nscra\n\u0000\u0004\nuiel\n\u0000\u0004\nsgrp\u000b\u0000\u00160\u0000\tthewindow\u0000\ttheWindow\u0001\u0000\u0000\u0002\u0000\u0000\n\u0000\u0004\nactT\u000b\u0000\u00180\u0000\ntheactions\u0000\ntheActions\n\u0000\u0004\nkocl\n\u0000\u0004\ncobj\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\n\u0000\u0004\ndesc\u000b\u0000\n0\u0000\u0006closed\u0000\u0000\n\u0000\u0018.prcsperfnull\u0000\u0000\u0000\u0000\u0000actT\u0011\u0000j\f\u0000\u0001O\u0012\u0000*\/\u0012\u0000\u0017\u0000hZ\u0014\u0000\u0014*\/k\/k\/k\/EW\u0000\bX\u0000\u000b\u0000\f\u0016O\u0014\u0000-EO\u0017\u00008[a\u0000\u0010l\f\u0000\u0011kh\u001b\u0000\u0000a\u0000\u0012,a\u0000\u0013\u0000\u001d\u0000\u0017eE`\u0000\u0014O\u0012\u0000\u0007j\f\u0000\u0015UO\u0016Y\u0000\u0003h[OYO\u0017\u00008[a\u0000\u0010l\f\u0000\u0011kh\u001b\u0000\u0000a\u0000\u0012,a\u0000\u0016\u0000\u001d\u0000\u0017eE`\u0000\u0014O\u0012\u0000\u0007j\f\u0000\u0015UO\u0016Y\u0000\u0003h[OYOPW\u0000\bX\u0000\u000b\u0000\fh[OYYUU\u000f\u000e\u0000q\u0000\u0001\u0014\u0000x\u000e\u0000x\u0000\u0003\u0018\u0000y\u000e\u0000y\u0000\u0003\u0018\u0000z\u000e\u0000z\u0000\u0003\u0018\u0000{\u000e\u0000{\u0000\u0003\u0018\u0000|\u0000}\u000e\u0000|\u0000\u0003\u0018\u0000n\u0000~\n\u0000\u0004\npcap\u000e\u0000~\u0000\u0001\u0000\u0011\u0000\u0000$\u0000N\u0000o\u0000t\u0000i\u0000f\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000C\u0000e\u0000n\u0000t\u0000e\u0000r\n\u0000\u0004\ncwin\u000e\u0000}\u0000\u0001\u0000\u0011\u0000\u0000&\u0000N\u0000o\u0000t\u0000i\u0000f\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000 \u0000C\u0000e\u0000n\u0000t\u0000e\u0000r\n\u0000\u0004\nscra\u0003\u0000\u0001\n\u0000\u0004\nuiel\u0003\u0000\u0001\n\u0000\u0004\nsgrp\u0003\u0000\u0001\u000e\u0000r\u0000\u0002\u0004\u0000\u0003\u0000\u0002\u000e\u0000\u0000\u0002\u0000\u0000\u0000\u000e\u0000\u0000\u0001\u0014\u0000\u000e\u0000\u0000\u0003\u0018\u0000\u0000\u000e\u0000\u0000\u0003\u0018\u0000\u000e\u0000\u0000\u0003\u0018\u0000\u000e\u0000\u0000\u0003\u0018\u0000\u000e\u0000\u0000\u0003\u0018\u0000\u0000\u000e\u0000\u0000\u0003\u0018\u0000n\u0000\n\u0000\u0004\npcap\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000$\u0000N\u0000o\u0000t\u0000i\u0000f\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000C\u0000e\u0000n\u0000t\u0000e\u0000r\n\u0000\u0004\ncwin\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000&\u0000N\u0000o\u0000t\u0000i\u0000f\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000 \u0000C\u0000e\u0000n\u0000t\u0000e\u0000r\n\u0000\u0004\nscra\u0003\u0000\u0001\n\u0000\u0004\nuiel\u0003\u0000\u0001\n\u0000\u0004\nsgrp\u0003\u0000\u0001\n\u0000\u0004\nactT\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\"\u0000A\u0000X\u0000S\u0000c\u0000r\u0000o\u0000l\u0000l\u0000T\u0000o\u0000V\u0000i\u0000s\u0000i\u0000b\u0000l\u0000e\u000e\u0000\u0000\u0001\u0014\u0000\u000e\u0000\u0000\u0003\u0018\u0000\u0000\u000e\u0000\u0000\u0003\u0018\u0000\u000e\u0000\u0000\u0003\u0018\u0000\u000e\u0000\u0000\u0003\u0018\u0000\u000e\u0000\u0000\u0003\u0018\u0000\u0000\u000e\u0000\u0000\u0003\u0018\u0000n\u0000\n\u0000\u0004\npcap\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000$\u0000N\u0000o\u0000t\u0000i\u0000f\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000C\u0000e\u0000n\u0000t\u0000e\u0000r\n\u0000\u0004\ncwin\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000&\u0000N\u0000o\u0000t\u0000i\u0000f\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000 \u0000C\u0000e\u0000n\u0000t\u0000e\u0000r\n\u0000\u0004\nscra\u0003\u0000\u0001\n\u0000\u0004\nuiel\u0003\u0000\u0001\n\u0000\u0004\nsgrp\u0003\u0000\u0001\n\u0000\u0004\nactT\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0014\u0000A\u0000X\u0000S\u0000h\u0000o\u0000w\u0000M\u0000e\u0000n\u0000u\n\u0000\b\u000bboovtrue\u0000ascr\u0000\u0001\u0000\r\u07ad","new_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0002i\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0007\u0000\b\r\u0000\u0007\u0000\u0003I\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000(0\u0000\u0012clearnotifications\u0000\u0012clearNotifications\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\b\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\t\u0002\u0000\t\u0000\u0002\u0000\n\u0000\u000b\r\u0000\n\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0005\u0000\f\n\u0000\u0018.miscactvnull\u0000\u0000null\r\u0000\f\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0000\r\u000f\u0000\r\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000@\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001p\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000BD\u0000\u0001\u0016NotificationCenter.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\n cu\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0002\u00005\/:System:Library:CoreServices:NotificationCenter.app\/\u0000\u0000\u000e\u0000.\u0000\u0016\u0000N\u0000o\u0000t\u0000i\u0000f\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000C\u0000e\u0000n\u0000t\u0000e\u0000r\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u00002System\/Library\/CoreServices\/NotificationCenter.app\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u000b\u0000\u0002\u0000\u000e\r\u0000\u000e\u0000\u0002O\u0000\u0000\u0000\u0006\u0000\u0000\u000f\u0000\u0010\r\u0000\u000f\u0000\u0002O\u0000\u0000\u0000\n\u0000\u0000\u0011\u0000\u0012\r\u0000\u0011\u0000\u0001T\u0000\u0000\u0000\u0011\u0000\u0000\u0013\r\u0000\u0013\u0000\u0001k\u0000\u0000\u0000\u0016\u0000\u0000\u0014\u0002\u0000\u0014\u0000\u0002\u0000\u0015\u0000\u0016\r\u0000\u0015\u0000\u0003l\u0000\u0002\u0000\u0016\u0000\u0016\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0016\u0000\u0002\u0000\u0017\u0000\u0018\r\u0000\u0017\u0000\u0003Q\u0000\u0000\u0000\u0016\u00001\u0000\u0019\u0000\u001a\u0000\u001b\r\u0000\u0019\u0000\u0002r\u0000\u0000\u0000\u0019\u0000(\u0000\u001c\u0000\u001d\r\u0000\u001c\u0000\u0002n\u0000\u0000\u0000\u0019\u0000&\u0000\u001e\u0000\u001f\r\u0000\u001e\u0000\u00024\u0000\u0000\u0000#\u0000&\u0000 \n\u0000\u0004\nsgrp\r\u0000 \u0000\u0001m\u0000\u0000\u0000$\u0000%\u0003\u0000\u0001\r\u0000\u001f\u0000\u0002n\u0000\u0000\u0000\u0019\u0000#\u0000!\u0000\"\r\u0000!\u0000\u00024\u0000\u0000\u0000 \u0000#\u0000#\n\u0000\u0004\nuiel\r\u0000#\u0000\u0001m\u0000\u0000\u0000!\u0000\"\u0003\u0000\u0001\r\u0000\"\u0000\u0002n\u0000\u0000\u0000\u0019\u0000 \u0000$\u0000%\r\u0000$\u0000\u00024\u0000\u0000\u0000\u001d\u0000 \u0000&\n\u0000\u0004\nscra\r\u0000&\u0000\u0001m\u0000\u0000\u0000\u001e\u0000\u001f\u0003\u0000\u0001\r\u0000%\u0000\u00024\u0000\u0000\u0000\u0019\u0000\u001d\u0000'\n\u0000\u0004\ncwin\r\u0000'\u0000\u0001m\u0000\u0000\u0000\u001b\u0000\u001c\u0000(\u000e\u0000(\u0000\u0001\u0000)\u0011\u0000)\u0000&\u0000N\u0000o\u0000t\u0000i\u0000f\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000 \u0000C\u0000e\u0000n\u0000t\u0000e\u0000r\r\u0000\u001d\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\tthewindow\u0000\ttheWindow\r\u0000\u001a\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000\u001b\u0000\u0000S\u0000\u0000\u00000\u00001\u0002\u0000\u0018\u0000\u0002\u0000*\u0000+\r\u0000*\u0000\u0003l\u0000\u0002\u00002\u00002\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000+\u0000\u0002\u0000,\r\u0000,\u0000\u0003Q\u0000\u0000\u00002\u0000\u0000-\u0000.\r\u0000-\u0000\u0001k\u0000\u0000\u00005\u0000\u0000\/\u0002\u0000\/\u0000\u0002\u00000\u00001\r\u00000\u0000\u0002r\u0000\u0000\u00005\u0000:\u00002\u00003\r\u00002\u0000\u0002n\u0000\u0000\u00005\u00008\u00004\u00005\r\u00004\u0000\u00012\u0000\u0001\u00006\u00008\n\u0000\u0004\nactT\r\u00005\u0000\u0001o\u0000\u0000\u00005\u00006\u000b\u0000\u00160\u0000\tthewindow\u0000\ttheWindow\r\u00003\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00180\u0000\ntheactions\u0000\ntheActions\u0002\u00001\u0000\u0002\u00006\u00007\r\u00006\u0000\u0003l\u0000\u0002\u0000;\u0000;\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u00007\u0000\u0002\u00008\u00009\r\u00008\u0000\u0003l\u0000\u0006\u0000;\u0000;\u0000:\u0000;\u0001\u0000\u0000\f\u0000:\u0000S\u0000M Try to close the whole group first. If that fails, close individual windows.\u0000\u0002\u0000\u0000\u000e\u0000;\u0000\u0001\u0000<\u0011\u0000<\u0000\u0000 \u0000T\u0000r\u0000y\u0000 \u0000t\u0000o\u0000 \u0000c\u0000l\u0000o\u0000s\u0000e\u0000 \u0000t\u0000h\u0000e\u0000 \u0000w\u0000h\u0000o\u0000l\u0000e\u0000 \u0000g\u0000r\u0000o\u0000u\u0000p\u0000 \u0000f\u0000i\u0000r\u0000s\u0000t\u0000.\u0000 \u0000I\u0000f\u0000 \u0000t\u0000h\u0000a\u0000t\u0000 \u0000f\u0000a\u0000i\u0000l\u0000s\u0000,\u0000 \u0000c\u0000l\u0000o\u0000s\u0000e\u0000 \u0000i\u0000n\u0000d\u0000i\u0000v\u0000i\u0000d\u0000u\u0000a\u0000l\u0000 \u0000w\u0000i\u0000n\u0000d\u0000o\u0000w\u0000s\u0000.\u0002\u00009\u0000\u0002\u0000=\u0000>\r\u0000=\u0000\u0003X\u0000\u0000\u0000;\u0000p\u0000?\u0000@\r\u0000?\u0000\u0004Z\u0000\u0000\u0000K\u0000k\u0000A\u0000B\r\u0000A\u0000\u0002=\u0000\u0003\u0000K\u0000T\u0000C\u0000D\r\u0000C\u0000\u0002n\u0000\u0000\u0000K\u0000P\u0000E\u0000F\r\u0000E\u0000\u00011\u0000\u0000\u0000L\u0000P\n\u0000\u0004\ndesc\r\u0000F\u0000\u0001o\u0000\u0000\u0000K\u0000L\u000b\u0000\u00160\u0000\ttheaction\u0000\ttheAction\r\u0000D\u0000\u0001m\u0000\u0000\u0000P\u0000S\u0000G\u000e\u0000G\u0000\u0001\u0000H\u0011\u0000H\u0000\u0012\u0000C\u0000l\u0000e\u0000a\u0000r\u0000 \u0000A\u0000l\u0000l\r\u0000B\u0000\u0001k\u0000\u0000\u0000W\u0000g\u0000I\u0002\u0000I\u0000\u0002\u0000J\u0000K\r\u0000J\u0000\u0002r\u0000\u0000\u0000W\u0000Z\u0000L\u0000M\r\u0000L\u0000\u0001m\u0000\u0000\u0000W\u0000X\n\u0000\b\u000bboovtrue\r\u0000M\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\n0\u0000\u0006closed\u0000\u0000\u0002\u0000K\u0000\u0002\u0000N\u0000O\r\u0000N\u0000\u0002O\u0000\u0000\u0000[\u0000e\u0000P\u0000Q\r\u0000P\u0000\u0003I\u0000\u0002\u0000_\u0000d\u0000R\n\u0000\u0018.prcsperfnull\u0000\u0000\u0000\u0000\u0000actT\r\u0000R\u0000\u0001o\u0000\u0000\u0000_\u0000`\u000b\u0000\u00160\u0000\ttheaction\u0000\ttheAction\u0002\u0000\u0000\r\u0000Q\u0000\u0001o\u0000\u0000\u0000[\u0000\\\u000b\u0000\u00160\u0000\tthewindow\u0000\ttheWindow\u0002\u0000O\u0000\u0002\u0000S\r\u0000S\u0000\u0000S\u0000\u0000\u0000f\u0000g\u0002\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u000b\u0000\u00160\u0000\ttheaction\u0000\ttheAction\r\u0000@\u0000\u0001o\u0000\u0000\u0000>\u0000?\u000b\u0000\u00180\u0000\ntheactions\u0000\ntheActions\u0002\u0000>\u0000\u0002\u0000T\u0000U\r\u0000T\u0000\u0003l\u0000\u0002\u0000q\u0000q\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000U\u0000\u0002\u0000V\u0000W\r\u0000V\u0000\u0003X\u0000\u0000\u0000q\u0000\u0000X\u0000Y\r\u0000X\u0000\u0004Z\u0000\u0000\u0000\u0000\u0000Z\u0000[\r\u0000Z\u0000\u0002=\u0000\u0003\u0000\u0000\u0000\\\u0000]\r\u0000\\\u0000\u0002n\u0000\u0000\u0000\u0000\u0000^\u0000_\r\u0000^\u0000\u00011\u0000\u0000\u0000\u0000\n\u0000\u0004\ndesc\r\u0000_\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\ttheaction\u0000\ttheAction\r\u0000]\u0000\u0001m\u0000\u0000\u0000\u0000\u0000`\u000e\u0000`\u0000\u0001\u0000a\u0011\u0000a\u0000\n\u0000C\u0000l\u0000o\u0000s\u0000e\r\u0000[\u0000\u0001k\u0000\u0000\u0000\u0000\u0000b\u0002\u0000b\u0000\u0002\u0000c\u0000d\r\u0000c\u0000\u0002r\u0000\u0000\u0000\u0000\u0000e\u0000f\r\u0000e\u0000\u0001m\u0000\u0000\u0000\u0000\n\u0000\b\u000bboovtrue\r\u0000f\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\n0\u0000\u0006closed\u0000\u0000\u0002\u0000d\u0000\u0002\u0000g\u0000h\r\u0000g\u0000\u0002O\u0000\u0000\u0000\u0000\u0000i\u0000j\r\u0000i\u0000\u0003I\u0000\u0002\u0000\u0000\u0000k\n\u0000\u0018.prcsperfnull\u0000\u0000\u0000\u0000\u0000actT\r\u0000k\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\ttheaction\u0000\ttheAction\u0002\u0000\u0000\r\u0000j\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\tthewindow\u0000\ttheWindow\u0002\u0000h\u0000\u0002\u0000l\r\u0000l\u0000\u0000S\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u000b\u0000\u00160\u0000\ttheaction\u0000\ttheAction\r\u0000Y\u0000\u0001o\u0000\u0000\u0000t\u0000u\u000b\u0000\u00180\u0000\ntheactions\u0000\ntheActions\u0002\u0000W\u0000\u0002\u0000m\r\u0000m\u0000\u0003l\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000.\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000\u0012\u0000\u00024\u0000\u0000\u0000\n\u0000\u000e\u0000n\n\u0000\u0004\nprcs\r\u0000n\u0000\u0001m\u0000\u0000\u0000\f\u0000\r\u0000o\u000e\u0000o\u0000\u0001\u0000p\u0011\u0000p\u0000&\u0000N\u0000o\u0000t\u0000i\u0000f\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000 \u0000C\u0000e\u0000n\u0000t\u0000e\u0000r\r\u0000\u0010\u0000\u0001m\u0000\u0000\u0000\u0006\u0000\u0007\u0000q\u000f\u0000q\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sevs\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001\\\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000BD\u0000\u0001\u0011System Events.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\n cu\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0002\u00000\/:System:Library:CoreServices:System Events.app\/\u0000\u000e\u0000$\u0000\u0011\u0000S\u0000y\u0000s\u0000t\u0000e\u0000m\u0000 \u0000E\u0000v\u0000e\u0000n\u0000t\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000-System\/Library\/CoreServices\/System Events.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000r\u0000s\r\u0000r\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000s\u0000\u0002\u0000t\r\u0000t\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0005\u0000u\r\u0000u\u0000\u0003I\u0000\u0000\u0000\u0000\u0000\u0005\u000b\u0000(0\u0000\u0012clearnotifications\u0000\u0012clearNotifications\u0002\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0004\u0000v\u0000w\u0000x\u0001\u0000\u0000\u0010\u0000v\u0000\u0002\u000b\u0000(0\u0000\u0012clearnotifications\u0000\u0012clearNotifications\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000e\u0000w\u0000\u0007\u0010\u0000\b\u0000y\u0000z\u000b\u0000(0\u0000\u0012clearnotifications\u0000\u0012clearNotifications\u0002\u0000\u0000\u0002\u0000\u0000\u0010\u0000y\u0000\u0004\u000b\u0000\u00160\u0000\tthewindow\u0000\ttheWindow\u000b\u0000\u00180\u0000\ntheactions\u0000\ntheActions\u000b\u0000\u00160\u0000\ttheaction\u0000\ttheAction\u000b\u0000\n0\u0000\u0006closed\u0000\u0000\u0010\u0000z\u0000\u0014\u0000\r\u0000q\u0000o\u0000(\u0000G\u0000`\n\u0000\u0018.miscactvnull\u0000\u0000null\n\u0000\u0004\nprcs\n\u0000\u0004\ncwin\n\u0000\u0004\nscra\n\u0000\u0004\nuiel\n\u0000\u0004\nsgrp\u0001\u0000\u0000\u0002\u0000\u0000\n\u0000\u0004\nactT\n\u0000\u0004\nkocl\n\u0000\u0004\ncobj\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\n\u0000\u0004\ndesc\n\u0000\u0018.prcsperfnull\u0000\u0000\u0000\u0000\u0000actT\u0011\u0000j\f\u0000\u0001O\u0012\u0000*\/\u0012\u0000\u0017\u0000hZ\u0014\u0000\u0014*\/k\/k\/k\/EW\u0000\bX\u0000\n\u0000\u000b\u0016O\u0014\u0000x-EO\u0017\u00004[l\f\u0000\u000fkh\u001b\u0000\u0002a\u0000\u0010,a\u0000\u0011\u0000\u001d\u0000\u0015eEO\u0012\u0000\u0007j\f\u0000\u0012UO\u0016Y\u0000\u0003h[OYO\u0017\u00004[l\f\u0000\u000fkh\u001b\u0000\u0002a\u0000\u0010,a\u0000\u0013\u0000\u001d\u0000\u0015eEO\u0012\u0000\u0007j\f\u0000\u0012UO\u0016Y\u0000\u0003h[OYOPW\u0000\bX\u0000\n\u0000\u000bh[OYaUU\u000f\u000e\u0000x\u0000\u0007\u0010\u0000{\u0000|\u0000}\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000{\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0005\u0000~\u0002\u0000~\u0000\u0002\u0000t\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000|\u0000\u0000\u0010\u0000}\u0000\u0001\u000b\u0000(0\u0000\u0012clearnotifications\u0000\u0012clearNotifications\u0011\u0000\u0006*j+\u0000\u0000\u000fascr\u0000\u0001\u0000\f\u07ad","subject":"Fix up clear notifs to put all into a handler","message":"Fix up clear notifs to put all into a handler\n","lang":"AppleScript","license":"mit","repos":"nicksergeant\/dotfiles,nicksergeant\/dotfiles"}
{"commit":"d7b86bcbf56242a99c6a17959ef573d69de637b8","old_file":"etc\/pdf.scpt","new_file":"etc\/pdf.scpt","old_contents":"############################\n# How to generate the PDFs #\n############################\n# 1. Generate Cover.pdf with latest version date\n#    a. Create \"ebook\" folder in ~\/Downloads\n#    b. update date in cover.html\n#    c. open in safari file:\/\/\/Users\/frank\/Sites\/ServerlessStackCom\/etc\/cover.html\n#    d. \"Export to PDF\u2026\"\n#    e. Place Cover.pdf in ~\/ebook folder\n# 2. Ensure \"ebook\" folder is an option when \"Export to PDF\u2026\" in Safari\n# 3. In terminal, run \"osascript pdf.scpt\"\n\n\nset theChaptersStr to \"index\nwho-is-this-guide-for\nwhat-does-this-guide-cover\nhow-to-get-help\nwhat-is-serverless\nwhat-is-aws-lambda\nwhy-create-serverless-apps\ncreate-an-aws-account\ncreate-an-iam-user\nwhat-is-iam\nwhat-is-an-arn\nconfigure-the-aws-cli\ncreate-a-dynamodb-table\ncreate-an-s3-bucket-for-file-uploads\ncreate-a-cognito-user-pool\ncreate-a-cognito-test-user\nsetup-the-serverless-framework\nadd-support-for-es6-es7-javascript\nadd-a-create-note-api\nadd-a-get-note-api\nadd-a-list-all-the-notes-api\nadd-an-update-note-api\nadd-a-delete-note-api\ndeploy-the-apis\ncreate-a-cognito-identity-pool\ncognito-user-pool-vs-identity-pool\ntest-the-apis\ncreate-a-new-reactjs-app\nadd-app-favicons\nsetup-custom-fonts\nsetup-bootstrap\nhandle-routes-with-react-router\ncreate-containers\nadding-links-in-the-navbar\nhandle-404s\nconfigure-aws-amplify\ncreate-a-login-page\nlogin-with-aws-cognito\nadd-the-session-to-the-state\nload-the-state-from-the-session\nclear-the-session-on-logout\nredirect-on-login-and-logout\ngive-feedback-while-logging-in\ncreate-a-signup-page\ncreate-the-signup-form\nsignup-with-aws-cognito\nadd-the-create-note-page\ncall-the-create-api\nupload-a-file-to-s3\nlist-all-the-notes\ncall-the-list-api\ndisplay-a-note\nrender-the-note-form\nsave-changes-to-a-note\ndelete-a-note\nsetup-secure-pages\ncreate-a-route-that-redirects\nuse-the-redirect-routes\nredirect-on-login\ndeploy-the-frontend\ncreate-an-s3-bucket\ndeploy-to-s3\ncreate-a-cloudfront-distribution\nsetup-your-domain-with-cloudfront\nsetup-www-domain-redirect\nsetup-ssl\ndeploy-updates\nupdate-the-app\ndeploy-again\ngetting-production-ready\ninitialize-the-backend-repo\norganize-the-backend-repo\nwhat-is-infrastructure-as-code\nconfigure-dynamodb-in-serverless\nconfigure-s3-in-serverless\nconfigure-cognito-user-pool-in-serverless\nconfigure-cognito-identity-pool-in-serverless\nuse-environment-variables-in-lambda-functions\ndeploy-your-serverless-infrastructure\nworking-with-3rd-party-apis\nsetup-a-stripe-account\nadd-a-billing-api\nload-secrets-from-env-yml\ntest-the-billing-api\nunit-tests-in-serverless\nautomating-serverless-deployments\nsetting-up-your-project-on-seed\nconfigure-secrets-in-seed\ndeploying-through-seed\nset-custom-domains-through-seed\ntest-the-configured-apis\nmonitoring-deployments-in-seed\ninitialize-the-frontend-repo\nmanage-environments-in-create-react-app\ncreate-a-settings-page\nadd-stripe-keys-to-config\ncreate-a-billing-form\nconnect-the-billing-form\nautomating-react-deployments\ncreate-a-build-script\nsetting-up-your-project-on-netlify\ncustom-domain-in-netlify\nfrontend-workflow\nwrapping-up\nfurther-reading\ngiving-back\nchangelog\nstaying-up-to-date\norganizing-serverless-projects\ncross-stack-references-in-serverless\ndynamodb-as-a-serverless-service\ns3-as-a-serverless-service\napi-gateway-domains-across-services\ncognito-as-a-serverless-service\ndeploying-multiple-services-in-serverless\napi-gateway-and-lambda-logs\ndebugging-serverless-api-issues\nserverless-environment-variables\nstages-in-serverless-framework\nconfigure-multiple-aws-profiles\ncustomize-the-serverless-iam-policy\nmapping-cognito-identity-id-and-user-pool-id\nconnect-to-api-gateway-with-iam-auth\nserverless-nodejs-starter\nmanage-user-accounts-in-aws-amplify\nhandle-forgot-and-reset-password\nallow-users-to-change-passwords\nallow-users-to-change-their-email\ncode-splitting-in-create-react-app\nenvironments-in-create-react-app\nfacebook-login-with-cognito-using-aws-amplify\n\"\n\nset text item delimiters to \"\n\"\n\nset theChapters to text items of theChaptersStr\n\n\n########\n# Main #\n########\ndownloadPdfs(theChapters)\nmergePdfs(theChapters)\n\n##############\n# Merge PDFs #\n##############\non mergePdfs(theChapters)\n  set outputFile to \"~\/Downloads\/ebook\/ServerlessStack.pdf\"\n\n  set pdfFiles to \"~\/Downloads\/ebook\/Cover.pdf\"\n  repeat with theCurrentChapter in theChapters\n    set pdfFiles to pdfFiles & \" ~\/Downloads\/ebook\/\" & theCurrentChapter & \".pdf\"\n  end repeat\n\n  do shell script \"\/System\/Library\/Automator\/Combine\\\\ PDF\\\\ Pages.action\/Contents\/Resources\/join.py \" & \"-o \" & outputFile & \" \" & pdfFiles\nend mergePdfs\n\n#################\n# Download PDFs #\n#################\non downloadPdfs(theChapters)\n  repeat with theCurrentChapter in theChapters\n    if not(checkFileExist(theCurrentChapter)) then\n      downloadPdf(theCurrentChapter)\n    end if\n  end repeat\nend downloadPdfs\n\non checkFileExist(theChapterName)\n  set basePath to POSIX path of (path to home folder) & \"Downloads\/ebook\/\"\n\n  tell application \"Finder\"\n    return exists basePath & theChapterName & \".pdf\" as POSIX file\n  end tell\nend checkFileExist\n\non downloadPdf(theChapterName)\n  tell application \"System Events\"\n\n    tell process \"Safari\"\n      set frontmost to true\n\n      if ((theChapterName as string) is equal to \"index\") then\n        set urlPath to theChapterName\n      else\n        set urlPath to \"chapters\/\" & theChapterName\n      end if\n      open location \"https:\/\/serverless-stack.com\/\" & urlPath & \".html\"\n\n      delay 1\n\n      repeat until menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 exists\n        delay 0.2\n      end repeat\n      repeat until menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 is enabled\n        delay 0.2\n      end repeat\n      click menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1\n\n      tell window 1\n        repeat until sheet 1 exists\n        end repeat\n\n        tell sheet 1\n          keystroke theChapterName\n          click pop up button \"Where:\"\n\n          repeat until menu 1 of pop up button \"Where:\" exists\n          end repeat\n          click menu item \"ebook\" of menu 1 of pop up button \"Where:\"\n          click button \"Save\"\n        end tell\n\n      end tell\n\n      click menu item \"Close Tab\" of menu \"File\" of menu bar 1\n\n    end tell\n\n  end tell\nend downloadPdf\n","new_contents":"############################\n# How to generate the PDFs #\n############################\n# 1. Generate Cover.pdf with latest version date\n#    a. Create \"ebook\" folder in ~\/Downloads\n#    b. update date in cover.html\n#    c. open in safari file:\/\/\/Users\/frank\/Sites\/ServerlessStackCom\/etc\/cover.html\n#    d. \"Export to PDF\u2026\"\n#    e. Place Cover.pdf in ~\/ebook folder\n# 2. Ensure \"ebook\" folder is an option when \"Export to PDF\u2026\" in Safari\n# 3. In terminal, run \"osascript pdf.scpt\"\n\n\nset theChaptersStr to \"index\nwho-is-this-guide-for\nwhat-does-this-guide-cover\nhow-to-get-help\nwhat-is-serverless\nwhat-is-aws-lambda\nwhy-create-serverless-apps\ncreate-an-aws-account\ncreate-an-iam-user\nwhat-is-iam\nwhat-is-an-arn\nconfigure-the-aws-cli\ncreate-a-dynamodb-table\ncreate-an-s3-bucket-for-file-uploads\ncreate-a-cognito-user-pool\ncreate-a-cognito-test-user\nsetup-the-serverless-framework\nadd-support-for-es6-es7-javascript\nadd-a-create-note-api\nadd-a-get-note-api\nadd-a-list-all-the-notes-api\nadd-an-update-note-api\nadd-a-delete-note-api\ndeploy-the-apis\ncreate-a-cognito-identity-pool\ncognito-user-pool-vs-identity-pool\ntest-the-apis\ncreate-a-new-reactjs-app\nadd-app-favicons\nsetup-custom-fonts\nsetup-bootstrap\nhandle-routes-with-react-router\ncreate-containers\nadding-links-in-the-navbar\nhandle-404s\nconfigure-aws-amplify\ncreate-a-login-page\nlogin-with-aws-cognito\nadd-the-session-to-the-state\nload-the-state-from-the-session\nclear-the-session-on-logout\nredirect-on-login-and-logout\ngive-feedback-while-logging-in\ncreate-a-signup-page\ncreate-the-signup-form\nsignup-with-aws-cognito\nadd-the-create-note-page\ncall-the-create-api\nupload-a-file-to-s3\nlist-all-the-notes\ncall-the-list-api\ndisplay-a-note\nrender-the-note-form\nsave-changes-to-a-note\ndelete-a-note\nsetup-secure-pages\ncreate-a-route-that-redirects\nuse-the-redirect-routes\nredirect-on-login\ndeploy-the-frontend\ncreate-an-s3-bucket\ndeploy-to-s3\ncreate-a-cloudfront-distribution\nsetup-your-domain-with-cloudfront\nsetup-www-domain-redirect\nsetup-ssl\ndeploy-updates\nupdate-the-app\ndeploy-again\ngetting-production-ready\ninitialize-the-backend-repo\norganize-the-backend-repo\nwhat-is-infrastructure-as-code\nconfigure-dynamodb-in-serverless\nconfigure-s3-in-serverless\nconfigure-cognito-user-pool-in-serverless\nconfigure-cognito-identity-pool-in-serverless\nuse-environment-variables-in-lambda-functions\ndeploy-your-serverless-infrastructure\nworking-with-3rd-party-apis\nsetup-a-stripe-account\nadd-a-billing-api\nload-secrets-from-env-yml\ntest-the-billing-api\nunit-tests-in-serverless\nautomating-serverless-deployments\nsetting-up-your-project-on-seed\nconfigure-secrets-in-seed\ndeploying-through-seed\nset-custom-domains-through-seed\ntest-the-configured-apis\nmonitoring-deployments-in-seed\ninitialize-the-frontend-repo\nmanage-environments-in-create-react-app\ncreate-a-settings-page\nadd-stripe-keys-to-config\ncreate-a-billing-form\nconnect-the-billing-form\nautomating-react-deployments\ncreate-a-build-script\nsetting-up-your-project-on-netlify\ncustom-domain-in-netlify\nfrontend-workflow\nwrapping-up\nfurther-reading\ngiving-back\nchangelog\nstaying-up-to-date\norganizing-serverless-projects\ncross-stack-references-in-serverless\ndynamodb-as-a-serverless-service\ns3-as-a-serverless-service\napi-gateway-domains-across-services\ncognito-as-a-serverless-service\ndeploying-multiple-services-in-serverless\napi-gateway-and-lambda-logs\ndebugging-serverless-api-issues\nserverless-environment-variables\nstages-in-serverless-framework\nconfigure-multiple-aws-profiles\ncustomize-the-serverless-iam-policy\nmapping-cognito-identity-id-and-user-pool-id\nconnect-to-api-gateway-with-iam-auth\nserverless-nodejs-starter\nmanage-user-accounts-in-aws-amplify\nhandle-forgot-and-reset-password\nallow-users-to-change-passwords\nallow-users-to-change-their-email\ncode-splitting-in-create-react-app\nenvironments-in-create-react-app\nfacebook-login-with-cognito-using-aws-amplify\"\n\nset text item delimiters to \"\n\"\n\nset theChapters to text items of theChaptersStr\n\n\n########\n# Main #\n########\ndownloadPdfs(theChapters)\nmergePdfs(theChapters)\n\n##############\n# Merge PDFs #\n##############\non mergePdfs(theChapters)\n  set outputFile to \"~\/Downloads\/ebook\/ServerlessStack.pdf\"\n\n  set pdfFiles to \"~\/Downloads\/ebook\/Cover.pdf\"\n  repeat with theCurrentChapter in theChapters\n    set pdfFiles to pdfFiles & \" ~\/Downloads\/ebook\/\" & theCurrentChapter & \".pdf\"\n  end repeat\n\n  do shell script \"\/System\/Library\/Automator\/Combine\\\\ PDF\\\\ Pages.action\/Contents\/Resources\/join.py \" & \"-o \" & outputFile & \" \" & pdfFiles\nend mergePdfs\n\n#################\n# Download PDFs #\n#################\non downloadPdfs(theChapters)\n  repeat with theCurrentChapter in theChapters\n    if not(checkFileExist(theCurrentChapter)) then\n      downloadPdf(theCurrentChapter)\n    end if\n  end repeat\nend downloadPdfs\n\non checkFileExist(theChapterName)\n  set basePath to POSIX path of (path to home folder) & \"Downloads\/ebook\/\"\n\n  tell application \"Finder\"\n    return exists basePath & theChapterName & \".pdf\" as POSIX file\n  end tell\nend checkFileExist\n\non downloadPdf(theChapterName)\n  tell application \"System Events\"\n\n    tell process \"Safari\"\n      set frontmost to true\n\n      if ((theChapterName as string) is equal to \"index\") then\n        set urlPath to theChapterName\n      else\n        set urlPath to \"chapters\/\" & theChapterName\n      end if\n      open location \"https:\/\/serverless-stack.com\/\" & urlPath & \".html\"\n\n      delay 1\n\n      repeat until menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 exists\n        delay 0.2\n      end repeat\n      repeat until menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 is enabled\n        delay 0.2\n      end repeat\n      click menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1\n\n      tell window 1\n        repeat until sheet 1 exists\n        end repeat\n\n        tell sheet 1\n          keystroke theChapterName\n          click pop up button \"Where:\"\n\n          repeat until menu 1 of pop up button \"Where:\" exists\n          end repeat\n          click menu item \"ebook\" of menu 1 of pop up button \"Where:\"\n          click button \"Save\"\n        end tell\n\n      end tell\n\n      click menu item \"Close Tab\" of menu \"File\" of menu bar 1\n\n    end tell\n\n  end tell\nend downloadPdf\n","subject":"Remove extra line breaker in pdf script","message":"Remove extra line breaker in pdf script\n","lang":"AppleScript","license":"mit","repos":"AnomalyInnovations\/serverless-stack-com,AnomalyInnovations\/serverless-stack-com"}
{"commit":"9ed54eed707ab732491b75be4fe330dc5435cbb2","old_file":"macosx\/scripts\/wake-up.applescript","new_file":"macosx\/scripts\/wake-up.applescript","old_contents":"-- Original script from Murphy Mac at http:\/\/murphymac.com\/itunes-alarm-clock\/\n-- Start iTunes from cron and slowly bring volume up\ntell application \"iTunes\"\n     set volume 1\n     set sound volume to 1\n     play playlist \"Wake-Up\"\n     set x to 0\n\n     repeat until x >= 100\n         set x to x + 10\n         if x <= 100 then set sound volume to x\n         delay 30\n     end repeat\nend tell\n","new_contents":"-- Original script from Murphy Mac at http:\/\/murphymac.com\/itunes-alarm-clock\/\n-- Start iTunes from cron and slowly bring volume up\ntell application \"System Events\"\n  tell process \"iTunes\"\n     -- Switch to the speakers in my bedroom\n     set frontmost to true\n     click button 15 of window 1 -- Remote Speakers Menu\n     key code 115                -- Home Key\n     key code 125                -- Down Arrow\n     key code 125                -- Down Arrow\n     key code 36                 -- Return Key\n  end tell\nend tell\n\ntell application \"iTunes\"\n  set volume 1\n  set sound volume to 1\n  play playlist \"Wake-Up\"\n  set x to 0\n\n  repeat until x >= 100\n    set x to x + 10\n    if x <= 100 then set sound volume to x\n    delay 30\n  end repeat\nend tell\n","subject":"Update wake-up script to switch to my remote speakers","message":"Update wake-up script to switch to my remote speakers\n","lang":"AppleScript","license":"bsd-3-clause","repos":"pjones\/emacsrc"}
{"commit":"3a0ef8efa35c3f916927b5e97a4e551587bd4262","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\n-- workflow folders\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\n\n-- the default icon used for search results without album artwork\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and use it to fetch album artwork\n\t\t\tset songId to persistent ID of theSong\n\t\t\t-- the base path to the artwork file (without extension)\n\t\t\tset artworkPath to (do shell script \".\/resources\/get-song-artwork-path.sh\" & space & songId & space & defaultIconName)\n\n\t\tend tell\n\n\t\treturn artworkPath\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\ttell application \"Music\"\n\n\t\tset genreSongs to every track of playlist 2 whose genre is genreName\n\n\tend tell\n\n\treturn genreSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n    tell application \"Music\"\n\n        set artistSongs to every track of playlist 2 whose artist is artistName\n        set albumNames to {}\n\n        repeat with theSong in artistSongs\n\n            if (album of theSong) is not in albumNames then\n\n                set albumNames to albumNames & (album of theSong)\n\n            end if\n\n        end repeat\n\n    end tell\n\n    return albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\n-- workflow folders\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\n\n-- the default icon used for search results without album artwork\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"text\\\":{\"\n\tset json to json & \"\\\"copy\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"largetype\\\":\\\"\" & resultTitle & \"\\\"\"\n\tset json to json & \"},\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and use it to fetch album artwork\n\t\t\tset songId to persistent ID of theSong\n\t\t\t-- the base path to the artwork file (without extension)\n\t\t\tset artworkPath to (do shell script \".\/resources\/get-song-artwork-path.sh\" & space & songId & space & defaultIconName)\n\n\t\tend tell\n\n\t\treturn artworkPath\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\ttell application \"Music\"\n\n\t\tset genreSongs to every track of playlist 2 whose genre is genreName\n\n\tend tell\n\n\treturn genreSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n    tell application \"Music\"\n\n        set artistSongs to every track of playlist 2 whose artist is artistName\n        set albumNames to {}\n\n        repeat with theSong in artistSongs\n\n            if (album of theSong) is not in albumNames then\n\n                set albumNames to albumNames & (album of theSong)\n\n            end if\n\n        end repeat\n\n    end tell\n\n    return albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","subject":"Add support for cmd-c and cmd-l on results","message":"Add support for cmd-c and cmd-l on results\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"f8ccb8bb6389ad4c0a0958efd57c3c890b7d6dba","old_file":"script\/start_install.scpt","new_file":"script\/start_install.scpt","old_contents":"#!\/usr\/bin\/env osascript\n\n-- Fist: Click Install Button\nset timeoutSeconds to 1.0\n\nmy doWithTimeout(\"click UI Element \\\"Install\\\" of window 1 of application process \\\"Install Command Line Developer Tools\\\"\", timeoutSeconds)\nmy doWithTimeout(\"click UI Element \\\"Agree\\\" of window 1 of application process \\\"Install Command Line Developer Tools\\\"\", timeoutSeconds)\n\non doWithTimeout(uiScript, timeoutSeconds)\n  set endDate to (current date) + timeoutSeconds\n  repeat\n    try\n      run script \"tell application \\\"System Events\\\"\n\" & uiScript & \"\nend tell\"\n      exit repeat\n    on error errorMessage\n      if ((current date) > endDate) then\n        error \"Can not \" & uiScript\n      end if\n    end try\n  end repeat\nend doWithTimeout\n","new_contents":"#!\/usr\/bin\/env osascript\n\n-- Fist: Click Install Button\nset timeoutSeconds to 1.0\n\nmy doWithTimeout(\"click UI Element \\\"Install\\\" of window 1 of application process \\\"Install Command Line Developer Tools\\\"\", timeoutSeconds)\nmy doWithTimeout(\"click UI Element \\\"Agree\\\" of window 1 of application process \\\"Install Command Line Developer Tools\\\"\", timeoutSeconds)\n\non doWithTimeout(uiScript, timeoutSeconds)\n  set endDate to (current date) + timeoutSeconds\n  repeat\n    try\n      run script \"tell application \\\"System Events\\\"\n\" & uiScript & \"\nend tell\"\n      exit repeat\n    on error errorMessage\n      if ((current date) > endDate) then\n        error errorMessage & \"; Can not \" & uiScript\n      end if\n    end try\n  end repeat\nend doWithTimeout\n","subject":"Fix error message","message":"Fix error message\n","lang":"AppleScript","license":"mit","repos":"k0kubun\/rebuild,k0kubun\/rebuild"}
{"commit":"6021fc10019fccf0a8496bd8ad32a40d2c07f78f","old_file":"tests\/applescript\/alfred.bundler.applescript","new_file":"tests\/applescript\/alfred.bundler.applescript","old_contents":"global B\nset B to my _load_bundler()\nproperty the_bundler : missing value\n\n\n(* \/\/\/\nMAIN API FUNCTIONS\n\/\/\/ *)\n\non load_utility(_name, _version, _json)\n\tif the_bundler is not equal to true then\n\t\tmy _bootstrap()\n\tend if\n\t\n\ttry\n\t\tset utility to B's load_utility(_name, _version, _json)\n\t\treturn utility\n\ton error\n\t\tset B to my _load_bundler()\n\t\ttry\n\t\t\tset utility to B's load_utility(_name, _version, _json)\n\t\t\treturn utility\n\t\ton error\n\t\t\tset msg to \"Error retrieving utility `\" & _name & \"`\"\n\t\t\tB's _log(\"get_icon\", \"DEBUG\", msg)\n\t\t\terror msg number num\n\t\tend try\n\tend try\nend load_utility\n\non get_icon(_font, _name, _color, _alter)\n\tif the_bundler is not equal to true then\n\t\tmy _bootstrap()\n\tend if\n\t\n\ttry\n\t\tset icon to B's get_icon(_font, _name, _color, _alter)\n\t\treturn icon\n\ton error\n\t\tset B to my _load_bundler()\n\t\ttry\n\t\t\tset icon to B's get_icon(_font, _name, _color, _alter)\n\t\t\treturn \"yes: \" & icon\n\t\ton error msg number num\n\t\t\tset msg to \"Error retrieving icon `\" & _font & \"`'s `{}`\"\n\t\t\tB's _log(\"get_icon\", \"DEBUG\", B's _format(msg, _name))\n\t\t\terror msg number num\n\t\tend try\n\tend try\nend get_icon\n\n\n(* \/\/\/\nSUB-API FUNCTIONS\n\/\/\/ *)\n\non _bootstrap()\n\t(*Check if bundler bash bundlet is installed and install it if not.\n\n    \t:returns: ``None``\n\n    \t*)\n\tif the_bundler is not equal to missing value then\n\t\treturn true\n\telse\n\t\tset shell_bundlet to quoted form of (my _load_shell_bundlet())\n\t\tset shell_cmd to shell_bundlet & \" utility CocoaDialog\"\n\t\tset cmd to my _prepare_cmd(shell_cmd)\n\t\tdo shell script cmd\n\t\tset the_bundler to true\n\tend if\n\t\nend _bootstrap\n\n\n(* \/\/\/\nHELPER FUNCTIONS\n\/\/\/ *)\n\non _load_bundler()\n\tset applescript_test_dir to my _pwd()\n\tset test_dir to my _dirname(applescript_test_dir)\n\tset bundler_dir to my _dirname(test_dir)\n\tset as_bundler to bundler_dir & \"bundler\/AlfredBundler.scpt\"\n\treturn load script as_bundler\nend _load_bundler\n\non _load_shell_bundlet()\n\tset bundlet to (my _pwd()) & \"alfred.bundler.sh\"\nend _load_shell_bundlet\n\non _prepare_cmd(cmd)\n\tset pwd to quoted form of (my _pwd())\n\treturn \"cd \" & pwd & \"; bash \" & cmd\nend _prepare_cmd\n\non _pwd()\n\tset {ASTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, \"\/\"}\n\tset _path to (text items 1 thru -2 of (POSIX path of (path to me)) as string) & \"\/\"\n\tset AppleScript's text item delimiters to ASTID\n\treturn _path\nend _pwd\n\non _dirname(_file)\n\tset {ASTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, \"\/\"}\n\tset _path to (text items 1 thru -3 of _file as string) & \"\/\"\n\tset AppleScript's text item delimiters to ASTID\n\treturn _path\nend _dirname\n","new_contents":"global B\nset B to my _load_bundler()\nproperty the_bundler : missing value\n\n(* \/\/\/\nMAIN API FUNCTIONS\n\/\/\/ *)\n\non load_utility(_name, _version, _json)\n\tif the_bundler is not equal to true then\n\t\tmy _bootstrap()\n\tend if\n\t\n\ttry\n\t\tset utility to B's load_utility(_name, _version, _json)\n\t\treturn utility\n\ton error\n\t\tset B to my _load_bundler()\n\t\ttry\n\t\t\tset utility to B's load_utility(_name, _version, _json)\n\t\t\treturn utility\n\t\ton error\n\t\t\tset msg to \"Error retrieving utility `\" & _name & \"`\"\n\t\t\tB's _log(\"get_icon\", \"DEBUG\", msg)\n\t\t\terror msg number num\n\t\tend try\n\tend try\nend load_utility\n\non get_icon(_font, _name, _color, _alter)\n\tif the_bundler is not equal to true then\n\t\tmy _bootstrap()\n\tend if\n\t\n\ttry\n\t\tset icon to B's get_icon(_font, _name, _color, _alter)\n\t\treturn icon\n\ton error\n\t\tset B to my _load_bundler()\n\t\ttry\n\t\t\tset icon to B's get_icon(_font, _name, _color, _alter)\n\t\t\treturn icon\n\t\ton error msg number num\n\t\t\tset msg to \"Error retrieving icon `\" & _font & \"`'s `{}`\"\n\t\t\tB's _log(\"get_icon\", \"DEBUG\", B's _format(msg, _name))\n\t\t\terror msg number num\n\t\tend try\n\tend try\nend get_icon\n\n\n(* \/\/\/\nSUB-API FUNCTIONS\n\/\/\/ *)\n\non _bootstrap()\n\t(*Check if bundler bash bundlet is installed and install it if not.\n\n    \t:returns: ``None``\n\n    \t*)\n\t--if the_bundler is not equal to missing value then\n\t--\treturn the_bundler\n\t--else\n\tset shell_bundlet to quoted form of (my _load_shell_bundlet())\n\tset shell_cmd to shell_bundlet & \" utility CocoaDialog\"\n\tset cmd to my _prepare_cmd(shell_cmd)\n\tdo shell script cmd\n\tset the_bundler to true\n\t--end if\n\t\nend _bootstrap\n\n\n(* \/\/\/\nHELPER FUNCTIONS\n\/\/\/ *)\n\non _load_bundler()\n\tset applescript_test_dir to my _pwd()\n\tset test_dir to my _dirname(applescript_test_dir)\n\tset bundler_dir to my _dirname(test_dir)\n\tset as_bundler to bundler_dir & \"bundler\/AlfredBundler.scpt\"\n\treturn load script as_bundler\nend _load_bundler\n\non _load_shell_bundlet()\n\tset bundlet to (my _pwd()) & \"alfred.bundler.sh\"\nend _load_shell_bundlet\n\non _prepare_cmd(cmd)\n\tset pwd to quoted form of (my _pwd())\n\tset testing_var to \"export AB_BRANCH=devel; \"\n\treturn testing_var & \"cd \" & pwd & \"; bash \" & cmd\nend _prepare_cmd\n\non _pwd()\n\tset {ASTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, \"\/\"}\n\tset _path to (text items 1 thru -2 of (POSIX path of (path to me)) as string) & \"\/\"\n\tset AppleScript's text item delimiters to ASTID\n\treturn _path\nend _pwd\n\non _dirname(_file)\n\tset {ASTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, \"\/\"}\n\tset _path to (text items 1 thru -3 of _file as string) & \"\/\"\n\tset AppleScript's text item delimiters to ASTID\n\treturn _path\nend _dirname\n","subject":"set AB_BRANCH for testing `_bootstrap()`","message":"set AB_BRANCH for testing `_bootstrap()`\n","lang":"AppleScript","license":"mit","repos":"shawnrice\/alfred-bundler,shawnrice\/alfred-bundler,shawnrice\/alfred-bundler,shawnrice\/alfred-bundler,shawnrice\/alfred-bundler"}
{"commit":"d1ca4b118c185b7dd44bc36c616775e2f7d043d4","old_file":"Scripts\/Ctags\/Update.applescript","new_file":"Scripts\/Ctags\/Update.applescript","old_contents":"-- Update ctags file for currently active project if it already exists\n\n-- Determine the project root directory\non getProjectRoot()\n\ttell application \"BBEdit\"\n\t\tset activeWindow to front window\n\t\t\n\t\tif (class of activeWindow is not project window) then\n\t\t\treturn missing value\n\t\tend if\n\t\t\n\t\tset projectDocument to project document of activeWindow\n\t\t\n\t\tif ((count of items of projectDocument) > 0) then\n\t\t\tset firstItem to (item 1 of projectDocument) as alias\n\t\telse\n\t\t\tif file of document of activeWindow is not missing value then\n\t\t\t\tset firstItem to (file of document of activeWindow) as alias\n\t\t\telse\n\t\t\t\t-- File is unsaved\n\t\t\t\treturn missing value\n\t\t\tend if\n\t\tend if\n\t\t\n\t\tif (on disk of projectDocument) then\n\t\t\ttell application \"Finder\"\n\t\t\t\tset projectDir to (container of (file of projectDocument))\n\t\t\t\tset firstItemDir to (container of firstItem)\n\t\t\tend tell\n\t\t\t\n\t\t\tif (firstItemDir is equal to projectDir) then\n\t\t\t\t-- Use project file\n\t\t\t\treturn projectDir as alias\n\t\t\tend if\n\t\tend if\n\t\t\n\t\t-- Project is either insta-project or external\n\t\t-- Use first item\n\t\treturn firstItem\n\tend tell\nend getProjectRoot\n\non run\n\tset projectRoot to getProjectRoot()\n\tif projectRoot is missing value then\n\t\treturn\n\tend if\n\t\n\t-- Check for existing tag file\n\t-- if it exists, rebuild it\n\t-- This allows a project to opt-in to tags by creating the tags file once\n\ttell application \"Finder\"\n\t\tif exists ((projectRoot as string) & \"tags\") then\n\t\t\trun script ((((container of (path to me)) as string) & \"Scripts:Ctags:Create.scpt\") as alias)\n\t\tend if\n\tend tell\nend run","new_contents":"-- Update ctags file for currently active project if it already exists\n\n-- Determine the project root directory\non getProjectRoot()\n\ttell application \"BBEdit\"\n\t\tset activeWindow to front window\n\t\t\n\t\tif (class of activeWindow is not project window) then\n\t\t\treturn missing value\n\t\tend if\n\t\t\n\t\tset projectDocument to project document of activeWindow\n\t\t\n\t\tif ((count of items of projectDocument) > 0) then\n\t\t\tset firstItem to (item 1 of projectDocument) as alias\n\t\telse\n\t\t\tif file of document of activeWindow is not missing value then\n\t\t\t\tset firstItem to (file of document of activeWindow) as alias\n\t\t\telse\n\t\t\t\t-- File is unsaved\n\t\t\t\treturn missing value\n\t\t\tend if\n\t\tend if\n\t\t\n\t\tif (on disk of projectDocument) then\n\t\t\ttell application \"Finder\"\n\t\t\t\tset projectDir to (container of (file of projectDocument))\n\t\t\t\tset firstItemDir to (container of firstItem)\n\t\t\tend tell\n\t\t\t\n\t\t\tif (firstItemDir is equal to projectDir) then\n\t\t\t\t-- Use project file\n\t\t\t\treturn projectDir as alias\n\t\t\tend if\n\t\tend if\n\t\t\n\t\t-- Project is either insta-project or external\n\t\t-- Use first item\n\t\treturn firstItem\n\tend tell\nend getProjectRoot\n\non run\n\tset projectRoot to getProjectRoot()\n\tif projectRoot is missing value then\n\t\treturn\n\tend if\n\t\n\t-- Check for existing tag file\n\t-- if it exists, rebuild it\n\t-- This allows a project to opt-in to tags by creating the tags file once\n\ttell application \"Finder\"\n\t\tif exists ((projectRoot as string) & \"tags\") then\n\t\t\trun script ((((container of (path to me)) as string) & \"Create.scpt\") as alias)\n\t\tend if\n\tend tell\nend run","subject":"Fix ctags update script","message":"Fix ctags update script\n\nPath to create script was wrong\n","lang":"AppleScript","license":"mit","repos":"ascarter\/BBEditSupport,ascarter\/BBEditSupport,ascarter\/BBEditSupport,ascarter\/BBEditSupport"}
{"commit":"2843f7d2cdde7208a4fbaf66e0d5aa1ae2cc95ea","old_file":"QuickStats\/QuickStats.applescript","new_file":"QuickStats\/QuickStats.applescript","old_contents":"property pTitle : \"OmniFocus: Quick Stats\"\nproperty pVersion : \"2.07.brett\"\n\nproperty pstrDBPath : \"$HOME\/Library\/Caches\/com.omnigroup.OmniFocus\/OmniFocusDatabase2\"\nproperty pstrMinOSX : \"10.6\"\n\nproperty pTimeOut : 20\n\n-- Original version: https:\/\/github.com\/RobTrew\/tree-tools\/blob\/master\/OmniFocus%20scripts\/Statistics\/QuickStats.applescript\n\n-- Copyright  2012, 2013, 2014 Robin Trew\n-- \n-- Permission is hereby granted, free of charge, \n-- to any person obtaining a copy of this software \n-- and associated documentation files (the \"Software\"), \n-- to deal in the Software without restriction, \n-- including without limitation the rights to use, copy, \n-- modify, merge, publish, distribute, sublicense, \n-- and\/or sell copies of the Software, and to permit persons \n-- to whom the Software is furnished to do so, \n-- subject to the following conditions:\n-- \n-- *******\n-- The above copyright notice and this permission notice \n-- shall be included in ALL copies \n-- or substantial portions of the Software.\n-- *******\n-- \n-- THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, \n-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES \n-- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \n-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \n-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, \n-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE \n-- OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n-- Ver 0.8 adds clipboard option to dialogue\n-- Ver 0.9 gives an error message if the cache schema has changed, leading to an SQL error in the script\n-- Ver 1.0 slight simplification of the code\n-- Ver 1.1 added count of Pending projects\n-- Ver 1.2 added a count of available actions\n-- Ver 1.3 added a break-down of unavailable actions\n-- Ver 1.4 added count of Current projects to complement Pending projects\n-- ver 1.5 replaced Applescript time function with SQL time expression\n-- Ver 1.7 Reorganizes menu, and attempts to enable access for .macappstore installations of OF\n--Ver 1.8 Adjusts handling of variant bundle identifiers generally\n-- Ver 2.00 Redraft of task breakdown, with progressive narrowing of criteria ...\n\nproperty pToClipboard : \"Copy list to clipboard\"\n\nif not FileExists(pstrDBPath) then set pstrDBPath to GetCachePath()\n\ntell application \"Finder\"\n\tif (version < pstrMinOSX) then\n\t\tdisplay dialog \"This script requires OSX \" & pstrMinOSX & \" or higher\" buttons {\"OK\"} default button 1 with title pTitle & \"Ver. \" & pVersion\n\t\treturn\n\tend if\nend tell\n\nif pstrDBPath  \"\" then\n\tset strCmd to \"sqlite3 -separator ': ' \\\"\" & pstrDBPath & \"\\\" \" & quoted form of (\"\n\tselect \\\"INBOX GROUPS & ACTIONS\\\", count(*) from task where (inInbox=1);\n\tselect \\\"    Inbox action groups\\\", count(*) from task where (inInbox=1) and (childrenCount>0);\n\tselect \\\"    Inbox actions\\\", count(*) from task where (inInbox=1) and (childrenCount=0);\n\tselect null;\n\tselect \\\"FOLDERS\\\"\t, count(*) from folder;\n\tselect \\\"    Active folders\\\", count(*) from folder where effectiveActive=1;\n\tselect \\\"    Dropped folders\\\", count(*) from folder where effectiveActive=0;\n\tselect null;\n\tselect \\\"PROJECTS\\\", count(*) from projectInfo where containsSingletonActions=0;\n\tselect \\\"    Active projects\\\", count(*) from projectInfo where (containsSingletonActions=0) and (status=\\\"active\\\");\n\tselect \\\"            Current projects\\\", count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status=\\\"active\\\") and (t.dateToStart is null or t.dateToStart < (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect \\\"            Pending projects\\\", count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status=\\\"active\\\") and (t.dateToStart > (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect \\\"    On-hold projects\\\", count(*) from projectInfo where (containsSingletonActions=0) and (status=\\\"inactive\\\");\n\tselect \\\"    Completed projects\\\", count(*) from projectInfo where (containsSingletonActions=0) and (status=\\\"done\\\");\n\tselect \\\"    Dropped projects\\\", count(*) from projectInfo where (containsSingletonActions=0) and (( status=\\\"dropped\\\") or (folderEffectiveActive=0));\n\tselect null;\t\n\tselect \\\"SINGLE ACTION LISTS\\\", count(*) from projectInfo where containsSingletonActions=1;\n\tselect \\\"    Active single action lists\\\", count(*) from projectInfo where (containsSingletonActions=1) and (status=\\\"active\\\");\n\tselect \\\"    On-hold single action lists\\\", count(*) from projectInfo where (containsSingletonActions=1) and (status=\\\"inactive\\\");\n\tselect \\\"    Completed single action lists\\\", count(*) from projectInfo where (containsSingletonActions=1) and (status=\\\"done\\\");\n\tselect \\\"    Dropped single action lists\\\", count(*) from projectInfo where (containsSingletonActions=1) and (( status=\\\"dropped\\\") or (folderEffectiveActive=0));\n\tselect null;\n\tselect \\\"CONTEXTS\\\", count(*) from context;\n\tselect \\\"    Active contexts\\\", count(*) from context where (effectiveActive=1) and (allowsNextAction=1);\n\tselect \\\"    On-hold contexts\\\", count(*) from context where (effectiveActive=1) and allowsNextAction=0;\n\tselect \\\"    Dropped contexts\\\", count(*) from context where effectiveActive=0;\n\tselect null;\n\tselect \\\"ACTION GROUPS\\\", count(*) from task where (projectinfo is null) and (childrenCount>0);\n\tselect \\\"    Remaining action groups\\\", count(*) from task where (projectinfo is null) and (dateCompleted is null) and (childrenCount>0);\n\tselect \\\"    Completed action groups\\\", count(dateCompleted) from task where (projectinfo is null) and (childrenCount>0);\n\tselect null;\n\tselect \\\"ACTIONS\\\", count(*) from task where (projectinfo is null) and (childrenCount=0);\n\tselect \\\"    Completed actions\\\", count(dateCompleted) from task where (projectinfo is null) and (childrenCount=0);\n\tselect \\\"    Dropped project actions\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp where (projectinfo is null) and (childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is not null and (tp.status=\\\"dropped\\\" or tp.folderEffectiveActive=0));\n\tselect \\\"    Dropped context actions\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand c.effectiveActive= 0;\n\tselect \\\"    Remaining actions\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1);\n\tselect \\\"        Actions in Projects on hold\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is not null and tp.status=\\\"inactive\\\");\n\tselect \\\"        Actions in Contexts on hold\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!=\\\"inactive\\\")\n\t\t\t\tand (tp.context is not null and c.allowsNextAction=0);\n\tselect \\\"        Blocked actions\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!=\\\"inactive\\\")\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1;\n\tselect \\\"        \tBlocked by future start date\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!=\\\"inactive\\\")\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=1;\n\tselect \\\"        \tSequentially blocked\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!=\\\"inactive\\\")\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=0;\n\tselect \\\"        Available actions\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!=\\\"inactive\\\")\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=0;\n\t\t\t\t\n\t\")\n\t\n\t-- \t\ttry\n\tset strList to do shell script strCmd\n\t-- \t\ton error\n\t-- \t\t\tdisplay dialog \"The SQL schema for the OmniFocus cache may have changed in a recent update of OF.\" & return & return & \n\t-- \t\t\t\t\"Look on the OmniFocus user forums for an updated version of this script.\" buttons {\"OK\"} with title pTitle & \"Ver. \" & pVersion\n\t-- \t\t\treturn\n\t-- \t\tend try\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tif button returned of (display dialog strList buttons {pToClipboard, \"OK\"} default button \"OK\" giving up after pTimeOut with title pTitle & \" Ver. \" & pVersion) \n\t\t\tis pToClipboard then tell application id \"com.apple.finder\" to set the clipboard to strList\n\tend tell\nelse\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tdisplay dialog \"OmniFocus cache not found ...\" buttons {\"OK\"} default button 1 with title pTitle & \" Ver. \" & pVersion\n\tend tell\nend if\n\n\non FileExists(strPath)\n\t(do shell script \"test -e \" & strPath & \" ; echo $?\") = \"0\"\nend FileExists\n\non GetCachePath()\n\ttry\n\t\ttell application \"Finder\" to tell (application file id \"OFOC\") to \"$HOME\/Library\/Caches\/\" & its id & \"\/OmniFocusDatabase2\"\n\ton error\n\t\terror \"OmniFocus not installed ...\"\n\tend try\nend GetCachePath\n\n","new_contents":"property pTitle : \"OmniFocus: Quick Stats\"\nproperty pVersion : \"2.07.brett\"\n\nproperty pstrDBPath : \"$HOME\/Library\/Caches\/com.omnigroup.OmniFocus\/OmniFocusDatabase2\"\nproperty pstrMinOSX : \"10.6\"\n\nproperty pTimeOut : 20\n\n-- Original version: https:\/\/github.com\/RobTrew\/tree-tools\/blob\/master\/OmniFocus%20scripts\/Statistics\/QuickStats.applescript\n\n-- Copyright  2012, 2013, 2014 Robin Trew\n-- \n-- Permission is hereby granted, free of charge, \n-- to any person obtaining a copy of this software \n-- and associated documentation files (the \"Software\"), \n-- to deal in the Software without restriction, \n-- including without limitation the rights to use, copy, \n-- modify, merge, publish, distribute, sublicense, \n-- and\/or sell copies of the Software, and to permit persons \n-- to whom the Software is furnished to do so, \n-- subject to the following conditions:\n-- \n-- *******\n-- The above copyright notice and this permission notice \n-- shall be included in ALL copies \n-- or substantial portions of the Software.\n-- *******\n-- \n-- THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, \n-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES \n-- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \n-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \n-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, \n-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE \n-- OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n-- Ver 0.8 adds clipboard option to dialogue\n-- Ver 0.9 gives an error message if the cache schema has changed, leading to an SQL error in the script\n-- Ver 1.0 slight simplification of the code\n-- Ver 1.1 added count of Pending projects\n-- Ver 1.2 added a count of available actions\n-- Ver 1.3 added a break-down of unavailable actions\n-- Ver 1.4 added count of Current projects to complement Pending projects\n-- ver 1.5 replaced Applescript time function with SQL time expression\n-- Ver 1.7 Reorganizes menu, and attempts to enable access for .macappstore installations of OF\n--Ver 1.8 Adjusts handling of variant bundle identifiers generally\n-- Ver 2.00 Redraft of task breakdown, with progressive narrowing of criteria ...\n\nproperty pToClipboard : \"Copy list to clipboard\"\n\nif not FileExists(pstrDBPath) then set pstrDBPath to GetCachePath()\n\ntell application \"Finder\"\n\tif (version < pstrMinOSX) then\n\t\tdisplay dialog \"This script requires OSX \" & pstrMinOSX & \" or higher\" buttons {\"OK\"} default button 1 with title pTitle & \"Ver. \" & pVersion\n\t\treturn\n\tend if\nend tell\n\nif pstrDBPath  \"\" then\n        set commands to \"\n\tselect 'INBOX GROUPS & ACTIONS', count(*) from task where (inInbox=1);\n\tselect '    Inbox action groups', count(*) from task where (inInbox=1) and (childrenCount>0);\n\tselect '    Inbox actions', count(*) from task where (inInbox=1) and (childrenCount=0);\n\tselect null;\n\tselect 'FOLDERS'\t, count(*) from folder;\n\tselect '    Active folders', count(*) from folder where effectiveActive=1;\n\tselect '    Dropped folders', count(*) from folder where effectiveActive=0;\n\tselect null;\n\tselect 'PROJECTS', count(*) from projectInfo where containsSingletonActions=0;\n\tselect '    Active projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='active');\n\tselect '            Current projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart is null or t.dateToStart < (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '            Pending projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart > (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '    On-hold projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='inactive');\n\tselect '    Completed projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='done');\n\tselect '    Dropped projects', count(*) from projectInfo where (containsSingletonActions=0) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\t\n\tselect 'SINGLE ACTION LISTS', count(*) from projectInfo where containsSingletonActions=1;\n\tselect '    Active single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='active');\n\tselect '    On-hold single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='inactive');\n\tselect '    Completed single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='done');\n\tselect '    Dropped single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\tselect 'CONTEXTS', count(*) from context;\n\tselect '    Active contexts', count(*) from context where (effectiveActive=1) and (allowsNextAction=1);\n\tselect '    On-hold contexts', count(*) from context where (effectiveActive=1) and allowsNextAction=0;\n\tselect '    Dropped contexts', count(*) from context where effectiveActive=0;\n\tselect null;\n\tselect 'ACTION GROUPS', count(*) from task where (projectinfo is null) and (childrenCount>0);\n\tselect '    Remaining action groups', count(*) from task where (projectinfo is null) and (dateCompleted is null) and (childrenCount>0);\n\tselect '    Completed action groups', count(dateCompleted) from task where (projectinfo is null) and (childrenCount>0);\n\tselect null;\n\tselect 'ACTIONS', count(*) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Completed actions', count(dateCompleted) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Dropped project actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp where (projectinfo is null) and (childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is not null and (tp.status='dropped' or tp.folderEffectiveActive=0));\n\tselect '    Dropped context actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand c.effectiveActive= 0;\n\tselect '    Remaining actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1);\n\tselect '        Actions in Projects on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is not null and tp.status='inactive');\n\tselect '        Actions in Contexts on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is not null and c.allowsNextAction=0);\n\tselect '        Blocked actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1;\n\tselect '        \tBlocked by future start date', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=1;\n\tselect '        \tSequentially blocked', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=0;\n\tselect '        Available actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=0;\n\t\t\t\t\n\t\"\n\tset strCmd to \"sqlite3 -separator ': ' \\\"\" & pstrDBPath & \"\\\" \" & quoted form of (commands)\n\t\n\t-- \t\ttry\n\tset strList to do shell script strCmd\n\t-- \t\ton error\n\t-- \t\t\tdisplay dialog \"The SQL schema for the OmniFocus cache may have changed in a recent update of OF.\" & return & return & \n\t-- \t\t\t\t\"Look on the OmniFocus user forums for an updated version of this script.\" buttons {\"OK\"} with title pTitle & \"Ver. \" & pVersion\n\t-- \t\t\treturn\n\t-- \t\tend try\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tif button returned of (display dialog strList buttons {pToClipboard, \"OK\"} default button \"OK\" giving up after pTimeOut with title pTitle & \" Ver. \" & pVersion) \n\t\t\tis pToClipboard then tell application id \"com.apple.finder\" to set the clipboard to strList\n\tend tell\nelse\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tdisplay dialog \"OmniFocus cache not found ...\" buttons {\"OK\"} default button 1 with title pTitle & \" Ver. \" & pVersion\n\tend tell\nend if\n\n\non FileExists(strPath)\n\t(do shell script \"test -e \" & strPath & \" ; echo $?\") = \"0\"\nend FileExists\n\non GetCachePath()\n\ttry\n\t\ttell application \"Finder\" to tell (application file id \"OFOC\") to \"$HOME\/Library\/Caches\/\" & its id & \"\/OmniFocusDatabase2\"\n\ton error\n\t\terror \"OmniFocus not installed ...\"\n\tend try\nend GetCachePath\n\n","subject":"simplify quoting","message":"simplify quoting\n","lang":"AppleScript","license":"apache-2.0","repos":"brettporter\/omnifocus-tools"}
{"commit":"7804f37a9fa67af97b46237f364c20213cdec2d2","old_file":"tube\/autoload\/tube\/applescript\/iterm.applescript","new_file":"tube\/autoload\/tube\/applescript\/iterm.applescript","old_contents":"-- iterm.applescript\n---\n-- this script requires an argument that represent the command to execute\n\non run argv\n\n    set command to (item 1 of argv)\n\n    tell application iTerm2\n      tell current session of first window\n        write text command\n      end tell\n    end tell\nend run\n","new_contents":"on run argv\n    set command to (item 1 of argv)\n\n    tell application iTerm2\n      set _window to (current window)\n\n      if _window is equal to missing value then\n        create window with default profile\n      end if\n\n      tell current window\n        tell current session\n          write text command\n        end tell\n      end tell\n    end tell\nend run\n","subject":"Update script","message":"Update script\n","lang":"AppleScript","license":"mit","repos":"alisnic\/tube.vim"}
{"commit":"38f480b4a9f54539a143327979c6573c5c8cadb7","old_file":"script\/start_install.scpt","new_file":"script\/start_install.scpt","old_contents":"#!\/usr\/bin\/env osascript\n\n-- Fist: Click Install Button\nset timeoutSeconds to 8.0\n\nmy doWithTimeout(\"click UI Element \\\"Install\\\" of window 1 of application process \\\"Install Command Line Developer Tools\\\"\", timeoutSeconds)\nmy doWithTimeout(\"click UI Element \\\"Agree\\\" of window 1 of application process \\\"Install Command Line Developer Tools\\\"\", timeoutSeconds)\n\non doWithTimeout(uiScript, timeoutSeconds)\n  set endDate to (current date) + timeoutSeconds\n  repeat\n    try\n      run script \"tell application \\\"System Events\\\"\n\" & uiScript & \"\nend tell\"\n      exit repeat\n    on error errorMessage\n      if ((current date) > endDate) then\n        error \"Can not \" & uiScript\n      end if\n    end try\n  end repeat\nend doWithTimeout\n","new_contents":"#!\/usr\/bin\/env osascript\n\n-- Fist: Click Install Button\nset timeoutSeconds to 1.0\n\nmy doWithTimeout(\"click UI Element \\\"Install\\\" of window 1 of application process \\\"Install Command Line Developer Tools\\\"\", timeoutSeconds)\nmy doWithTimeout(\"click UI Element \\\"Agree\\\" of window 1 of application process \\\"Install Command Line Developer Tools\\\"\", timeoutSeconds)\n\non doWithTimeout(uiScript, timeoutSeconds)\n  set endDate to (current date) + timeoutSeconds\n  repeat\n    try\n      run script \"tell application \\\"System Events\\\"\n\" & uiScript & \"\nend tell\"\n      exit repeat\n    on error errorMessage\n      if ((current date) > endDate) then\n        error \"Can not \" & uiScript\n      end if\n    end try\n  end repeat\nend doWithTimeout\n","subject":"Change delay","message":"Change delay\n","lang":"AppleScript","license":"mit","repos":"k0kubun\/rebuild,k0kubun\/rebuild"}
{"commit":"ddc30fc9a498c78c2b58d63ef42ca17876e5ef1d","old_file":"BatchManager\/BatchManagerScripts\/ForceRunCompuCell.scpt","new_file":"BatchManager\/BatchManagerScripts\/ForceRunCompuCell.scpt","old_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\r\u0000\u0007\r\u0000\u0007\u0000\u0002O\u0000\u0001\u0000\u0000\u0000\r\u0000\b\u0000\t\r\u0000\b\u0000\u0002r\u0000\u0000\u0000\u0004\u0000\f\u0000\n\u0000\u000b\r\u0000\n\u0000\u0001m\u0000\u0000\u0000\u0004\u0000\u0005\n\u0000\b\u000bboovtrue\r\u0000\u000b\u0000\u0002n\u0000\u0000\u0000\u0000\u0000\u0000\u0000\f\u0000\r\r\u0000\f\u0000\u00011\u0000\u0000\u0000\t\u0000\u000b\n\u0000\u0004\npisf\r\u0000\r\u0000\u00024\u0000\u0000\u0000\u0005\u0000\t\u0000\u000e\n\u0000\u0004\nprcs\r\u0000\u000e\u0000\u0001m\u0000\u0000\u0000\u0007\u0000\b\u0000\u000f\u000e\u0000\u000f\u0000\u0001\u0000\u0010\u0011\u0000\u0010\u0000\u0016\u0000c\u0000c\u00003\u0000d\u0000_\u0000p\u0000y\u0000t\u0000h\u0000o\u0000n\r\u0000\t\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0011\u000f\u0000\u0011\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sevs\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001v\u0000\u0002\u0000\u0001\u0003Tao\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000ECeH+\u0000\u0000\u00001\u0011System Events.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000ee\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u0000E\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u0000\u0000\u0000\u0001\u0000\f\u00001\u00000\u0000\/\u0000\u0002\u00004Tao:System:\u0000Library:\u0000CoreServices:\u0000System Events.app\u0000\u000e\u0000$\u0000\u0011\u0000S\u0000y\u0000s\u0000t\u0000e\u0000m\u0000 \u0000E\u0000v\u0000e\u0000n\u0000t\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\b\u0000\u0003\u0000T\u0000a\u0000o\u0000\u0012\u0000-System\/Library\/CoreServices\/System Events.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000\u0012\r\u0000\u0012\u0000\u0003l\u0000\u0002\u0000\u000e\u0000'\u0000\u0013\r\u0000\u0013\u0000\u0002O\u0000\u0001\u0000\u000e\u0000'\u0000\u0014\u0000\u0015\r\u0000\u0014\u0000\u0002O\u0000\u0000\u0000\u0012\u0000&\u0000\u0016\u0000\u0017\r\u0000\u0016\u0000\u0002O\u0000\u0001\u0000\u0019\u0000%\u0000\u0018\u0000\u0019\r\u0000\u0018\u0000\u0003I\u0000\u0002\u0000\u001d\u0000$\u0000\u001a\u0000\u001b\n\u0000\u0018.prcskprsnull\u0000\u0000\u0000\u0000\u0000ctxt\r\u0000\u001a\u0000\u0001m\u0000\u0000\u0000\u001d\u0000\u001e\u0000\u001c\u000e\u0000\u001c\u0000\u0001\u0000\u001d\u0011\u0000\u001d\u0000\u0002\u0000m\u0006\u0000\u001b\u0000\u0003\u0000\u001e\n\u0000\u0004\nfaal\r\u0000\u001e\u0000\u0001m\u0000\u0000\u0000\u001f\u0000 \n\u0000\b\u000beMdsKcmd\u0006\u0000\u0000\r\u0000\u0019\u0000\u0001m\u0000\u0000\u0000\u0019\u0000\u001a\u0000\u001f\u000f\u0000\u001f\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sevs\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001v\u0000\u0002\u0000\u0001\u0003Tao\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000ECeH+\u0000\u0000\u00001\u0011System Events.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000ee\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u0000E\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u0000\u0000\u0000\u0001\u0000\f\u00001\u00000\u0000\/\u0000\u0002\u00004Tao:System:\u0000Library:\u0000CoreServices:\u0000System Events.app\u0000\u000e\u0000$\u0000\u0011\u0000S\u0000y\u0000s\u0000t\u0000e\u0000m\u0000 \u0000E\u0000v\u0000e\u0000n\u0000t\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\b\u0000\u0003\u0000T\u0000a\u0000o\u0000\u0012\u0000-System\/Library\/CoreServices\/System Events.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\r\u0000\u0017\u0000\u00024\u0000\u0000\u0000\u0012\u0000\u0016\u0000 \n\u0000\u0004\nprcs\r\u0000 \u0000\u0001m\u0000\u0000\u0000\u0014\u0000\u0015\u0000!\u000e\u0000!\u0000\u0001\u0000\"\u0011\u0000\"\u0000\u0016\u0000c\u0000c\u00003\u0000d\u0000_\u0000p\u0000y\u0000t\u0000h\u0000o\u0000n\r\u0000\u0015\u0000\u0001m\u0000\u0000\u0000\u000e\u0000\u000f\u0000#\u000f\u0000#\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sevs\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001v\u0000\u0002\u0000\u0001\u0003Tao\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000ECeH+\u0000\u0000\u00001\u0011System Events.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000ee\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u0000E\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u0000\u0000\u0000\u0001\u0000\f\u00001\u00000\u0000\/\u0000\u0002\u00004Tao:System:\u0000Library:\u0000CoreServices:\u0000System Events.app\u0000\u000e\u0000$\u0000\u0011\u0000S\u0000y\u0000s\u0000t\u0000e\u0000m\u0000 \u0000E\u0000v\u0000e\u0000n\u0000t\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\b\u0000\u0003\u0000T\u0000a\u0000o\u0000\u0012\u0000-System\/Library\/CoreServices\/System Events.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0003\u0000$\u0000%\u0001\u0000\u0000\u0010\u0000$\u0000\u0001\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000e\u0000%\u0000\u0007\u0010\u0000&\u0000'\u0000(\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000&\u0000\u0001k\u0000\u0000\u0000\u0000\u0000'\u0000)\u0002\u0000)\u0000\u0002\u0000\u0005\u0000*\u0002\u0000*\u0000\u0002\u0000\u0012\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000'\u0000\u0000\u0010\u0000(\u0000\t\u0000\u0011\u0000\u000f\u0000!\u0000\u001c\n\u0000\u0004\nprcs\n\u0000\u0004\npisf\n\u0000\u0004\nfaal\n\u0000\b\u000beMdsKcmd\n\u0000\u0018.prcskprsnull\u0000\u0000\u0000\u0000\u0000ctxt\u0011\u0000(\u0012\u0000\ne*\/,FUO\u0012\u0000\u0016*\/\u0012\u0000\u000e\u0012\u0000\tl\f\u0000\bUUU\u000fascr\u0000\u0001\u0000\f\u07ad","new_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0005\u0000\u0007\r\u0000\u0007\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0005\u0000\b\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\r\u0000\b\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u001e\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000\t\u0000\n\r\u0000\t\u0000\u0003l\u0000\u0002\u0000\u0006\u0000\u0013\u0000\u000b\r\u0000\u000b\u0000\u0002O\u0000\u0001\u0000\u0006\u0000\u0013\u0000\f\u0000\r\r\u0000\f\u0000\u0002r\u0000\u0000\u0000\n\u0000\u0012\u0000\u000e\u0000\u000f\r\u0000\u000e\u0000\u0001m\u0000\u0000\u0000\n\u0000\u000b\n\u0000\b\u000bboovtrue\r\u0000\u000f\u0000\u0002n\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000\u0011\r\u0000\u0010\u0000\u00011\u0000\u0000\u0000\u000f\u0000\u0011\n\u0000\u0004\npisf\r\u0000\u0011\u0000\u00024\u0000\u0000\u0000\u000b\u0000\u000f\u0000\u0012\n\u0000\u0004\nprcs\r\u0000\u0012\u0000\u0001m\u0000\u0000\u0000\r\u0000\u000e\u0000\u0013\u000e\u0000\u0013\u0000\u0001\u0000\u0014\u0011\u0000\u0014\u0000\u0016\u0000c\u0000c\u00003\u0000d\u0000_\u0000p\u0000y\u0000t\u0000h\u0000o\u0000n\r\u0000\r\u0000\u0001m\u0000\u0000\u0000\u0006\u0000\u0007\u0000\u0015\u000f\u0000\u0015\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sevs\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001v\u0000\u0002\u0000\u0001\u0003Tao\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000ECeH+\u0000\u0000\u00001\u0011System Events.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000ee\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u0000E\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u0000\u0000\u0000\u0001\u0000\f\u00001\u00000\u0000\/\u0000\u0002\u00004Tao:System:\u0000Library:\u0000CoreServices:\u0000System Events.app\u0000\u000e\u0000$\u0000\u0011\u0000S\u0000y\u0000s\u0000t\u0000e\u0000m\u0000 \u0000E\u0000v\u0000e\u0000n\u0000t\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\b\u0000\u0003\u0000T\u0000a\u0000o\u0000\u0012\u0000-System\/Library\/CoreServices\/System Events.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\n\u0000\u0002\u0000\u0016\r\u0000\u0016\u0000\u0003l\u0000\u0002\u0000\u0014\u0000-\u0000\u0017\r\u0000\u0017\u0000\u0002O\u0000\u0001\u0000\u0014\u0000-\u0000\u0018\u0000\u0019\r\u0000\u0018\u0000\u0002O\u0000\u0000\u0000\u0018\u0000,\u0000\u001a\u0000\u001b\r\u0000\u001a\u0000\u0002O\u0000\u0001\u0000\u001f\u0000+\u0000\u001c\u0000\u001d\r\u0000\u001c\u0000\u0003I\u0000\u0002\u0000#\u0000*\u0000\u001e\u0000\u001f\n\u0000\u0018.prcskprsnull\u0000\u0000\u0000\u0000\u0000ctxt\r\u0000\u001e\u0000\u0001m\u0000\u0000\u0000#\u0000$\u0000 \u000e\u0000 \u0000\u0001\u0000!\u0011\u0000!\u0000\u0002\u0000m\u0006\u0000\u001f\u0000\u0003\u0000\"\n\u0000\u0004\nfaal\r\u0000\"\u0000\u0001m\u0000\u0000\u0000%\u0000&\n\u0000\b\u000beMdsKcmd\u0006\u0000\u0000\r\u0000\u001d\u0000\u0001m\u0000\u0000\u0000\u001f\u0000 \u0000#\u000f\u0000#\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sevs\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001v\u0000\u0002\u0000\u0001\u0003Tao\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000ECeH+\u0000\u0000\u00001\u0011System Events.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000ee\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u0000E\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u0000\u0000\u0000\u0001\u0000\f\u00001\u00000\u0000\/\u0000\u0002\u00004Tao:System:\u0000Library:\u0000CoreServices:\u0000System Events.app\u0000\u000e\u0000$\u0000\u0011\u0000S\u0000y\u0000s\u0000t\u0000e\u0000m\u0000 \u0000E\u0000v\u0000e\u0000n\u0000t\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\b\u0000\u0003\u0000T\u0000a\u0000o\u0000\u0012\u0000-System\/Library\/CoreServices\/System Events.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\r\u0000\u001b\u0000\u00024\u0000\u0000\u0000\u0018\u0000\u001c\u0000$\n\u0000\u0004\nprcs\r\u0000$\u0000\u0001m\u0000\u0000\u0000\u001a\u0000\u001b\u0000%\u000e\u0000%\u0000\u0001\u0000&\u0011\u0000&\u0000\u0016\u0000c\u0000c\u00003\u0000d\u0000_\u0000p\u0000y\u0000t\u0000h\u0000o\u0000n\r\u0000\u0019\u0000\u0001m\u0000\u0000\u0000\u0014\u0000\u0015\u0000'\u000f\u0000'\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sevs\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001v\u0000\u0002\u0000\u0001\u0003Tao\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000ECeH+\u0000\u0000\u00001\u0011System Events.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000ee\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u0000E\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u0000\u0000\u0000\u0001\u0000\f\u00001\u00000\u0000\/\u0000\u0002\u00004Tao:System:\u0000Library:\u0000CoreServices:\u0000System Events.app\u0000\u000e\u0000$\u0000\u0011\u0000S\u0000y\u0000s\u0000t\u0000e\u0000m\u0000 \u0000E\u0000v\u0000e\u0000n\u0000t\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\b\u0000\u0003\u0000T\u0000a\u0000o\u0000\u0012\u0000-System\/Library\/CoreServices\/System Events.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0003\u0000(\u0000)\u0001\u0000\u0000\u0010\u0000(\u0000\u0001\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000e\u0000)\u0000\u0007\u0010\u0000*\u0000+\u0000,\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000*\u0000\u0001k\u0000\u0000\u0000\u0000\u0000-\u0000-\u0002\u0000-\u0000\u0002\u0000\u0005\u0000.\u0002\u0000.\u0000\u0002\u0000\t\u0000\/\u0002\u0000\/\u0000\u0002\u0000\u0016\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000+\u0000\u0000\u0010\u0000,\u0000\u000b\u0000\u0015\u0000\u0013\u0000%\u0000 \u0003\u0000\u001e\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\n\u0000\u0004\nprcs\n\u0000\u0004\npisf\n\u0000\u0004\nfaal\n\u0000\b\u000beMdsKcmd\n\u0000\u0018.prcskprsnull\u0000\u0000\u0000\u0000\u0000ctxt\u0011\u0000.j\f\u0000\u0001O\u0012\u0000\ne*\/,FUO\u0012\u0000\u0016*\/\u0012\u0000\u000e\u0012\u0000\tl\f\u0000\nUUU\u000f\u0000ascr\u0000\u0001\u0000\r\u07ad","subject":"Fix minor error on mac where autorun CompuCell would send the run simulation command to CompuCell before it was open","message":"Fix minor error on mac where autorun CompuCell would send the run simulation command to CompuCell before it was open\n","lang":"AppleScript","license":"mit","repos":"ram8647\/tcseg,ram8647\/tcseg,ram8647\/tcseg"}
{"commit":"fea9048e53742f63f867f60937203cf17597828e","old_file":"indra\/newview\/installers\/darwin\/set-labels.applescript","new_file":"indra\/newview\/installers\/darwin\/set-labels.applescript","old_contents":"-- This Applescript changes all of the icon labels on the disk image to\n--  a different color.\n-- Usage: osascript set-labels.applescript <volume-name>\n-- where <volume-name> is the volume name of the disk image.\n\non run argv\n\ttell application \"Finder\"\n\t\tset diskname to item 1 of argv\n\t\tset file_list to every file in disk diskname\n\t\trepeat with i in file_list\n\t\t\tif the name of i is \"Applications\" then\n\t\t\t\tset the position of i to {368, 135}\n\t\t\telse if the name of i ends with \".app\" then\n\t\t\t\tset the position of i to {134, 135}\n\t\t\tend if\n\t\t-- The magic happens here: This will set the label color of\n\t\t--  the file icon. Change the 7 to change the color: 0 is no\n\t\t--  label, then red, orange, yellow, green, blue, purple, or gray.\n\t\t\tset the label index of i to 7\n\t\tend repeat\n\tend tell\nend run","new_contents":"-- This Applescript changes all of the icon labels on the disk image to\n--  a different color.\n-- Usage: osascript set-labels.applescript <volume-name>\n-- where <volume-name> is the volume name of the disk image.\n\non run argv\n\ttell application \"Finder\"\n\t\tset diskname to item 1 of argv\n\t\ttell disk diskname\n\t\t\tset file_list to every file\n\t\t\trepeat with i in file_list\n\t\t\t\tif the name of i is \"Applications\" then\n\t\t\t\t\tset the position of i to {368, 135}\n\t\t\t\telse if the name of i ends with \".app\" then\n\t\t\t\t\tset the position of i to {134, 135}\n\t\t\t\tend if\n\t\t\t-- The magic happens here: This will set the label color of\n\t\t\t--  the file icon. Change the 7 to change the color: 0 is no\n\t\t\t--  label, then red, orange, yellow, green, blue, purple, or gray.\n\t\t\t\tset the label index of i to 7\n\t\t\tend repeat\n\t\t\tupdate without registering applications\n\t\t\tdelay 4\n\t\tend tell\n\tend tell\nend run\n","subject":"Make Mac disk image packager set application icon location more reliably.","message":"Make Mac disk image packager set application icon location more reliably.\n","lang":"AppleScript","license":"lgpl-2.1","repos":"gabeharms\/firestorm,gabeharms\/firestorm,gabeharms\/firestorm,gabeharms\/firestorm,gabeharms\/firestorm,gabeharms\/firestorm,gabeharms\/firestorm,gabeharms\/firestorm,gabeharms\/firestorm"}
{"commit":"d91fd503747390df446cad1fa1cacb5666e9d4ee","old_file":"script\/open_shortcuts.scpt","new_file":"script\/open_shortcuts.scpt","old_contents":"-- vim-anywhere - use Vim whenever, wherever\n-- Author: Chris Knadler\n-- Homepage: https:\/\/www.github.com\/cknadler\/vim-anywhere\n--\n-- Open the keyboard shortcuts tab of keyboard system preferences\n\ntell application \"System Preferences\"\n  activate\n  reveal anchor \"shortcutsTab\" of pane id \"com.apple.preference.keyboard\"\n  keystroke tab\n  keystroke key code 125\n  keystroke key code 125\n  keystroke key code 125\nend tell\n","new_contents":"-- vim-anywhere - use Vim whenever, wherever\n-- Author: Chris Knadler\n-- Homepage: https:\/\/www.github.com\/cknadler\/vim-anywhere\n--\n-- Open the \"Services\" keyboard shortcuts tab of keyboard system preferences\n\ntell application \"System Preferences\"\n  activate\n  reveal anchor \"shortcutsTab\" of pane id \"com.apple.preference.keyboard\"\n  keystroke tab\n  repeat 3 times\n    key code 125\n  end repeat\nend tell\n","subject":"Fix open_shortcuts","message":"Fix open_shortcuts\n","lang":"AppleScript","license":"mit","repos":"cknadler\/vim-anywhere"}
{"commit":"11c21504a38704811093ded02dc7dd6e930fed6a","old_file":"scripts\/track\/finder.tmpl.scpt","new_file":"scripts\/track\/finder.tmpl.scpt","old_contents":"tell application \"iTunes\"\n  set specified_tracks to (every track whose #{conditions})\n\n\n\tset json to \"[\"\n\n\trepeat with specified_track in specified_tracks\n    set props to {}\n\n    set end of props to \"{\"\n    set end of props to (\"\\\"persistent_id\\\":\\\"\" & persistent ID of specified_track & \"\\\",\")\n    set end of props to (\"\\\"name\\\":\\\"\" & my escape_quote(name of specified_track) & \"\\\",\")\n    set end of props to (\"\\\"album\\\":\\\"\" & my escape_quote(album of specified_track) & \"\\\",\")\n    set end of props to (\"\\\"artist\\\":\\\"\" & my escape_quote(artist of specified_track) & \"\\\",\")\n    set end of props to (\"\\\"track_count\\\":\\\"\" & track count of specified_track & \"\\\",\")\n    set end of props to (\"\\\"track_number\\\":\\\"\" & track number of specified_track & \"\\\"\")\n    set end of props to \"}\"\n\n    set json to json & props as string & \",\"\n  end repeat\n\n  set json to json & \"null]\"\n  return json\n\nend tell\n\n\non escape_quote(someText)\n return replaceText(someText, \"\\\"\", \"\\\\\\\"\")\nend escape_quote\n\n(*\n   https:\/\/discussions.apple.com\/thread\/4588230?start=0&tstart=0\n*)\non replaceText(someText, oldItem, newItem)\n     set {tempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, oldItem}\n     try\n          set {itemList, AppleScript's text item delimiters} to {text items of someText, newItem}\n          set {someText, AppleScript's text item delimiters} to {itemList as text, tempTID}\n     on error errorMessage number errorNumber -- oops\n          set AppleScript's text item delimiters to tempTID\n          error errorMessage number errorNumber -- pass it on\n     end try\n     \n     return someText\nend replaceText\n","new_contents":"tell application \"iTunes\"\n  set specified_tracks to (every track whose #{conditions})\n\n\n\tset json to \"[\"\n\n\trepeat with specified_track in specified_tracks\n    set props to {}\n\n    set end of props to \"{\"\n    set end of props to (\"\\\"persistent_id\\\":\\\"\" & persistent ID of specified_track & \"\\\",\")\n    set end of props to (\"\\\"name\\\":\\\"\" & my escape_quote(name of specified_track) & \"\\\",\")\n    set end of props to (\"\\\"album\\\":\\\"\" & my escape_quote(album of specified_track) & \"\\\",\")\n    set end of props to (\"\\\"artist\\\":\\\"\" & my escape_quote(artist of specified_track) & \"\\\",\")\n    set end of props to (\"\\\"track_count\\\":\\\"\" & track count of specified_track & \"\\\",\")\n    set end of props to (\"\\\"track_number\\\":\\\"\" & track number of specified_track & \"\\\"\")\n    set end of props to \"}\"\n\n    set json to json & props as string & \",\"\n  end repeat\n\n  set json to json & \"null]\"\n  return json\n\nend tell\n\n\non escape_quote(someText)\n return replaceText(someText, \"\\\"\", \"\\\\\\\"\")\nend escape_quote\n\n(*\n   https:\/\/discussions.apple.com\/thread\/4588230?start=0&tstart=0\n*)\non replaceText(someText, oldItem, newItem)\n     set {tempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, oldItem}\n     try\n          set {itemList, AppleScript's text item delimiters} to {text items of someText, newItem}\n          set {someText, AppleScript's text item delimiters} to {itemList as text, tempTID}\n     on error errorMessage number errorNumber -- oops\n          set AppleScript's text item delimiters to tempTID\n          error errorMessage number errorNumber -- pass it on\n     end try\n\n     return someText\nend replaceText\n","subject":"Delete trailing whitespace","message":"Delete trailing whitespace\n","lang":"AppleScript","license":"mit","repos":"katsuma\/itunes-client"}
{"commit":"b582b23092cd681c0cc416a3605737b8646c13be","old_file":"keynote.applescript","new_file":"keynote.applescript","old_contents":"on newPresentation(themeName)\n\ttell application \"Keynote\"\n\t\tactivate\n\t\t-- FIXME: Make this selectable?\n\t\tset targetWidth to 1024 -- 1440 <-- higher resolution\n\t\tset targetHeight to 768 -- 1080 <-- higher resolution\n\n\t\tset props to {document theme:theme (themeName as string), width:targetWidth, height:targetHeight}\n\n\t\tset thisDocument to make new document with properties props\n\t\treturn name of thisDocument\n\tend tell\nend newPresentation\n\n\non savePresentation(docname, posixPath)\n\ttell application \"Keynote\"\n\t\tsave document named docname in POSIX file posixPath\n\tend tell\nend savePresentation\t\n\non createSlide(docname, masterSlideName)\n\ttry\n\t\ttell application \"Keynote\"\n\t\t\ttell document named docname\n\t\t\t\tset thisSlide to make new slide with properties {base slide:master slide masterSlideName}\n\t\t\tend tell\n\t  return thisSlide\n\t\tend tell\n\ton error\n\t\treturn 0\n\tend try\nend createSlide\n\non finalize(docname)\n\ttell application \"Keynote\"\n\t\ttell document named docname to delete slide 1\n\tend tell\nend finalize\n\non themeMasters(docname)\n\t--\t  tell application \"Keynote\" to get the name of every master slide of thisDocument\n\ttell application \"Keynote\"\n\t\tset names to the name of every master slide of document named docname\n\t\treturn names\n\tend tell\nend themeMasters\n\non addImage(docname, filepath)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n  tell application \"Keynote\"\n\ttell document named docname\n\t\ttell the current slide\n\t\t\t\n\t\t\t-- TO REPLACE A PLACEHOLDER OR EXISTING IMAGE:\n\t\t\tset thisPlaceholderImageItem to image 1\n\t\t\t-- change the value of the \u201cfile name\u201d property of the image to be an HFS file reference to the replacement image file\n\t\tset macPath to POSIX file filepath as Unicode text\n\t\t\tset file name of thisPlaceholderImageItem to \u00ac\n\t\t\t\talias macPath\n\t\t\t\n\t\tend tell\n\tend tell\n  end tell\nend addImage\n\n\non addTitle(docname, thisSlideTitle)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n\ttell application \"Keynote\"\n\t\ttell document named docname\n\t\t\ttell the current slide\n\t\t\t\tif title showing is true then\n\t\t\t\t\tset the object text of the default title item to thisSlideTitle\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend tell\n\tend tell\nend addTitle\n\non addBody(docname, thisSlideBody)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n\ttell application \"Keynote\"\n\t\ttell document named docname\n\t\t\ttell the current slide\n\t\t\t\tif body showing is true then\n\t\t\t\t\tset the object text of the default body item to thisSlideBody\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend tell\n\tend tell\nend addTitle\n","new_contents":"on newPresentation(themeName)\n\ttell application \"Keynote\"\n\t\tactivate\n\t\t-- FIXME: Make this selectable?\n\t\tset targetWidth to 1024 -- 1440 <-- higher resolution\n\t\tset targetHeight to 768 -- 1080 <-- higher resolution\n\n\t\tset props to {document theme:theme (themeName as string), width:targetWidth, height:targetHeight}\n\n\t\tset thisDocument to make new document with properties props\n\t\treturn name of thisDocument\n\tend tell\nend newPresentation\n\non openPresentation(posixPath)\n\ttell application \"Keynote\"\n\t\topen posixPath\n\tend tell\nend openPresentation\n\non savePresentation(docname, posixPath)\n\ttell application \"Keynote\"\n\t\tsave document named docname in POSIX file posixPath\n\tend tell\nend savePresentation\t\n\non createSlide(docname, masterSlideName)\n\ttry\n\t\ttell application \"Keynote\"\n\t\t\ttell document named docname\n\t\t\t\tset thisSlide to make new slide with properties {base slide:master slide masterSlideName}\n\t\t\tend tell\n\t  return thisSlide\n\t\tend tell\n\ton error\n\t\treturn 0\n\tend try\nend createSlide\n\non finalize(docname)\n\ttell application \"Keynote\"\n\t\ttell document named docname to delete slide 1\n\tend tell\nend finalize\n\non themeMasters(docname)\n\t--\t  tell application \"Keynote\" to get the name of every master slide of thisDocument\n\ttell application \"Keynote\"\n\t\tset names to the name of every master slide of document named docname\n\t\treturn names\n\tend tell\nend themeMasters\n\non addImage(docname, filepath)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n  tell application \"Keynote\"\n\ttell document named docname\n\t\ttell the current slide\n\t\t\t\n\t\t\t-- TO REPLACE A PLACEHOLDER OR EXISTING IMAGE:\n\t\t\tset thisPlaceholderImageItem to image 1\n\t\t\t-- change the value of the \u201cfile name\u201d property of the image to be an HFS file reference to the replacement image file\n\t\tset macPath to POSIX file filepath as Unicode text\n\t\t\tset file name of thisPlaceholderImageItem to \u00ac\n\t\t\t\talias macPath\n\t\t\t\n\t\tend tell\n\tend tell\n  end tell\nend addImage\n\n\non addTitle(docname, thisSlideTitle)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n\ttell application \"Keynote\"\n\t\ttell document named docname\n\t\t\ttell the current slide\n\t\t\t\tif title showing is true then\n\t\t\t\t\tset the object text of the default title item to thisSlideTitle\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend tell\n\tend tell\nend addTitle\n\non addBody(docname, thisSlideBody)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n\ttell application \"Keynote\"\n\t\ttell document named docname\n\t\t\ttell the current slide\n\t\t\t\tif body showing is true then\n\t\t\t\t\tset the object text of the default body item to thisSlideBody\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend tell\n\tend tell\nend addTitle\n","subject":"Add openPresentation","message":"Add openPresentation\n","lang":"AppleScript","license":"mit","repos":"persquare\/md2keynote"}
{"commit":"e1dd0bf0abf0f2c687018ceaf9c23707f430847c","old_file":"library\/standalone\/BBEdit_upgrade_SQL_Query_to_newer_format.applescript","new_file":"library\/standalone\/BBEdit_upgrade_SQL_Query_to_newer_format.applescript","old_contents":"-- BBEdit_upgrade_SQL_Query_to_newer_format({})\n-- Dan Shockley, NYHTC\n-- BBEdit - upgrade SQL Query to newer format\n\n(*\nHISTORY:\n\t1.1 - 2017-12-11 ( dshockley ): disable the usually no-longer-needed SQL_EscapeString, but WARN and comment, since it might sitll be needed when using with something OTHER THAN SQL_Where criteria. \n\t1.0 - 2017-09-15 ( dshockley ): first created. \n*)\n\n\non run\n\tBBEdit_upgrade_SQL_Query_to_newer_format({})\nend run\n\n--------------------\n-- START OF CODE\n--------------------\n\non BBEdit_upgrade_SQL_Query_to_newer_format({})\n\t\n\tset regexSearch_SQL_Table to \"Quote *\\\\( *TableNameOfField *\\\\( *([^\\\\)]+) *\\\\) *\\\\)\"\n\tset regexReplace_SQL_Table to \"SQL_Table ( \\\\1 )\"\n\t\n\tset regexSearch_SQL_Field to \"Quote *\\\\( ?FieldNameShort *\\\\( *([^\\\\)]+) *\\\\) *\\\\)\"\n\tset regexReplace_SQL_Field to \"SQL_Field ( \\\\1 )\"\n\t\n\t\n\t\n\tset regexSearch_WhereEqualsClause to \"^([\\\\t ]*)& *SQL_Field *\\\\( *([^\\\\)]+) *\\\\) \n[\\\\t ]*& \\\" *= *\\\" \n[\\\\t ]*& ([^\\\\r]+)\\\\r\"\n\t\n\tset regexReplace_WhereEqualsClause to \"\\\\1\\\\& SQL_Where ( \\\\2 ; \\\"=\\\" ; \\\\3 )\\\\r\"\n\t\n\t\n\tset regexSearch_EscapeStringWARN to \"SQL_EscapeString *\\\\( *([^\\\\)]+) *\\\\)\"\n\t\n\tset regexReplace_EscapeStringWARN to \"\\\\1 \/* WARNING!! Had SQL_EscapeString probably NO LONGER NEEDED, so DISABLED! *\/\"\n\t\n\ttell application \"BBEdit\"\n\t\tactivate\n\t\t\n\t\ttell window 1\n\t\t\t\n\t\t\treplace regexSearch_SQL_Table using regexReplace_SQL_Table options {search mode:grep, starting at top:true}\n\t\t\t\n\t\t\treplace regexSearch_SQL_Field using regexReplace_SQL_Field options {search mode:grep, starting at top:true}\n\t\t\t\n\t\t\treplace regexSearch_WhereEqualsClause using regexReplace_WhereEqualsClause options {search mode:grep, starting at top:true}\n\t\t\treplace regexSearch_EscapeStringWARN using regexReplace_EscapeStringWARN options {search mode:grep, starting at top:true}\n\t\t\t\n\t\tend tell\n\t\t\n\t\t\n\tend tell\nend BBEdit_upgrade_SQL_Query_to_newer_format\n\n--------------------\n-- END OF CODE\n--------------------\n","new_contents":"-- BBEdit_upgrade_SQL_Query_to_newer_format({})\n-- Dan Shockley, NYHTC\n-- BBEdit - upgrade SQL Query to newer format\n\n(*\nHISTORY:\n\t1.2 - 2018-05-22 ( dshockley ): modified to also convert the query to use List to separate the components of the query. \n\t1.1 - 2017-12-11 ( dshockley ): disable the usually no-longer-needed SQL_EscapeString, but WARN and comment, since it might sitll be needed when using with something OTHER THAN SQL_Where criteria. \n\t1.0 - 2017-09-15 ( dshockley ): first created. \n*)\n\n\non run\n\tBBEdit_upgrade_SQL_Query_to_newer_format({})\nend run\n\n--------------------\n-- START OF CODE\n--------------------\n\non BBEdit_upgrade_SQL_Query_to_newer_format({})\n\t\n\tset regexSearch_SQL_Table to \"Quote *\\\\( *TableNameOfField *\\\\( *([^\\\\)]+) *\\\\) *\\\\)\"\n\tset regexReplace_SQL_Table to \"SQL_Table ( \\\\1 )\"\n\t\n\tset regexSearch_SQL_Field to \"Quote *\\\\( ?FieldNameShort *\\\\( *([^\\\\)]+) *\\\\) *\\\\)\"\n\tset regexReplace_SQL_Field to \"SQL_Field ( \\\\1 )\"\n\t\n\t\n\t\n\tset regexSearch_WhereEqualsClause to \"^([\\\\t ]*)& *SQL_Field *\\\\( *([^\\\\)]+) *\\\\) \n[\\\\t ]*& \\\" *= *\\\" \n[\\\\t ]*& ([^\\\\r]+)\\\\r\"\n\t\n\tset regexReplace_WhereEqualsClause to \"\\\\1\\\\& SQL_Where ( \\\\2 ; \\\"=\\\" ; \\\\3 )\\\\r\"\n\t\n\t\n\tset regexSearch_EscapeStringWARN to \"SQL_EscapeString *\\\\( *([^\\\\)]+) *\\\\)\"\n\t\n\tset regexReplace_EscapeStringWARN to \"\\\\1 \/* WARNING!! Had SQL_EscapeString probably NO LONGER NEEDED, so DISABLED! *\/\"\n\t\n\t\n\ttell application \"BBEdit\"\n\t\tactivate\n\t\t\n\t\ttell window 1\n\t\t\t\n\t\t\treplace regexSearch_SQL_Table using regexReplace_SQL_Table options {search mode:grep, starting at top:true}\n\t\t\t\n\t\t\treplace regexSearch_SQL_Field using regexReplace_SQL_Field options {search mode:grep, starting at top:true}\n\t\t\t\n\t\t\treplace regexSearch_WhereEqualsClause using regexReplace_WhereEqualsClause options {search mode:grep, starting at top:true}\n\t\t\treplace regexSearch_EscapeStringWARN using regexReplace_EscapeStringWARN options {search mode:grep, starting at top:true}\n\t\t\t\n\t\t\t\n\t\t\ttry\n\t\t\t\t(* convert to using List ( ) for whitespace formatting of query: *)\n\t\t\t\tset stringStartQuery to \"; sqlQuery = \"\n\t\t\t\tset stringEndQuery to \"^([\\\\t]+); sqlResult = \"\n\t\t\t\tset posQueryStart to characterOffset of found object of (find stringStartQuery)\n\t\t\t\tset posQueryEnd to (characterOffset of found object of (find stringEndQuery options {search mode:grep})) - 1\n\t\t\t\tselect (characters posQueryStart through posQueryEnd)\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treplace \"\\\"SELECT\" using \"List ( \\\\r\\\\t\\\\t  \\\"SELECT\" searching in selection options {search mode:grep}\n\t\t\t\treplace \"^([\\\\t]+)& \" using \"\\\\t\\\\t; \" searching in selection options {search mode:grep}\n\t\t\t\t\n\t\t\t\tset character posQueryEnd to return & tab & tab & \")\" & (contents of character posQueryEnd)\n\t\t\t\t\n\t\t\tend try\n\t\t\t\n\t\tend tell\n\t\t\n\tend tell\n\t\n\t\nend BBEdit_upgrade_SQL_Query_to_newer_format\n\n--------------------\n-- END OF CODE\n--------------------\n","subject":"use List to format query","message":"use List to format query\n","lang":"AppleScript","license":"mit","repos":"NYHTC\/applescript-fm-helper"}
{"commit":"fabf4bba5f4026095b77924df42d29785775d1ac","old_file":"macosx\/scripts\/iChat\/growl.scpt","new_file":"macosx\/scripts\/iChat\/growl.scpt","old_contents":"using terms from application \"iChat\"\n  on message received message from theBuddy for textChat\n    set whoDidIt to full name of theBuddy\n    set buddyIcon to image of theBuddy\n    set window_name to \"Not iChat\"\n    \n    tell application \"System Events\"\n      set frontApp to name of first application process whose frontmost is true\n    end tell\n\n    if frontApp is equal to \"iChat\"\n      tell application frontApp\n        if the (count of documents) is not 0 then\n          set window_name to name of front window\n        end if\n      end tell\n    end if\n    \n    if window_name is not equal to \"Chat with \" & whoDidIt then\n      tell application \"GrowlHelperApp\" -- ** the daemon that is behind the scenes\n        -- Make a list of all the notification types that this script will ever send:\n        set the allNotificationsList to {\"IM Received\"}\n        \n        -- Make a list of the notifications that will be enabled by default.\n        set the enabledNotificationsList to {\"IM Received\"}\n        \n        -- Register our script with growl.\n        register as application \"iChat Growl AppleScript\" all notifications allNotificationsList default notifications enabledNotificationsList icon of application \"iChat\"\n        \n        if buddyIcon is equal to missing value then\n          notify with name \"IM Received\" title whoDidIt description message application name \"iChat Growl AppleScript\" sticky no\n        else\n          notify with name \"IM Received\" title whoDidIt description message application name \"iChat Growl AppleScript\" sticky no image buddyIcon\n        end if\n      end tell\n    end if\n  end message received\nend using terms from\n","new_contents":"using terms from application \"iChat\"\n  on message received message from theBuddy for textChat\n    set whoDidIt to full name of theBuddy\n    set buddyIcon to image of theBuddy\n    \n    tell application \"System Events\"\n      set frontApp to name of first application process whose frontmost is true\n    end tell\n\n    if frontApp is not equal to \"iChat\" then\n      tell application \"GrowlHelperApp\" -- ** the daemon that is behind the scenes\n        -- Make a list of all the notification types that this script will ever send:\n        set the allNotificationsList to {\"IM Received\"}\n        \n        -- Make a list of the notifications that will be enabled by default.\n        set the enabledNotificationsList to {\"IM Received\"}\n        \n        -- Register our script with growl.\n        register as application \"iChat Growl AppleScript\" all notifications allNotificationsList default notifications enabledNotificationsList icon of application \"iChat\"\n        \n        if buddyIcon is equal to missing value then\n          notify with name \"IM Received\" title whoDidIt description message application name \"iChat Growl AppleScript\" sticky no identifier whoDidIt\n        else\n          notify with name \"IM Received\" title whoDidIt description message application name \"iChat Growl AppleScript\" sticky no identifier whoDidIt image buddyIcon\n        end if\n      end tell\n    end if\n  end message received\nend using terms from\n","subject":"Fix some bugs in iChat growl","message":"Fix some bugs in iChat growl\n","lang":"AppleScript","license":"bsd-3-clause","repos":"pjones\/emacsrc"}
{"commit":"83a998ecff08e3022894f03af002f0048c60410c","old_file":"dictlook-ui.scpt","new_file":"dictlook-ui.scpt","old_contents":"on run {input}\r  try\r    do shell script \"$HOME\/Dropbox\\\\ \\\\(Personal\\\\)\/projects\/plover-tools\/plover-dictionary-lookup\/dictlook -x \" & \"\\\"\" & input & \"\\\"\"\r    display dialog result buttons {\"OK\"} default button 1\r  on error\r    display dialog \"No such luck.\" buttons {\"OK\"} default button 1\r    beep\r  end try\rend run\r","new_contents":"on run {input}\r  try\r    do shell script \"$HOME\/Dropbox\\\\ \\\\(Personal\\\\)\/projects\/plover-tools\/plover-dictionary-lookup\/dictlook -x \" & \"\\\"\" & input & \"\\\"\"\r    display dialog result default answer \"\" buttons {\"OK\"} default button 1\r  on error\r    display dialog \"No such luck.\" buttons {\"OK\"} default button 1\r    beep\r  end try\rend run\r","subject":"Add practice text area to lookup dialog","message":"Add practice text area to lookup dialog\n","lang":"AppleScript","license":"unlicense","repos":"dimonster\/plover-dictionary-lookup"}
{"commit":"56a74929a15468f49479927c8cfe676cd03e1e1a","old_file":"QuickStats\/QuickStats.applescript","new_file":"QuickStats\/QuickStats.applescript","old_contents":"property pTitle : \"OmniFocus: Quick Stats\"\nproperty pVersion : \"2.07.brett\"\n\nproperty pstrDBPath : \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/com.omnigroup.OmniFocus\/OmniFocusDatabase2\"\nproperty pstrMinOSX : \"10.9\"\n\nproperty pTimeOut : 30\n\n-- Original version: https:\/\/github.com\/RobTrew\/tree-tools\/blob\/master\/OmniFocus%20scripts\/Statistics\/QuickStats.applescript\n\n-- Copyright  2012, 2013, 2014 Robin Trew\n-- \n-- Permission is hereby granted, free of charge, \n-- to any person obtaining a copy of this software \n-- and associated documentation files (the \"Software\"), \n-- to deal in the Software without restriction, \n-- including without limitation the rights to use, copy, \n-- modify, merge, publish, distribute, sublicense, \n-- and\/or sell copies of the Software, and to permit persons \n-- to whom the Software is furnished to do so, \n-- subject to the following conditions:\n-- \n-- *******\n-- The above copyright notice and this permission notice \n-- shall be included in ALL copies \n-- or substantial portions of the Software.\n-- *******\n-- \n-- THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, \n-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES \n-- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \n-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \n-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, \n-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE \n-- OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n-- Ver 0.8 adds clipboard option to dialogue\n-- Ver 0.9 gives an error message if the cache schema has changed, leading to an SQL error in the script\n-- Ver 1.0 slight simplification of the code\n-- Ver 1.1 added count of Pending projects\n-- Ver 1.2 added a count of available actions\n-- Ver 1.3 added a break-down of unavailable actions\n-- Ver 1.4 added count of Current projects to complement Pending projects\n-- ver 1.5 replaced Applescript time function with SQL time expression\n-- Ver 1.7 Reorganizes menu, and attempts to enable access for .macappstore installations of OF\n--Ver 1.8 Adjusts handling of variant bundle identifiers generally\n-- Ver 2.00 Redraft of task breakdown, with progressive narrowing of criteria ...\n\nproperty pToClipboard : \"Copy list to clipboard\"\n\nif not FileExists(pstrDBPath) then set pstrDBPath to GetCachePath()\n\ntell application \"Finder\"\n\tif (version < pstrMinOSX) then\n\t\tdisplay dialog \"This script requires OSX \" & pstrMinOSX & \" or higher\" buttons {\"OK\"} default button 1 with title pTitle & \"Ver. \" & pVersion\n\t\treturn\n\tend if\n\n\tset screen_resolution to bounds of window of desktop\n\tset height to item 4 of screen_resolution\n\tif height < 1024 then\n\t\tset brief to true\n\telse\n\t\tset brief to false\n\tend if\nend tell\n\nif pstrDBPath  \"\" then\n\tset inbox_cmd to \"\n\tselect 'INBOX GROUPS & ACTIONS', count(*) from task where (inInbox=1);\n\tselect '    Inbox action groups', count(*) from task where (inInbox=1) and (childrenCount>0);\n\tselect '    Inbox actions', count(*) from task where (inInbox=1) and (childrenCount=0);\n\tselect null;\n\t\"\n\tset folders_cmd to \"\n\tselect 'FOLDERS'\t, count(*) from folder;\n\tselect '    Active folders', count(*) from folder where effectiveActive=1;\n\tselect '    Dropped folders', count(*) from folder where effectiveActive=0;\n\tselect null;\n\t\"\n\tset projects_cmd to \"\n\tselect 'PROJECTS', count(*) from projectInfo where containsSingletonActions=0;\n\tselect '    Active projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='active');\n\tselect '            Current projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart is null or t.dateToStart < (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '            Pending projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart > (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '    On-hold projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='inactive');\n\tselect '    Completed projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='done');\n\tselect '    Dropped projects', count(*) from projectInfo where (containsSingletonActions=0) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset lists_cmd to \"\n\tselect 'SINGLE ACTION LISTS', count(*) from projectInfo where containsSingletonActions=1;\n\tselect '    Active single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='active');\n\tselect '    On-hold single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='inactive');\n\tselect '    Completed single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='done');\n\tselect '    Dropped single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset contexts_cmd to \"\n\tselect 'CONTEXTS', count(*) from context;\n\tselect '    Active contexts', count(*) from context where (effectiveActive=1) and (allowsNextAction=1);\n\tselect '    On-hold contexts', count(*) from context where (effectiveActive=1) and allowsNextAction=0;\n\tselect '    Dropped contexts', count(*) from context where effectiveActive=0;\n\tselect null;\n\t\"\n\tset groups_cmd to \"\n\tselect 'ACTION GROUPS', count(*) from task where (projectinfo is null) and (childrenCount>0);\n\tselect '    Remaining action groups', count(*) from task where (projectinfo is null) and (dateCompleted is null) and (childrenCount>0);\n\tselect '    Completed action groups', count(dateCompleted) from task where (projectinfo is null) and (childrenCount>0);\n\tselect null;\n\t\"\n\tset tasks_cmd to \"\n\tselect 'ALL TASKS', count(*) from task;\n\tselect null;\n\t\"\n\tset actions_cmd to \"\n\tselect 'ACTIONS', count(*) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Completed actions', count(dateCompleted) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Dropped project actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp where (projectinfo is null) and (childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is not null and (tp.status='dropped' or tp.folderEffectiveActive=0));\n\tselect '    Dropped context actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand c.effectiveActive= 0;\n\tselect '    Remaining actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1);\n\tselect '        Actions in Projects on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is not null and tp.status='inactive');\n\tselect '        Actions in Contexts on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is not null and c.allowsNextAction=0);\n\tselect '        Blocked actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1;\n\tselect '        \tBlocked by future start date', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=1;\n\tselect '        \tSequentially blocked', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=0;\n\tselect '        Available actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=0;\n\tselect null;\n\t\"\n\tset summary_cmd to \"\n\tselect 'SUMMARY';\n\tselect '    Inbox available actions', count(*) from task where (inInbox=1) and (dateCompleted is null);\n\tselect '    Due in next week', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01');\n\tselect '    Flagged projects and actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand tp.effectiveFlagged;\n\tselect '    Due or Flagged', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand (tp.effectiveFlagged or (effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01')));\n\tselect null;\n\t\"\n\tif brief then\n\t\tset commands to projects_cmd & lists_cmd & contexts_cmd & groups_cmd & actions_cmd & summary_cmd\n\telse\n\t\tset commands to inbox_cmd & folders_cmd & projects_cmd & lists_cmd & contexts_cmd & groups_cmd & actions_cmd & tasks_cmd & summary_cmd\n\tend if\n\tset strCmd to \"sqlite3 -separator ': ' \\\"\" & pstrDBPath & \"\\\" \" & quoted form of (commands)\n\t\n\t-- \t\ttry\n\tset strList to do shell script strCmd\n\t-- \t\ton error\n\t-- \t\t\tdisplay dialog \"The SQL schema for the OmniFocus cache may have changed in a recent update of OF.\" & return & return & \n\t-- \t\t\t\t\"Look on the OmniFocus user forums for an updated version of this script.\" buttons {\"OK\"} with title pTitle & \"Ver. \" & pVersion\n\t-- \t\t\treturn\n\t-- \t\tend try\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tif button returned of (display dialog strList buttons {pToClipboard, \"OK\"} default button \"OK\" giving up after pTimeOut with title pTitle & \" Ver. \" & pVersion) \n\t\t\tis pToClipboard then tell application id \"com.apple.finder\" to set the clipboard to strList\n\tend tell\nelse\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tdisplay dialog \"OmniFocus cache not found ...\" buttons {\"OK\"} default button 1 with title pTitle & \" Ver. \" & pVersion\n\tend tell\nend if\n\n\non FileExists(strPath)\n\t(do shell script \"test -e \" & strPath & \" ; echo $?\") = \"0\"\nend FileExists\n\non GetCachePath()\n\ttry\n\t\ttell application \"Finder\" to tell (application file id \"OFOC\") to \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/\" & its id & \"\/OmniFocusDatabase2\"\n\ton error\n\t\terror \"OmniFocus not installed ...\"\n\tend try\nend GetCachePath\n\n","new_contents":"property pTitle : \"OmniFocus: Quick Stats\"\nproperty pVersion : \"2.07.brett\"\n\nproperty pstrDBPath : \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/com.omnigroup.OmniFocus\/OmniFocusDatabase2\"\nproperty pstrMinOSX : \"10.9\"\n\nproperty pTimeOut : 30\n\n-- Original version: https:\/\/github.com\/RobTrew\/tree-tools\/blob\/master\/OmniFocus%20scripts\/Statistics\/QuickStats.applescript\n\n-- Copyright  2012, 2013, 2014 Robin Trew\n-- \n-- Permission is hereby granted, free of charge, \n-- to any person obtaining a copy of this software \n-- and associated documentation files (the \"Software\"), \n-- to deal in the Software without restriction, \n-- including without limitation the rights to use, copy, \n-- modify, merge, publish, distribute, sublicense, \n-- and\/or sell copies of the Software, and to permit persons \n-- to whom the Software is furnished to do so, \n-- subject to the following conditions:\n-- \n-- *******\n-- The above copyright notice and this permission notice \n-- shall be included in ALL copies \n-- or substantial portions of the Software.\n-- *******\n-- \n-- THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, \n-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES \n-- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \n-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \n-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, \n-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE \n-- OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n-- Ver 0.8 adds clipboard option to dialogue\n-- Ver 0.9 gives an error message if the cache schema has changed, leading to an SQL error in the script\n-- Ver 1.0 slight simplification of the code\n-- Ver 1.1 added count of Pending projects\n-- Ver 1.2 added a count of available actions\n-- Ver 1.3 added a break-down of unavailable actions\n-- Ver 1.4 added count of Current projects to complement Pending projects\n-- ver 1.5 replaced Applescript time function with SQL time expression\n-- Ver 1.7 Reorganizes menu, and attempts to enable access for .macappstore installations of OF\n--Ver 1.8 Adjusts handling of variant bundle identifiers generally\n-- Ver 2.00 Redraft of task breakdown, with progressive narrowing of criteria ...\n\nproperty pToClipboard : \"Copy list to clipboard\"\n\nif not FileExists(pstrDBPath) then set pstrDBPath to GetCachePath()\n\ntell application \"Finder\"\n\tif (version < pstrMinOSX) then\n\t\tdisplay dialog \"This script requires OSX \" & pstrMinOSX & \" or higher\" buttons {\"OK\"} default button 1 with title pTitle & \"Ver. \" & pVersion\n\t\treturn\n\tend if\n\n\tset screen_resolution to bounds of window of desktop\n\tset height to item 4 of screen_resolution\n\tif height < 1024 then\n\t\tset brief to true\n\telse\n\t\tset brief to false\n\tend if\nend tell\n\nif pstrDBPath  \"\" then\n\tset inbox_cmd to \"\n\tselect 'INBOX GROUPS & ACTIONS', count(*) from task where (inInbox=1);\n\tselect '    Inbox action groups', count(*) from task where (inInbox=1) and (childrenCount>0);\n\tselect '    Inbox actions', count(*) from task where (inInbox=1) and (childrenCount=0);\n\tselect null;\n\t\"\n\tset folders_cmd to \"\n\tselect 'FOLDERS'\t, count(*) from folder;\n\tselect '    Active folders', count(*) from folder where effectiveActive=1;\n\tselect '    Dropped folders', count(*) from folder where effectiveActive=0;\n\tselect null;\n\t\"\n\tset projects_cmd to \"\n\tselect 'PROJECTS', count(*) from projectInfo where containsSingletonActions=0;\n\tselect '    Active projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='active');\n\tselect '            Current projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart is null or t.dateToStart < (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '            Pending projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart > (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '    On-hold projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='inactive');\n\tselect '    Completed projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='done');\n\tselect '    Dropped projects', count(*) from projectInfo where (containsSingletonActions=0) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset lists_cmd to \"\n\tselect 'SINGLE ACTION LISTS', count(*) from projectInfo where containsSingletonActions=1;\n\tselect '    Active single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='active');\n\tselect '    On-hold single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='inactive');\n\tselect '    Completed single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='done');\n\tselect '    Dropped single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset contexts_cmd to \"\n\tselect 'CONTEXTS', count(*) from context;\n\tselect '    Active contexts', count(*) from context where (effectiveActive=1) and (allowsNextAction=1);\n\tselect '    On-hold contexts', count(*) from context where (effectiveActive=1) and allowsNextAction=0;\n\tselect '    Dropped contexts', count(*) from context where effectiveActive=0;\n\tselect null;\n\t\"\n\tset groups_cmd to \"\n\tselect 'ACTION GROUPS', count(*) from task where (projectinfo is null) and (childrenCount>0);\n\tselect '    Remaining action groups', count(*) from task where (projectinfo is null) and (dateCompleted is null) and (childrenCount>0);\n\tselect '    Completed action groups', count(dateCompleted) from task where (projectinfo is null) and (childrenCount>0);\n\tselect null;\n\t\"\n\tset tasks_cmd to \"\n\tselect 'ALL TASKS', count(*) from task;\n\tselect null;\n\t\"\n\tset actions_cmd to \"\n\tselect 'ACTIONS', count(*) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Completed actions', count(dateCompleted) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Dropped project actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp where (projectinfo is null) and (childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is not null and (tp.status='dropped' or tp.folderEffectiveActive=0));\n\tselect '    Dropped context actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand c.effectiveActive= 0;\n\tselect '    Remaining actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1);\n\tselect '        Actions in Projects on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is not null and tp.status='inactive');\n\tselect '        Actions in Contexts on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is not null and c.allowsNextAction=0);\n\tselect '        Blocked actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1;\n\tselect '        \tBlocked by future start date', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=1;\n\tselect '        \tSequentially blocked', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=0;\n\tselect '        Available actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=0;\n\tselect null;\n\t\"\n\tset summary_cmd to \"\n\tselect 'SUMMARY';\n\tselect '    Inbox available actions', count(*) from task where (inInbox=1) and (dateCompleted is null);\n\tselect '    Due in next week', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01');\n\tselect '    Flagged projects and actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand tp.effectiveFlagged;\n\tselect '    Due or Flagged', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand (tp.effectiveFlagged or (effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01')));\n\tselect null;\n\t\"\n\tif brief then\n\t\tset commands to summary_cmd & actions_cmd & projects_cmd & contexts_cmd\n\telse\n\t\tset commands to summary_cmd & actions_cmd & inbox_cmd & folders_cmd & projects_cmd & lists_cmd & contexts_cmd & groups_cmd & tasks_cmd\n\tend if\n\tset strCmd to \"sqlite3 -separator ': ' \\\"\" & pstrDBPath & \"\\\" \" & quoted form of (commands)\n\t\n\t-- \t\ttry\n\tset strList to do shell script strCmd\n\t-- \t\ton error\n\t-- \t\t\tdisplay dialog \"The SQL schema for the OmniFocus cache may have changed in a recent update of OF.\" & return & return & \n\t-- \t\t\t\t\"Look on the OmniFocus user forums for an updated version of this script.\" buttons {\"OK\"} with title pTitle & \"Ver. \" & pVersion\n\t-- \t\t\treturn\n\t-- \t\tend try\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tif button returned of (display dialog strList buttons {pToClipboard, \"OK\"} default button \"OK\" giving up after pTimeOut with title pTitle & \" Ver. \" & pVersion) \n\t\t\tis pToClipboard then tell application id \"com.apple.finder\" to set the clipboard to strList\n\tend tell\nelse\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tdisplay dialog \"OmniFocus cache not found ...\" buttons {\"OK\"} default button 1 with title pTitle & \" Ver. \" & pVersion\n\tend tell\nend if\n\n\non FileExists(strPath)\n\t(do shell script \"test -e \" & strPath & \" ; echo $?\") = \"0\"\nend FileExists\n\non GetCachePath()\n\ttry\n\t\ttell application \"Finder\" to tell (application file id \"OFOC\") to \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/\" & its id & \"\/OmniFocusDatabase2\"\n\ton error\n\t\terror \"OmniFocus not installed ...\"\n\tend try\nend GetCachePath\n\n","subject":"bring summary and actions to top, trim list in brief mode","message":"bring summary and actions to top, trim list in brief mode\n","lang":"AppleScript","license":"apache-2.0","repos":"brettporter\/omnifocus-tools"}
{"commit":"207414b281cd3df97d5fe1329168339522838344","old_file":"library\/fmGUI_ManageDatabase\/fmGUI_ManageDb_Open.applescript","new_file":"library\/fmGUI_ManageDatabase\/fmGUI_ManageDb_Open.applescript","old_contents":"-- fmGUI_ManageDb_Open(prefs)\n-- Daniel A. Shockley, NYHTC\n-- Open Manage Database\n\n\n(*\nHISTORY:\n\t1.4 - 2020-05-20 ( dshockley ): added multiple missing sub-handlers. Removed referfence to old sub-handler. \n\t1.3 - 2018-04-30 ( eshagdar ): get window name via handler.\n\t1.2 - added xDBC connection error trapping\n\t1.1 - \n\t1.0 - created\n\n\nTODO:\n\t- 2015-06-03 ( eshagdar ): probably going to need to open manageDB via openManageDB script if the menu item fails\n\n\nREQUIRES:\n\tfmGUI_AppFrontMost\n\tfmGUI_ManageDb_DismissXDBCDialog\n\tfmGUI_ManageDb_GoToTab_Relationships\n\tfmGUI_Menu_OpenDB\n\tfmGUI_NameOfFrontmostWindow\n*)\n\n\non run\n\tfmGUI_ManageDb_Open({})\nend run\n\n--------------------\n-- START OF CODE\n--------------------\n\non fmGUI_ManageDb_Open(prefs)\n\t-- version 1.4\n\t\n\ttry\n\t\tfmGUI_AppFrontMost()\n\t\t\n\t\t\n\t\t-- try to open Manage DB\n\t\tset windowName to fmGUI_NameOfFrontmostWindow()\n\t\tif windowName starts with \"Manage Database for\" then\n\t\t\treturn true\n\t\telse\n\t\t\tfmGUI_Menu_OpenDB({})\n\t\t\t\n\t\t\t\n\t\t\t-- dismiss any initial xDBC connection errors\n\t\t\tfmGUI_ManageDb_DismissXDBCDialog({})\n\t\t\t\n\t\t\t\n\t\t\t-- go to the TOs tab and AGAIN dismiss any xDBC connections that failed to connect\n\t\t\tfmGUI_ManageDb_GoToTab_Relationships({})\n\t\t\tdelay 1\n\t\t\tfmGUI_ManageDb_DismissXDBCDialog({})\n\t\t\t\n\t\t\t\n\t\t\t--zoom out to show all TOs and dismiss any xDBC errors that weren't already dismissed\n\t\t\ttell application \"System Events\"\n\t\t\t\ttell application process \"FileMaker Pro Advanced\"\n\t\t\t\t\tkeystroke \"i\" using command down\n\t\t\t\tend tell\n\t\t\tend tell\n\t\t\tdelay 1\n\t\t\tfmGUI_ManageDb_DismissXDBCDialog({})\n\t\t\t\n\t\t\t\n\t\t\t-- zoom back in\n\t\t\ttell application \"System Events\"\n\t\t\t\ttell application process \"FileMaker Pro Advanced\"\n\t\t\t\t\tset zoomField to text field 1 of tab group 1 of window 1\n\t\t\t\t\tset focused of zoomField to true\n\t\t\t\t\tset value of zoomField to \"100\"\n\t\t\t\tend tell\n\t\t\tend tell\n\t\t\t\n\t\t\treturn true\n\t\tend if\n\ton error errMsg number errNum\n\t\terror \"Couldn't open manage DB - \" & errMsg number errNum\n\tend try\n\t\nend fmGUI_ManageDb_Open\n\n--------------------\n-- END OF CODE\n--------------------\n\non fmGUI_AppFrontMost(prefs)\n\ttell application \"Finder\" to set handlerPath to ((container of (path to me)) as text) & \"fmGUI_AppFrontMost\" & \".scpt\"\n\ttell (load script alias handlerPath) to return fmGUI_AppFrontMost(prefs)\nend fmGUI_AppFrontMost\n\non fmGUI_ManageDb_DismissXDBCDialog(prefs)\n\ttell application \"Finder\" to set handlerPath to ((container of (path to me)) as text) & \"fmGUI_ManageDb_DismissXDBCDialog\" & \".scpt\"\n\ttell (load script alias handlerPath) to return fmGUI_ManageDb_DismissXDBCDialog(prefs)\nend\n\non fmGUI_ManageDb_GoToTab_Relationships(prefs)\n\ttell application \"Finder\" to set handlerPath to ((container of (path to me)) as text) & \"fmGUI_ManageDb_GoToTab_Relationships\" & \".scpt\"\n\ttell (load script alias handlerPath) to return fmGUI_ManageDb_GoToTab_Relationships(prefs)\nend\n\non fmGUI_Menu_OpenDB(prefs)\n\ttell application \"Finder\" to set handlerPath to ((container of (path to me)) as text) & \"fmGUI_Menu_OpenDB\" & \".scpt\"\n\ttell (load script alias handlerPath) to return fmGUI_Menu_OpenDB(prefs)\nend\n\non fmGUI_NameOfFrontmostWindow(prefs)\n\ttell application \"Finder\" to set handlerPath to ((container of (path to me)) as text) & \"fmGUI_NameOfFrontmostWindow\" & \".scpt\"\n\ttell (load script alias handlerPath) to return fmGUI_NameOfFrontmostWindow(prefs)\nend\n","new_contents":"-- fmGUI_ManageDb_Open(prefs)\n-- Daniel A. Shockley, NYHTC\n-- Open Manage Database\n\n\n(*\nHISTORY:\n\t1.4 - 2020-05-20 ( dshockley ): added multiple missing sub-handlers. Removed referfence to old sub-handler. \n\t1.3 - 2018-04-30 ( eshagdar ): get window name via handler.\n\t1.2 - added xDBC connection error trapping\n\t1.1 - \n\t1.0 - created\n\n\nTODO:\n\t- 2015-06-03 ( eshagdar ): probably going to need to open manageDB via openManageDB script if the menu item fails\n\n\nREQUIRES:\n\tfmGUI_AppFrontMost\n\tfmGUI_ManageDb_DismissXDBCDialog\n\tfmGUI_ManageDb_GoToTab_Relationships\n\tfmGUI_Menu_OpenDB\n\tfmGUI_NameOfFrontmostWindow\n*)\n\n\non run\n\tfmGUI_ManageDb_Open({})\nend run\n\n--------------------\n-- START OF CODE\n--------------------\n\non fmGUI_ManageDb_Open(prefs)\n\t-- version 1.4\n\t\n\ttry\n\t\tfmGUI_AppFrontMost()\n\t\t\n\t\t\n\t\t-- try to open Manage DB\n\t\tset windowName to fmGUI_NameOfFrontmostWindow()\n\t\tif windowName starts with \"Manage Database for\" then\n\t\t\treturn true\n\t\telse\n\t\t\tfmGUI_Menu_OpenDB({})\n\t\t\t\n\t\t\t\n\t\t\t-- dismiss any initial xDBC connection errors\n\t\t\tfmGUI_ManageDb_DismissXDBCDialog({})\n\t\t\t\n\t\t\t\n\t\t\t-- go to the TOs tab and AGAIN dismiss any xDBC connections that failed to connect\n\t\t\tfmGUI_ManageDb_GoToTab_Relationships({})\n\t\t\tdelay 1\n\t\t\tfmGUI_ManageDb_DismissXDBCDialog({})\n\t\t\t\n\t\t\t\n\t\t\t--zoom out to show all TOs and dismiss any xDBC errors that weren't already dismissed\n\t\t\ttell application \"System Events\"\n\t\t\t\ttell application process \"FileMaker Pro Advanced\"\n\t\t\t\t\tkeystroke \"i\" using command down\n\t\t\t\tend tell\n\t\t\tend tell\n\t\t\tdelay 1\n\t\t\tfmGUI_ManageDb_DismissXDBCDialog({})\n\t\t\t\n\t\t\t\n\t\t\t-- zoom back in\n\t\t\ttell application \"System Events\"\n\t\t\t\ttell application process \"FileMaker Pro Advanced\"\n\t\t\t\t\tset zoomField to text field 1 of tab group 1 of window 1\n\t\t\t\t\tset focused of zoomField to true\n\t\t\t\t\tset value of zoomField to \"100\"\n\t\t\t\t\tkey code 48 (* tab out of the zoom field *)\n\t\t\t\tend tell\n\t\t\tend tell\n\t\t\t\n\t\t\treturn true\n\t\tend if\n\ton error errMsg number errNum\n\t\terror \"Couldn't open manage DB - \" & errMsg number errNum\n\tend try\n\t\nend fmGUI_ManageDb_Open\n\n--------------------\n-- END OF CODE\n--------------------\n\non fmGUI_AppFrontMost()\n\ttell application \"Finder\" to set handlerPath to ((container of (path to me)) as text) & \"fmGUI_AppFrontMost\" & \".scpt\"\n\ttell (load script alias handlerPath) to return fmGUI_AppFrontMost()\nend fmGUI_AppFrontMost\n\non fmGUI_ManageDb_DismissXDBCDialog(prefs)\n\ttell application \"Finder\" to set handlerPath to ((container of (path to me)) as text) & \"fmGUI_ManageDb_DismissXDBCDialog\" & \".scpt\"\n\ttell (load script alias handlerPath) to return fmGUI_ManageDb_DismissXDBCDialog(prefs)\nend fmGUI_ManageDb_DismissXDBCDialog\n\non fmGUI_ManageDb_GoToTab_Relationships(prefs)\n\ttell application \"Finder\" to set handlerPath to ((container of (path to me)) as text) & \"fmGUI_ManageDb_GoToTab_Relationships\" & \".scpt\"\n\ttell (load script alias handlerPath) to return fmGUI_ManageDb_GoToTab_Relationships(prefs)\nend fmGUI_ManageDb_GoToTab_Relationships\n\non fmGUI_Menu_OpenDB(prefs)\n\ttell application \"Finder\" to set handlerPath to ((container of (path to me)) as text) & \"fmGUI_Menu_OpenDB\" & \".scpt\"\n\ttell (load script alias handlerPath) to return fmGUI_Menu_OpenDB(prefs)\nend fmGUI_Menu_OpenDB\n\non fmGUI_NameOfFrontmostWindow()\n\ttell application \"Finder\" to set handlerPath to ((container of (path to me)) as text) & \"fmGUI_NameOfFrontmostWindow\" & \".scpt\"\n\ttell (load script alias handlerPath) to return fmGUI_NameOfFrontmostWindow()\nend fmGUI_NameOfFrontmostWindow\n","subject":"fix sub-handler params","message":"fix sub-handler params\n","lang":"AppleScript","license":"mit","repos":"NYHTC\/applescript-fm-helper"}
{"commit":"c9b66cf239a9aa19a6e64c67da9566b2bcb7a68a","old_file":"status.applescript","new_file":"status.applescript","old_contents":"on is_running(appName)\n\ttell application \"System Events\" to (name of processes) contains appName\nend is_running\n\nset nl to \"\n\"\n\nif is_running(\"Hermes\") then\n\ttell application \"Hermes\"\n\t\treturn \"__RUNNING__\" & nl & \n\t\t\tcurrent song's title & nl & \n\t\t\tcurrent song's artist & nl & \n\t\t\tcurrent song's album & nl & \n\t\t\tcurrent song's artwork URL\n\tend tell\nelse\n\treturn \"__NOT_RUNNING__\"\nend if","new_contents":"on is_running(appName)\n\ttell application \"System Events\" to (name of processes) contains appName\nend is_running\n\nset nl to \"\n\"\n\nif is_running(\"Hermes\") then\n\ttell application \"Hermes\"\n\t\treturn \"__RUNNING__\" & nl & \u00ac\n\t\t\tcurrent song's title & nl & \u00ac\n\t\t\tcurrent song's artist & nl & \u00ac\n\t\t\tcurrent song's album & nl & \u00ac\n\t\t\tcurrent song's artwork URL\n\tend tell\nelse\n\treturn \"__NOT_RUNNING__\"\nend if","subject":"Convert status.applescript to UTF-8","message":"Convert status.applescript to UTF-8\n","lang":"AppleScript","license":"mit","repos":"winny-\/HermesRemote,winny-\/HermesRemote"}
{"commit":"ee73f671ddba5b8b2f2bec6b17bae26e3a259cb5","old_file":"thumbscrew.scpt","new_file":"thumbscrew.scpt","old_contents":"property thumbSize : 480\n\non getImages(f)\n  tell application \"Finder\" to return (files of folder f) as alias list\nend getImages\n\non run argv\n  set keynotePresentation to item 1 of argv\n  set tmpKeynotePresentation to item 2 of argv\n\n  set keynotePresentation to (POSIX file keynotePresentation) as alias\n  set tmpkeynotePresentation to (POSIX file keynotePresentation) as alias\n\n  tell application \"Keynote\"\n    activate\n    open tmpkeynotePresentation\n\n    if playing is true then stop the front document\n    set documentName to the name of the front document\n    if documentName ends with \".key\" then set documentName to text 1 thru -5 of documentName\n\n    tell application \"Finder\"\n      set keynoteContainer to (container of keynotePresentation) as alias\n      if not (exists folder documentName of folder keynoteContainer)\n        make new folder at keynoteContainer with properties {name:documentName}\n      end if\n      set the targetFolder to folder documentName of folder keynoteContainer\n      set the targetFolderHFSPath to targetFolder as string\n    end tell\n\n    export front document as slide images to file targetFolderHFSPath with properties {image format: JPEG}\n    set jpegs to my getImages(targetFolderHFSPath)\n    repeat with thisJPEG in jpegs\n      try\n        tell application \"Image Events\"\n          launch\n          set this_image to open thisJPEG\n          scale this_image to size thumbSize\n          save this_image with icon\n          close this_image\n        end tell\n        on error error_message\n          display dialog error_message\n      end try\n    end repeat\n\n    close front document without saving\n  end tell\n  return POSIX path of keynoteContainer\nend run\n","new_contents":"-- thumbscrew.scpt\n-- usage: thumbscript.scpt <path_to_root_dir> <path_to_keynotePresentation> <presentation_name>\n--\n-- Will create scaled thumbnails of length `thumbSize` in the directory\n-- <path_to_root_dir>\/.keynote\/<presentation>\nproperty thumbSize : 480\nproperty thumbnailDir: \"keynotes\"\n\non getImages(f)\n  tell application \"Finder\" to return (files of folder f) as alias list\nend getImages\n\non run argv\n  set gitRoot to item 1 of argv\n  set tmpFile to item 2 of argv\n  set documentName to item 3 of argv\n  if documentName ends with \".key\" then set documentName to text 1 thru -5 of documentName\n\n  set gitRoot to posix file (POSIX path of (gitRoot as text) & \"\/\" & thumbnailDir) as alias\n  set tmpFile to (POSIX file tmpFile) as alias\n\n  tell application \"Keynote\"\n    activate\n    open tmpFile\n\n    if playing is true then stop the front document\n\n    tell application \"Finder\"\n      if not (exists folder documentName of folder gitRoot)\n        make new folder at gitRoot with properties {name:documentName}\n      end if\n      set the targetFolder to folder documentName of folder gitRoot\n      set the targetFolderHFSPath to targetFolder as string\n    end tell\n\n    export front document as slide images to file targetFolderHFSPath with properties {image format: JPEG}\n    set jpegs to my getImages(targetFolderHFSPath)\n    repeat with thisJPEG in jpegs\n      try\n        tell application \"Image Events\"\n          launch\n          set this_image to open thisJPEG\n          scale this_image to size thumbSize\n          save this_image with icon\n          close this_image\n        end tell\n        on error error_message\n          display dialog error_message\n      end try\n    end repeat\n\n    close front document without saving\n  end tell\n  return POSIX path of gitRoot\nend run\n","subject":"update applescript to work with a filter","message":"update applescript to work with a filter\n","lang":"AppleScript","license":"mit","repos":"helaili\/thumbscrew,azizshamim\/thumbscrew"}
{"commit":"110e250505efabd75064a8b8fd0d8cc2f430cbf1","old_file":"applescript\/notifyme.applescript","new_file":"applescript\/notifyme.applescript","old_contents":"#!\/usr\/bin\/env osascript\n\n-- see http:\/\/frantic.im\/notify-on-completion\non run argv\n  tell application \"System Events\"\n    set frontApp to name of first application process whose frontmost is true\n    if frontApp is not \"HyperTerm\" then\n      set notifTitle to item 1 of argv\n      set notifBody to \"succeded\"\n      set errorCode to item 2 of argv\n      if errorCode is not \"0\"\n        set notifBody to \"failed with error code \" & errorCode\n      end if\n      display notification notifBody with title notifTitle\n    end if\n  end tell\nend run\n","new_contents":"#!\/usr\/bin\/env osascript\n\n-- see http:\/\/frantic.im\/notify-on-completion\non run argv\n  tell application \"System Events\"\n    set frontApp to name of first application process whose frontmost is true\n    if frontApp is not \"iTerm2\" then\n      set notifTitle to item 1 of argv\n      set notifBody to \"succeded\"\n      set errorCode to item 2 of argv\n      if errorCode is not \"0\"\n        set notifBody to \"failed with error code \" & errorCode\n      end if\n      display notification notifBody with title notifTitle\n    end if\n  end tell\nend run\n","subject":"Revert \":wrench: notifyme script: use HyperTerm instead of iTerm\"","message":"Revert \":wrench: notifyme script: use HyperTerm instead of iTerm\"\n\nThis reverts commit 17cba7446fc7fffc5bb5d09646fc11f3a5a68bdc.\n","lang":"AppleScript","license":"unlicense","repos":"mistadikay\/dotfiles"}
{"commit":"80fdbab816472343c251e43134305732b58152cc","old_file":"itunes-concatenator\/itunes-concatenator\/DASAppDelegate.applescript","new_file":"itunes-concatenator\/itunes-concatenator\/DASAppDelegate.applescript","old_contents":"--\n--  DASAppDelegate.applescript\n--  itunes-concatenator\n--\n--  Created by David Schlachter on 2014-08-26.\n--  Copyright (c) 2014 Red Eft Software. All rights reserved.\n--\n\n-- via http:\/\/macscripter.net\/viewtopic.php?pid=173787 ; apparently needed for using arrays\n\nscript DASAppDelegate\n\tproperty parent : class \"NSObject\"\n\t\n    global these_files, these_times, these_titles, the_index, the_pipes, theCounter, cmdPrefix\n    \n\t-- IBOutlets\n\tproperty window : missing value\n    property trackTable : missing value\n    property catName : missing value\n    property catArtist : missing value\n    property catAlbum : missing value\n    property catComposer : missing value\n    property catGenre : missing value\n    property catTrack : missing value\n    property catTracks : missing value\n    property catDisc : missing value\n    property catDiscs : missing value\n    property catAlbumArtist : missing value\n    property catYear : missing value\n    \n    -- Again, per macscripter, we'll set up bindings for the options\n    property pcatName : \"\"\n    property pcatArtist : \"\"\n    property pcatAlbum : \"\"\n    property pcatComposer : \"\"\n    property pcatGenre : \"\"\n    property pcatTrack : \"\"\n    property pcatTracks : \"\"\n    property pcatDisc : \"\"\n    property pcatDiscs : \"\"\n    property pcatAlbumArtist : \"\"\n    property pcatYear : \"\"\n    \n    -- Empty strings for each file name and location\n    property pEachName : \"\"\n    property pEachLocation : \"\"\n    \n    property these_titles : {}\n    property these_files : {}\n    property these_times: {}\n    property the_index: {}\n    property the_pipes: {}\n    \n    property theCounter : \"\"\n    property cmdPrefix : \"if [[ -r \/etc\/profile ]];then . \/etc\/profile;fi;if [[ -r ~\/.bashrc ]];then . ~\/.bashrc;fi;if [[ -r ~\/.bash_profile ]];then . ~\/.bash_profile;fi;\"\n    \n    on awakeFromNib()\n        --\n        -- Check for FFMPEG and MP4v2\n        --\n        -- (This works, but it's ugly!)\n        --\n        --\n        try\n            do shell script cmdPrefix & \" if [ -x \\\"`\/usr\/bin\/which ffmpeg`\\\" ];then exit 0;else exit 1;fi\"\n        on error number error_number\n            display dialog \"You must install FFMPEG and MP4v2 to continue. \\n\\nYou may have to install Xcode Command Line Tools and Homebrew first. If you continue, we'll attempt to install them for you if they are not already present. \\n\\nIf you have already installed FFMPEG and MP4v2, ensure that they are in your bash path.\" buttons {\"Quit\",\"Install\"} default button 2\n            If button returned of result is \"Install\" then\n                try\n                    tell application \"Terminal\"\n                        -- TODO: This should be cleaner -- Terminal in front, only one window, focus back to the cat'er afterwards\n                        set newTab to do script cmdPrefix & \"if [[ -x `which brew` ]];then brew install ffmpeg;else \/usr\/bin\/ruby -e \\\"$(\/usr\/bin\/curl -fsSL https:\/\/raw.github.com\/Homebrew\/homebrew\/go\/install)\\\";brew install ffmpeg mp4v2;fi\"\n                        delay 4\n                        repeat\n                            delay 0.1\n                            if not busy of newTab then exit repeat\n                        end repeat\n                    end tell\n                     -- TODO: This needs a better test, i.e., check if ffmpeg is actually accessible on the path\n                    display dialog \"FFMPEG was successfully installed\"\n                    -- TODO: This should actually work! (Bring us back to the foreground)\n                    activate current application\n                on error number error_number\n                    display dialog \"FFMPEG did not successfully install\"\n                end try\n            end If\n            If button returned of result is \"Quit\" then\n                -- Fix!\n                current application's NSApp's terminate()\n            end If\n        end try\n    end awakeFromNib\n\n\n    on btnGetTracks_(sender)\n        -- Code to add iTunes tracks to our list\n        -- via http:\/\/dougscripts.com\/itunes\/itinfo\/info02.php and http:\/\/www.randomsequence.com\/articles\/applescript-to-send-selected-itunes-tracks-using-mail\/\n        tell application \"iTunes\"\n            set these_titles to {}\n            set these_times to {}\n            set these_files to {}\n            set the_index to {}\n            if selection is not {} then -- there ARE tracks selected...\n                set mySelection to selection\n                set i to 1\n                repeat with aTrack in mySelection\n                    if class of aTrack is file track then\n                        set end of these_titles to ((name of aTrack) as string)\n                        set end of these_times to ((time of aTrack) as string)\n                        set end of these_files to (posix path of (get location of aTrack))\n                        set end of the_index to (count of these_titles)\n                        -- Get metadata from the first track\n                        if i is 1 then\n                            set pcatArtist to ((artist of aTrack) as string)\n                            set pcatAlbum to ((album of aTrack) as string)\n                            set pcatComposer to ((composer of aTrack) as string)\n                            set pcatGenre to ((genre of aTrack) as string)\n                            set pcatDisc to ((disc number of aTrack) as string)\n                            set pcatDiscs to ((disc count of aTrack) as string)\n                            set pcatAlbumArtist to ((album artist of aTrack) as string)\n                            set pcatYear to ((year of aTrack) as string)\n                        end if\n                        set i to (i + 1)\n                    end if\n                end repeat\n            end if\n        end tell\n        -- Display the songs to be concatenated\n        -- via http:\/\/stackoverflow.com\/questions\/25537750\/setstringvalue-with-applescript-list\n        set olddelimeters to AppleScript's text item delimiters\n        set AppleScript's text item delimiters to \"\\n\"\n        set disp_titles to these_titles as string\n        trackTable's setStringValue_(disp_titles)\n        set AppleScript's text item delimiters to olddelimeters\n        -- Update the default metadata\n        catArtist's setStringValue_(pcatArtist)\n        catAlbum's setStringValue_(pcatAlbum)\n        catComposer's setStringValue_(pcatComposer)\n        catGenre's setStringValue_(pcatGenre)\n        catDisc's setStringValue_(pcatDisc)\n        catDiscs's setStringValue_(pcatDiscs)\n        catAlbumArtist's setStringValue_(pcatAlbumArtist)\n        catYear's setStringValue_(pcatYear)\n    end btnGetTracks_\n\n    on btnConcatenate_(sender)\n        -- Update the metadata variables with the user's input\n        set pcatName to catName's stringValue()\n        set pcatArtist to catArtist's stringValue()\n        set pcatAlbum to catAlbum's stringValue()\n        set pcatComposer to catComposer's stringValue()\n        set pcatGenre to catGenre's stringValue()\n        set pcatTrack to catTrack's stringValue()\n        set pcatTracks to catTracks's stringValue()\n        set pcatDisc to catDisc's stringValue()\n        set pcatDiscs to catDiscs's stringValue()\n        set pcatAlbumArtist to catAlbumArtist's stringValue()\n        set pcatYear to catYear's stringValue()\n        set the_pipes to {}\n        repeat with theIndex in the_index\n            -- TODO: Needs error checking!\n            -- TODO: We need to check what kind of audio files we have, then adjust accordingly\n            do shell script (cmdPrefix & \"ffmpeg -i \\\"\" & (item theIndex of these_files as text) & \"\\\" -c copy -bsf:v h264_mp4toannexb -f mpegts \/private\/tmp\/concat\" & theIndex & \".ts 2> \/dev\/null\" as text)\n            log (\"Processed file number\" & theIndex) as text\n            set end of the_pipes to (\"\/private\/tmp\/concat\" & theIndex & \".ts\" as text)\n        end repeat\n        -- Run the actual concatenation command in ffmpeg (for mp4\/AAC files only!)\n        -- via https:\/\/trac.ffmpeg.org\/wiki\/How%20to%20concatenate%20(join,%20merge)%20media%20files\n        set olddelimeters to AppleScript's text item delimiters\n        set AppleScript's text item delimiters to \"|\"\n        set disp_thepipes to the_pipes as string\n        do shell script (cmdPrefix & \"ffmpeg -f mpegts -i \\\"concat:\" & (disp_thepipes as text) & \"\\\" -c copy -bsf:a aac_adtstoasc \/private\/tmp\/cat.mp4\")\n        set AppleScript's text item delimiters to olddelimeters\n        -- Now let's create the chapter file\n        repeat with theIndex in the_index\n            if theIndex < 2 then\n                do shell script (\"\/bin\/echo \\\"00:00:00.000 \" & (item theIndex of these_titles as text) & \"\\\" > \/private\/tmp\/cat.chapters.txt\" as text)\n                set theCounter to (do shell script (cmdPrefix & \"ffprobe -loglevel panic -show_streams \/private\/tmp\/concat\" & (theIndex as text) & \".ts | egrep -m 1 'duration=[0-9]+\\\\.' | sed 's\/duration=\\\\([0-9]*[0-9]\\\\.[0-9]*\\\\)\/\\\\1\/'\" as text) as string)\n                set theCounter to (do shell script (\"\/bin\/echo $(\/usr\/bin\/printf %.$2f $(\/bin\/echo \\\"`\/usr\/bin\/printf %.3f \" & theCounter & \"` * 1000\\\" | \/usr\/bin\/bc))\") as string)\n            else\n                set theDateStamp to do shell script (cmdPrefix & \"t=\"& (theCounter as text) & \";((msec=t%1000, t\/=1000, sec=t%60, t\/=60, min=t%60, hrs=t\/60));timestamp=$(printf \\\"%02d:%02d:%02d.%03d\\\" $hrs $min $sec $msec);\/bin\/echo $timestamp\" as text)\n                do shell script (\"\/bin\/echo \\\"\" & (theDateStamp as text) & \" \" & (item theIndex of these_titles as text) & \"\\\" >> \/private\/tmp\/cat.chapters.txt\" as text)\n                set theNewCounter to do shell script ((cmdPrefix & \"ffprobe -loglevel panic -show_streams \/private\/tmp\/concat\" & (theIndex as text) & \".ts | egrep -m 1 'duration=[0-9]+\\\\.' | sed 's\/duration=\\\\([0-9]*[0-9]\\\\.[0-9]*\\\\)\/\\\\1\/'\" as text) as string)\n                set theNewCounter to do shell script (\"\/bin\/echo $(\/usr\/bin\/printf %.$2f $(\/bin\/echo \\\"`\/usr\/bin\/printf %.3f \" & theNewCounter & \"` * 1000\\\" | \/usr\/bin\/bc))\") as string\n                log \"theNewCounter is \" & theNewCounter\n                set theCounter to (theCounter + theNewCounter)\n                log (\"Post-addition, theCounter is \" & theCounter) as text\n            end if\n        end repeat\n        -- Chapterize cat.mp4\n        do shell script (cmdPrefix & \"mp4chaps -i \/private\/tmp\/cat.mp4\" as text)\n        -- Add tags\n        do shell script (cmdPrefix & \"mp4tags -song \\\"\" & pcatName & \"\\\" -album \\\"\" &  pcatAlbum & \"\\\" -artist \\\"\" &  pcatArtist & \"\\\" -writer \\\"\" &  pcatComposer & \"\\\" -genre \\\"\" &  pcatGenre & \"\\\" -track \\\"\" &  pcatTrack & \"\\\" -tracks \\\"\" &  pcatTracks & \"\\\" -disk \\\"\" &  pcatDisc & \"\\\" -disks \\\"\" &  pcatDiscs & \"\\\" -albumartist \\\"\" & pcatAlbumArtist & \"\\\" -year \\\"\" & pcatYear & \"\\\" \/private\/tmp\/cat.mp4\" as text)\n        -- Add the finished track to iTunes\n        do shell script \"\/bin\/mv \/private\/tmp\/cat.mp4 \/private\/tmp\/cat.m4a\"\n        tell application \"iTunes\"\n                add file \":private:tmp:cat.m4a\"\n        end tell\n        -- Clean up\n        do shell script \"\/bin\/rm \/private\/tmp\/concat* \/private\/tmp\/cat.chapters.txt \/private\/tmp\/cat.m4a\"\n        set theCounter to \"\"\n    end btnConcatenate_\n\n\n\ton applicationWillFinishLaunching_(aNotification)\n\t\t-- Insert code here to initialize your application before any files are opened\n\tend applicationWillFinishLaunching_\n\n\ton applicationShouldTerminate_(sender)\n\t\t-- Insert code here to do any housekeeping before your application quits\n\t\treturn current application's NSTerminateNow\n\tend applicationShouldTerminate_\n\nend script","new_contents":"--\n--  DASAppDelegate.applescript\n--  itunes-concatenator\n--\n--  Created by David Schlachter on 2014-08-26.\n--  Copyright (c) 2014 Red Eft Software. All rights reserved.\n--\n\n-- via http:\/\/macscripter.net\/viewtopic.php?pid=173787 ; apparently needed for using arrays\n\nscript DASAppDelegate\n\tproperty parent : class \"NSObject\"\n\t\n    global these_files, these_times, these_titles, the_index, the_pipes, theCounter, cmdPrefix\n    \n\t-- IBOutlets\n\tproperty window : missing value\n    property trackTable : missing value\n    property catName : missing value\n    property catArtist : missing value\n    property catAlbum : missing value\n    property catComposer : missing value\n    property catGenre : missing value\n    property catTrack : missing value\n    property catTracks : missing value\n    property catDisc : missing value\n    property catDiscs : missing value\n    property catAlbumArtist : missing value\n    property catYear : missing value\n    \n    -- Again, per macscripter, we'll set up bindings for the options\n    property pcatName : \"\"\n    property pcatArtist : \"\"\n    property pcatAlbum : \"\"\n    property pcatComposer : \"\"\n    property pcatGenre : \"\"\n    property pcatTrack : \"\"\n    property pcatTracks : \"\"\n    property pcatDisc : \"\"\n    property pcatDiscs : \"\"\n    property pcatAlbumArtist : \"\"\n    property pcatYear : \"\"\n    \n    -- Empty strings for each file name and location\n    property pEachName : \"\"\n    property pEachLocation : \"\"\n    \n    property these_titles : {}\n    property these_files : {}\n    property these_times: {}\n    property the_index: {}\n    property the_pipes: {}\n    \n    property theCounter : \"\"\n    property cmdPrefix : \"if [[ -r \/etc\/profile ]];then . \/etc\/profile;fi;if [[ -r ~\/.bashrc ]];then . ~\/.bashrc;fi;if [[ -r ~\/.bash_profile ]];then . ~\/.bash_profile;fi;\"\n    \n    on awakeFromNib()\n        --\n        -- Check for FFMPEG and MP4v2\n        --\n        -- (This works, but it's ugly!)\n        --\n        --\n        try\n            do shell script cmdPrefix & \" if [ -x \\\"`\/usr\/bin\/which ffmpeg`\\\" ];then exit 0;else exit 1;fi\"\n        on error number error_number\n            display dialog \"You must install FFMPEG and MP4v2 to continue. \\n\\nYou may have to install Xcode Command Line Tools and Homebrew first. If you continue, we'll attempt to install them for you if they are not already present. \\n\\nIf you have already installed FFMPEG and MP4v2, ensure that they are in your bash path.\" buttons {\"Quit\",\"Install\"} default button 2\n            If button returned of result is \"Install\" then\n                try\n                    tell application \"Terminal\"\n                        -- TODO: This should be cleaner -- Terminal in front, only one window, focus back to the cat'er afterwards\n                        set newTab to do script cmdPrefix & \"if [[ -x `which brew` ]];then brew install ffmpeg;else \/usr\/bin\/ruby -e \\\"$(\/usr\/bin\/curl -fsSL https:\/\/raw.github.com\/Homebrew\/homebrew\/go\/install)\\\";brew install ffmpeg mp4v2;fi\"\n                        delay 4\n                        repeat\n                            delay 0.1\n                            if not busy of newTab then exit repeat\n                        end repeat\n                    end tell\n                     -- TODO: This needs a better test, i.e., check if ffmpeg is actually accessible on the path\n                    display dialog \"FFMPEG was successfully installed\"\n                    -- TODO: This should actually work! (Bring us back to the foreground)\n                    activate current application\n                on error number error_number\n                    display dialog \"FFMPEG did not successfully install\"\n                end try\n            end If\n            If button returned of result is \"Quit\" then\n                -- Fix!\n                current application's NSApp's terminate()\n            end If\n        end try\n    end awakeFromNib\n\n\n    on btnGetTracks_(sender)\n        -- Code to add iTunes tracks to our list\n        -- via http:\/\/dougscripts.com\/itunes\/itinfo\/info02.php and http:\/\/www.randomsequence.com\/articles\/applescript-to-send-selected-itunes-tracks-using-mail\/\n        tell application \"iTunes\"\n            set these_titles to {}\n            set these_times to {}\n            set these_files to {}\n            set the_index to {}\n            if selection is not {} then -- there ARE tracks selected...\n                set mySelection to selection\n                set i to 1\n                repeat with aTrack in mySelection\n                    if class of aTrack is file track then\n                        set end of these_titles to ((name of aTrack) as string)\n                        set end of these_times to ((time of aTrack) as string)\n                        set end of these_files to (posix path of (get location of aTrack))\n                        set end of the_index to (count of these_titles)\n                        -- Get metadata from the first track\n                        if i is 1 then\n                            set pcatArtist to ((artist of aTrack) as string)\n                            set pcatAlbum to ((album of aTrack) as string)\n                            set pcatComposer to ((composer of aTrack) as string)\n                            set pcatGenre to ((genre of aTrack) as string)\n                            set pcatDisc to ((disc number of aTrack) as string)\n                            set pcatDiscs to ((disc count of aTrack) as string)\n                            set pcatAlbumArtist to ((album artist of aTrack) as string)\n                            set pcatYear to ((year of aTrack) as string)\n                        end if\n                        set i to (i + 1)\n                    end if\n                end repeat\n            end if\n        end tell\n        -- Display the songs to be concatenated\n        -- via http:\/\/stackoverflow.com\/questions\/25537750\/setstringvalue-with-applescript-list\n        set olddelimeters to AppleScript's text item delimiters\n        set AppleScript's text item delimiters to \"\\n\"\n        set disp_titles to these_titles as string\n        trackTable's setStringValue_(disp_titles)\n        set AppleScript's text item delimiters to olddelimeters\n        -- Update the default metadata\n        catArtist's setStringValue_(pcatArtist)\n        catAlbum's setStringValue_(pcatAlbum)\n        catComposer's setStringValue_(pcatComposer)\n        catGenre's setStringValue_(pcatGenre)\n        catDisc's setStringValue_(pcatDisc)\n        catDiscs's setStringValue_(pcatDiscs)\n        catAlbumArtist's setStringValue_(pcatAlbumArtist)\n        catYear's setStringValue_(pcatYear)\n        -- Reset the name and track fields\n        catName's setStringValue_(\"\")\n        catTrack's setStringValue_(\"\")\n        catTracks's setStringValue_(\"\")\n    end btnGetTracks_\n\n    on btnConcatenate_(sender)\n        -- Update the metadata variables with the user's input\n        set pcatName to catName's stringValue()\n        set pcatArtist to catArtist's stringValue()\n        set pcatAlbum to catAlbum's stringValue()\n        set pcatComposer to catComposer's stringValue()\n        set pcatGenre to catGenre's stringValue()\n        set pcatTrack to catTrack's stringValue()\n        set pcatTracks to catTracks's stringValue()\n        set pcatDisc to catDisc's stringValue()\n        set pcatDiscs to catDiscs's stringValue()\n        set pcatAlbumArtist to catAlbumArtist's stringValue()\n        set pcatYear to catYear's stringValue()\n        set the_pipes to {}\n        repeat with theIndex in the_index\n            -- TODO: Needs error checking!\n            -- TODO: We need to check what kind of audio files we have, then adjust accordingly\n            do shell script (cmdPrefix & \"ffmpeg -i \\\"\" & (item theIndex of these_files as text) & \"\\\" -c copy -bsf:v h264_mp4toannexb -f mpegts \/private\/tmp\/concat\" & theIndex & \".ts 2> \/dev\/null\" as text)\n            log (\"Processed file number\" & theIndex) as text\n            set end of the_pipes to (\"\/private\/tmp\/concat\" & theIndex & \".ts\" as text)\n        end repeat\n        -- Run the actual concatenation command in ffmpeg (for mp4\/AAC files only!)\n        -- via https:\/\/trac.ffmpeg.org\/wiki\/How%20to%20concatenate%20(join,%20merge)%20media%20files\n        set olddelimeters to AppleScript's text item delimiters\n        set AppleScript's text item delimiters to \"|\"\n        set disp_thepipes to the_pipes as string\n        do shell script (cmdPrefix & \"ffmpeg -f mpegts -i \\\"concat:\" & (disp_thepipes as text) & \"\\\" -c copy -bsf:a aac_adtstoasc \/private\/tmp\/cat.mp4\")\n        set AppleScript's text item delimiters to olddelimeters\n        -- Now let's create the chapter file\n        repeat with theIndex in the_index\n            if theIndex < 2 then\n                do shell script (\"\/bin\/echo \\\"00:00:00.000 \" & (item theIndex of these_titles as text) & \"\\\" > \/private\/tmp\/cat.chapters.txt\" as text)\n                set theCounter to (do shell script (cmdPrefix & \"ffprobe -loglevel panic -show_streams \/private\/tmp\/concat\" & (theIndex as text) & \".ts | egrep -m 1 'duration=[0-9]+\\\\.' | sed 's\/duration=\\\\([0-9]*[0-9]\\\\.[0-9]*\\\\)\/\\\\1\/'\" as text) as string)\n                set theCounter to (do shell script (\"\/bin\/echo $(\/usr\/bin\/printf %.$2f $(\/bin\/echo \\\"`\/usr\/bin\/printf %.3f \" & theCounter & \"` * 1000\\\" | \/usr\/bin\/bc))\") as string)\n            else\n                set theDateStamp to do shell script (cmdPrefix & \"t=\"& (theCounter as text) & \";((msec=t%1000, t\/=1000, sec=t%60, t\/=60, min=t%60, hrs=t\/60));timestamp=$(printf \\\"%02d:%02d:%02d.%03d\\\" $hrs $min $sec $msec);\/bin\/echo $timestamp\" as text)\n                do shell script (\"\/bin\/echo \\\"\" & (theDateStamp as text) & \" \" & (item theIndex of these_titles as text) & \"\\\" >> \/private\/tmp\/cat.chapters.txt\" as text)\n                set theNewCounter to do shell script ((cmdPrefix & \"ffprobe -loglevel panic -show_streams \/private\/tmp\/concat\" & (theIndex as text) & \".ts | egrep -m 1 'duration=[0-9]+\\\\.' | sed 's\/duration=\\\\([0-9]*[0-9]\\\\.[0-9]*\\\\)\/\\\\1\/'\" as text) as string)\n                set theNewCounter to do shell script (\"\/bin\/echo $(\/usr\/bin\/printf %.$2f $(\/bin\/echo \\\"`\/usr\/bin\/printf %.3f \" & theNewCounter & \"` * 1000\\\" | \/usr\/bin\/bc))\") as string\n                log \"theNewCounter is \" & theNewCounter\n                set theCounter to (theCounter + theNewCounter)\n                log (\"Post-addition, theCounter is \" & theCounter) as text\n            end if\n        end repeat\n        -- Chapterize cat.mp4\n        do shell script (cmdPrefix & \"mp4chaps -i \/private\/tmp\/cat.mp4\" as text)\n        -- Add tags\n        do shell script (cmdPrefix & \"mp4tags -song \\\"\" & pcatName & \"\\\" -album \\\"\" &  pcatAlbum & \"\\\" -artist \\\"\" &  pcatArtist & \"\\\" -writer \\\"\" &  pcatComposer & \"\\\" -genre \\\"\" &  pcatGenre & \"\\\" -track \\\"\" &  pcatTrack & \"\\\" -tracks \\\"\" &  pcatTracks & \"\\\" -disk \\\"\" &  pcatDisc & \"\\\" -disks \\\"\" &  pcatDiscs & \"\\\" -albumartist \\\"\" & pcatAlbumArtist & \"\\\" -year \\\"\" & pcatYear & \"\\\" \/private\/tmp\/cat.mp4\" as text)\n        -- Add the finished track to iTunes\n        do shell script \"\/bin\/mv \/private\/tmp\/cat.mp4 \/private\/tmp\/cat.m4a\"\n        tell application \"iTunes\"\n                add file \":private:tmp:cat.m4a\"\n        end tell\n        -- Clean up\n        do shell script \"\/bin\/rm \/private\/tmp\/concat* \/private\/tmp\/cat.chapters.txt \/private\/tmp\/cat.m4a\"\n        set theCounter to \"\"\n    end btnConcatenate_\n\n\n\ton applicationWillFinishLaunching_(aNotification)\n\t\t-- Insert code here to initialize your application before any files are opened\n\tend applicationWillFinishLaunching_\n\n\ton applicationShouldTerminate_(sender)\n\t\t-- Insert code here to do any housekeeping before your application quits\n\t\treturn current application's NSTerminateNow\n\tend applicationShouldTerminate_\n\nend script","subject":"Reset the name and track w\/new batches","message":"Reset the name and track w\/new batches\n","lang":"AppleScript","license":"bsd-2-clause","repos":"davidschlachter\/itunes-concatenator,davidschlachter\/itunes-concatenator"}
{"commit":"0793e09795672dbda0c754865b617dadc46cdd41","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\n-- brings queue into view in iTunes window\non focusQueue()\n\n\ttell application \"iTunes\"\n\n\t\treveal user playlist workflowPlaylistName\n\n\tend tell\n\nend focusQueue\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to first user playlist whose id is playlistId\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif disc number of theSong is discIndex and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset searchSongs to {}\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset searchSongs to (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset searchSongs to (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\t\trepeat with searchSong in searchSongs\n\n\t\t\t\t\t\tset duplicateSong to false\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif (database ID of theSong) is (database ID of searchSong) then\n\n\t\t\t\t\t\t\t\tset duplicateSong to true\n\t\t\t\t\t\t\t\texit repeat\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\t\tif duplicateSong is false then\n\n\t\t\t\t\t\t\tcopy searchSong to end of theSongs\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\n\tfocusQueue()\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tfocusQueue()\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\n-- brings queue into view in iTunes window\non focusQueue()\n\n\ttell application \"iTunes\"\n\n\t\treveal user playlist workflowPlaylistName\n\n\tend tell\n\nend focusQueue\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to first user playlist whose id is playlistId\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif disc number of theSong is discIndex and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\n\tfocusQueue()\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tfocusQueue()\n\tplayQueue()\n\nend play\n","subject":"Fix performance degredation introduced by 67b1c92","message":"Fix performance degredation introduced by 67b1c92\n\nThis change effectively reverts 67b1c92 while also making a\nsmall tweak to prevent the reappearance of duplicate results.\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"d7f825bf51f42726f85b82ad495f83206a039690","old_file":"applescripts\/halt_vagrant.applescript","new_file":"applescripts\/halt_vagrant.applescript","old_contents":"set close_vagrant to \"z puppet; git pull; vagrant halt -f;\"\n\n-- close vagrant\ntell application \"iTerm\"\n\tactivate\n\tset myterm to (make new terminal)\n\ttell myterm\n\t\tlaunch session \"Default\"\n\t\tset mysession to current session\n\tend tell\n\n\ttell mysession\n\t\twrite text close_vagrant\n\tend tell\n\n\tdelay 5\nend tell\n\n-- quit iTerm\nignoring application responses\n\ttell application \"iTerm\"\n\t\tquit\n\tend tell\nend ignoring\n\ndelay 2\ntell application \"System Events\" to keystroke return\n","new_contents":"set close_vagrant to \"z puppet; vagrant halt -f;\"\n\n-- close vagrant\ntell application \"iTerm\"\n\tactivate\n\tset myterm to (make new terminal)\n\ttell myterm\n\t\tlaunch session \"Default\"\n\t\tset mysession to current session\n\tend tell\n\n\ttell mysession\n\t\twrite text close_vagrant\n\tend tell\n\n\tdelay 5\nend tell\n\n-- quit iTerm\nignoring application responses\n\ttell application \"iTerm\"\n\t\tquit\n\tend tell\nend ignoring\n\ndelay 2\ntell application \"System Events\" to keystroke return\n","subject":"Remove git pull from closing Vagrant","message":"Remove git pull from closing Vagrant\n","lang":"AppleScript","license":"mit","repos":"smathson\/dotfiles"}
{"commit":"f86f9827824ce3a105e55d6c3d713e1fce934058","old_file":"applescripts\/open_chrome_tabs.applescript","new_file":"applescripts\/open_chrome_tabs.applescript","old_contents":"set myTabs to {\"http:\/\/app.getsentry.com\/\", \"http:\/\/app.ubervu.com\/\", \"http:\/\/github.com\/uberVU\/thehole\/issues\/assigned\/palcu?direction=desc&labels=&milestone=&page=1&sort=updated&state=open\/\", \"https:\/\/mail.google.com\/mail\/u\/1\/?shva=1#inbox\", \"https:\/\/drive.google.com\/a\/ubervu.com\/#folders\/0BzycGIkC5P50TXBlcTZoRXZ5VUE\"}\ntell application \"Google Chrome\"\n\tactivate\n\trepeat with i in myTabs\n\t\topen location i\n\tend repeat\nend tell\n","new_contents":"set myTabs to {\"http:\/\/app.getsentry.com\/\", \"http:\/\/github.com\/uberVU\/thehole\/issues\/assigned\/palcu?direction=desc&labels=&milestone=&page=1&sort=updated&state=open\/\", \"https:\/\/mail.google.com\/mail\/u\/1\/?shva=1#inbox\", \"https:\/\/drive.google.com\/a\/hootsuite.com\/#folders\/0BwuFsHJDxJWPYmxXQ1VQVlN6T2M\"}\ntell application \"Google Chrome\"\n\tactivate\n\trepeat with i in myTabs\n\t\topen location i\n\tend repeat\nend tell\n","subject":"Change tabs to open at work","message":"Change tabs to open at work\n","lang":"AppleScript","license":"mit","repos":"smathson\/dotfiles"}
{"commit":"6152fd762bfa11bbcea3880ddb957594933e714b","old_file":"scripts\/track\/finder.tmpl.scpt","new_file":"scripts\/track\/finder.tmpl.scpt","old_contents":"tell application \"iTunes\"\n  set specified_tracks to (every track whose #{conditions})\n\n\n\tset json to \"[\"\n\n\trepeat with specified_track in specified_tracks\n    set props to {}\n\n    set prop_name to name of specified_track\n\n    set end of props to \"{\"\n    set end of props to (\"\\\"persistent_id\\\":\\\"\" & persistent ID of specified_track & \"\\\",\")\n    set end of props to (\"\\\"name\\\":\\\"\" & my escape_quote(name of specified_track) & \"\\\",\")\n    set end of props to (\"\\\"album\\\":\\\"\" & my escape_quote(album of specified_track) & \"\\\",\")\n    set end of props to (\"\\\"artist\\\":\\\"\" & my escape_quote(artist of specified_track) & \"\\\",\")\n    set end of props to (\"\\\"track_count\\\":\\\"\" & track count of specified_track & \"\\\",\")\n    set end of props to (\"\\\"track_number\\\":\\\"\" & track number of specified_track & \"\\\"\")\n    set end of props to \"}\"\n\n    set json to json & props as string & \",\"\n  end repeat\n\n  set json to json & \"null]\"\n  return json\n\nend tell\n\n\non escape_quote(someText)\n return replaceText(someText, \"\\\"\", \"\\\\\\\"\")\nend escape_quote\n\n(*\n   https:\/\/discussions.apple.com\/thread\/4588230?start=0&tstart=0\n*)\non replaceText(someText, oldItem, newItem)\n     set {tempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, oldItem}\n     try\n          set {itemList, AppleScript's text item delimiters} to {text items of someText, newItem}\n          set {someText, AppleScript's text item delimiters} to {itemList as text, tempTID}\n     on error errorMessage number errorNumber -- oops\n          set AppleScript's text item delimiters to tempTID\n          error errorMessage number errorNumber -- pass it on\n     end try\n     \n     return someText\nend replaceText\n","new_contents":"tell application \"iTunes\"\n  set specified_tracks to (every track whose #{conditions})\n\n\n\tset json to \"[\"\n\n\trepeat with specified_track in specified_tracks\n    set props to {}\n\n    set end of props to \"{\"\n    set end of props to (\"\\\"persistent_id\\\":\\\"\" & persistent ID of specified_track & \"\\\",\")\n    set end of props to (\"\\\"name\\\":\\\"\" & my escape_quote(name of specified_track) & \"\\\",\")\n    set end of props to (\"\\\"album\\\":\\\"\" & my escape_quote(album of specified_track) & \"\\\",\")\n    set end of props to (\"\\\"artist\\\":\\\"\" & my escape_quote(artist of specified_track) & \"\\\",\")\n    set end of props to (\"\\\"track_count\\\":\\\"\" & track count of specified_track & \"\\\",\")\n    set end of props to (\"\\\"track_number\\\":\\\"\" & track number of specified_track & \"\\\"\")\n    set end of props to \"}\"\n\n    set json to json & props as string & \",\"\n  end repeat\n\n  set json to json & \"null]\"\n  return json\n\nend tell\n\n\non escape_quote(someText)\n return replaceText(someText, \"\\\"\", \"\\\\\\\"\")\nend escape_quote\n\n(*\n   https:\/\/discussions.apple.com\/thread\/4588230?start=0&tstart=0\n*)\non replaceText(someText, oldItem, newItem)\n     set {tempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, oldItem}\n     try\n          set {itemList, AppleScript's text item delimiters} to {text items of someText, newItem}\n          set {someText, AppleScript's text item delimiters} to {itemList as text, tempTID}\n     on error errorMessage number errorNumber -- oops\n          set AppleScript's text item delimiters to tempTID\n          error errorMessage number errorNumber -- pass it on\n     end try\n     \n     return someText\nend replaceText\n","subject":"Remove debug code.","message":"Remove debug code.\n","lang":"AppleScript","license":"mit","repos":"katsuma\/itunes-client"}
{"commit":"503881ae6b5f4b236bc0b559302b23615f44516c","old_file":"dated_deleter.scpt","new_file":"dated_deleter.scpt","old_contents":"-- stolen from: https:\/\/discussions.apple.com\/thread\/3172966\nproperty keyPhrase : \"Trashed on: \"\nproperty securityLevel : 2 -- overwrites: 1=1-pass, 2=7-pass, 3=35-pass,  see man srm\nproperty daysToWait : 7\n \ntell application \"Finder\"\n  -- get files in trash that are not new, and check dates\n          set oldFiles to (every item of trash whose comment contains keyPhrase)\n          set trashmeFiles to \"\"\n          repeat with thisFile in oldFiles\n  -- extract trashed date from the spotlight comments\n                    set trashedDate to last item of my tid(comment of thisFile, keyPhrase)\n                    try\n  -- check dates in a try block in case of weirdness)\n                              if my checkDate(trashedDate) then\n                                        set trashmeFiles to trashmeFiles & \" \" & my makePosix(thisFile as alias)\n                              end if\n                    end try\n          end repeat\n \n  -- trash 'em in a subroutine\n          my trashEm(trashmeFiles)\n \n  -- gather new files\n          set newFiles to every item of trash whose comment does not contain keyPhrase\n  -- add the current date to the spotlight comment of the new files\n          repeat with thisFile in newFiles\n                    set c to comment of thisFile\n                    if c = \"\" then\n                              set comment of thisFile to keyPhrase & short date string of (current date)\n                    else\n                              set comment of thisFile to c & return & keyPhrase & short date string of (current date)\n                    end if\n          end repeat\nend tell\n \non trashEm(fs)\n  -- set up proper security level\n          if securityLevel = 1 then\n                    set cmd to \"srm -rfsz\"\n          else if securityLevel = 3 then\n                    set cmd to \"srm -rfz\"\n          else\n                    set cmd to \"srm -rfmz\"\n          end if\n \n  -- start a secure delete process in the background\n          do shell script cmd & fs & \" &> \/dev\/null &\"\nend trashEm\n \non tid(input, delim)\n  -- generic subroutine to handle text items\n          set {oldTID, my text item delimiters} to {my text item delimiters, delim}\n          if class of input is list then\n                    set output to input as text\n          else\n                    set output to text items of input\n          end if\n          set my text item delimiters to oldTID\n          return output\nend tid\n \non makePosix(f)\n          return quoted form of POSIX path of f\nend makePosix\n \non checkDate(d)\n          return (date d) \u2264 (current date) - daysToWait * days\nend checkDate\n","new_contents":"-- stolen from: https:\/\/discussions.apple.com\/thread\/3172966\nproperty keyPhrase : \"Trashed on: \"\nproperty securityLevel : 2 -- overwrites: 1=1-pass, 2=7-pass, 3=35-pass,  see man srm\nproperty daysToWait : 7\n \ntell application \"Finder\"\n  -- get files in trash that are not new, and check dates\n          set oldFiles to (every item of trash whose comment contains keyPhrase)\n          set trashmeFiles to \"\"\n          repeat with thisFile in oldFiles\n  -- extract trashed date from the spotlight comments\n                    set trashedDate to last item of my tid(comment of thisFile, keyPhrase)\n                    try\n  -- check dates in a try block in case of weirdness)\n                              if my checkDate(trashedDate) then\n                                        set trashmeFiles to trashmeFiles & \" \" & my makePosix(thisFile as alias)\n                              end if\n                    end try\n          end repeat\n \n  -- trash 'em in a subroutine\n          my trashEm(trashmeFiles)\n \n  -- gather new files\n          set newFiles to every item of trash whose comment does not contain keyPhrase\n  -- add the current date to the spotlight comment of the new files\n          repeat with thisFile in newFiles\n                    set c to comment of thisFile\n                    if c = \"\" then\n                              set comment of thisFile to keyPhrase & short date string of (current date)\n                    else\n                              set comment of thisFile to c & return & keyPhrase & short date string of (current date)\n                    end if\n          end repeat\nend tell\n \non trashEm(fs)\n  -- set up proper security level\n          if securityLevel = 1 then\n                    set cmd to \"srm -rfsz\"\n          else if securityLevel = 3 then\n                    set cmd to \"srm -rfz\"\n          else\n                    set cmd to \"srm -rfmz\"\n          end if\n \n  -- start a secure delete process in the background\n          do shell script cmd & fs & \" &> \/dev\/null &\"\nend trashEm\n \non tid(input, delim)\n  -- generic subroutine to handle text items\n          set {oldTID, my text item delimiters} to {my text item delimiters, delim}\n          if class of input is list then\n                    set output to input as text\n          else\n                    set output to text items of input\n          end if\n          set my text item delimiters to oldTID\n          return output\nend tid\n \non makePosix(f)\n          return quoted form of POSIX path of f\nend makePosix\n \non checkDate(d)\n          return (date d) \u2264 short date string of ((current date) - daysToWait * days)\nend checkDate\n","subject":"allow for unusual short date strings","message":"allow for unusual short date strings","lang":"AppleScript","license":"mit","repos":"Mausy5043\/OSX-EmptyTrash"}
{"commit":"85dee6d965065091fca60395e17a2dec7256671b","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\tset songArtist to artist of theSong\n\t\t\tset songAlbum to album of theSong\n\t\t\t-- generate a unique identifier for that album\n\t\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t\t-- remove forbidden path characters\n\t\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\t\tend tell\n\n\t\ttell application \"Finder\"\n\n\t\t\t-- cache artwork if it's not already cached\n\t\t\tif not (songArtworkPath exists) then\n\n\t\t\t\ttell application \"Music\"\n\n\t\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t\t-- use default Music.app icon if song has no artwork\n\t\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\t-- save artwork to file\n\t\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\t\tend if\n\n\t\t\t\tend tell\n\n\t\t\tend if\n\n\t\tend tell\n\n\t\treturn songArtworkPath\n\n\ton error number -50\n\n\t\t-- in macOS Catalina (10.15), a parameter error (-50) is always thrown\n\t\t-- when attempting to access any property on a non-downloaded track's\n\t\t-- artwork. In other words, the track must have been downloaded to the\n\t\t-- user's library in order for the artwork to be downloadable\/cacheable\n\t\t-- by AppleScript; there is no known workaround, so in the meantime,\n\t\t-- catch this error and return the default icon ;(\n\t\treturn \"icon.png\"\n\n\tend try\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"Music\"\n\n\t\tset genreSongs to every track of playlist 2 whose genre is genreName\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in genreSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset genreSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset genreSongs to genreSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn genreSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in artistSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset artistSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName)\n\t\t\tset artistSongs to artistSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\tset songArtist to artist of theSong\n\t\t\tset songAlbum to album of theSong\n\t\t\t-- generate a unique identifier for that album\n\t\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t\t-- remove forbidden path characters\n\t\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\t\tend tell\n\n\t\ttell application \"Finder\"\n\n\t\t\t-- cache artwork if it's not already cached\n\t\t\tif not (songArtworkPath exists) then\n\n\t\t\t\ttell application \"Music\"\n\n\t\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t\t-- use default Music.app icon if song has no artwork\n\t\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\t\telse\n\n\t\t\t\t\t\t-- save artwork to file\n\t\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\t\tend if\n\n\t\t\t\tend tell\n\n\t\t\tend if\n\n\t\tend tell\n\n\t\treturn songArtworkPath\n\n\ton error number -50\n\n\t\t-- in macOS Catalina (10.15), a parameter error (-50) is always thrown\n\t\t-- when attempting to access any property on a non-downloaded track's\n\t\t-- artwork. In other words, the track must have been downloaded to the\n\t\t-- user's library in order for the artwork to be downloadable\/cacheable\n\t\t-- by AppleScript; there is no known workaround, so in the meantime,\n\t\t-- catch this error and return the default icon ;(\n\t\treturn defaultIconName\n\n\tend try\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"Music\"\n\n\t\tset genreSongs to every track of playlist 2 whose genre is genreName\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in genreSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset genreSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset genreSongs to genreSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn genreSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in artistSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset artistSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName)\n\t\t\tset artistSongs to artistSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","subject":"Use \"No Artwork\" icon for shared tracks","message":"Use \"No Artwork\" icon for shared tracks\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"1031074d0d92af86e032d1d05b06f4bf057b1dcc","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\n-- workflow folders\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\n\n-- the default icon used for search results without album artwork\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and use it to fetch album artwork\n\t\t\tset songId to persistent ID of theSong\n\t\t\t-- the base path to the artwork file (without extension)\n\t\t\tset artworkPath to (do shell script \".\/resources\/get-song-artwork-path.sh\" & space & songId & space & defaultIconName)\n\n\t\tend tell\n\n\t\treturn artworkPath\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\ttell application \"Music\"\n\n\t\treturn every track of playlist 2 whose genre is genreName\n\n\tend tell\n\nend getGenreSongs\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\n-- workflow folders\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\n\n-- the default icon used for search results without album artwork\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and use it to fetch album artwork\n\t\t\tset songId to persistent ID of theSong\n\t\t\t-- the base path to the artwork file (without extension)\n\t\t\tset artworkPath to (do shell script \".\/resources\/get-song-artwork-path.sh\" & space & songId & space & defaultIconName)\n\n\t\tend tell\n\n\t\treturn artworkPath\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\ttell application \"Music\"\n\n\t\tset genreSongs to every track of playlist 2 whose genre is genreName\n\n\tend tell\n\n\treturn genreSongs\n\nend getGenreSongs\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","subject":"Return in getGenreSongs like other functions","message":"Return in getGenreSongs like other functions\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"b03d8ba9fda01e24264d73b4d94b93c108bee6aa","old_file":"scripts\/reset_simulator.applescript","new_file":"scripts\/reset_simulator.applescript","old_contents":"(* commented out printer section for now\ntell application \"iPhone Simulator\" to activate\n\ntell application \"System Events\"\n    tell process \"iPhone Simulator\"\n        tell menu bar 1\n            tell menu bar item \"File\"\n                tell menu \"File\"\n                    click menu item \"Open Printer Simulator\"\n                end tell\n            end tell\n        end tell\n    end tell\nend tell\n*)\n\ntell application \"iPhone Simulator\" to activate\n\ntell application \"System Events\"\n    tell process \"iPhone Simulator\"\n        tell menu bar 1\n            tell menu bar item \"iOS Simulator\"\n                tell menu \"iOS Simulator\"\n                    click menu item \"Reset Content and Settings\u2026\"\n                end tell\n            end tell\n        end tell\n\n        tell window 1\n            click button \"Reset\"\n        end tell\n    end tell\nend tell\n\n-- tell application \"System Events\" to tell process \"Printer Simulator\" to set visible to false\n","new_contents":"(* commented out printer section for now\ntell application \"iPhone Simulator\" to activate\n\ntell application \"System Events\"\n    tell process \"iPhone Simulator\"\n        tell menu bar 1\n            tell menu bar item \"File\"\n                tell menu \"File\"\n                    click menu item \"Open Printer Simulator\"\n                end tell\n            end tell\n        end tell\n    end tell\nend tell\n*)\n\ntell application \"iPhone Simulator\" to launch\n\nset inTime to current date\nrepeat\n    tell application \"System Events\"\n        if \"iPhone Simulator\" is in (get name of processes) then exit repeat\n    end tell\n    if (current date) - inTime is greater than 10 then exit repeat\n    delay 0.2\nend repeat\n\ntell application \"iPhone Simulator\" to activate\n\nset inTime to current date\nrepeat\n    tell application \"System Events\"\n        if visible of process \"iPhone Simulator\" is true then exit repeat\n    end tell\n    if (current date) - inTime is greater than 10 then exit repeat\n    delay 0.2\nend repeat\n\ntell application \"System Events\"\n    tell process \"iPhone Simulator\"\n        tell menu bar 1\n            tell menu bar item \"iOS Simulator\"\n                tell menu \"iOS Simulator\"\n                    click menu item \"Reset Content and Settings\u2026\"\n                end tell\n            end tell\n        end tell\n\n        tell window 1\n            click button \"Reset\"\n        end tell\n    end tell\nend tell\n\ntell application \"iPhone Simulator\" to quit\n\nset inTime to current date\nrepeat\n    tell application \"System Events\"\n        if \"iPhone Simulator\" is not in (get name of processes) then exit repeat\n    end tell\n    if (current date) - inTime is greater than 10 then exit repeat\n    delay 0.2\nend repeat\n\n\n-- tell application \"System Events\" to tell process \"Printer Simulator\" to set visible to false\n","subject":"fix reset simulator script for new apple software versions","message":"fix reset simulator script for new apple software versions\n","lang":"AppleScript","license":"apache-2.0","repos":"paypal\/Illuminator,ifreecarve\/Illuminator,ifreecarve\/Illuminator,ifreecarve\/Illuminator,drptbl\/Illuminator,ifreecarve\/Illuminator,drptbl\/Illuminator,drptbl\/Illuminator,drptbl\/Illuminator,paypal\/Illuminator"}
{"commit":"63d331cdba9cf2a0321cc593ce85cca8ea6f03d2","old_file":"svgodrop.applescript","new_file":"svgodrop.applescript","old_contents":"(*\n\tSVGOdrop 1.0.1\n\t(c) 2016 Superpixel, Nico Rohrbach\n*)\n\nproperty extension_list : {\"svg\"}\n\nproperty pretty_code : true\nproperty remove_title : true\nproperty remove_desc : true\n\non run\n\tset these_items to choose file with multiple selections allowed\n\tcheck_files(these_items)\nend run\n\non open these_items\n\tcheck_files(these_items)\nend open\n\non check_files(these_items)\n\trepeat with i from 1 to the count of these_items\n\t\tset this_item to item i of these_items\n\t\tset the item_info to info for this_item\n\t\tif folder of the item_info is false then\n\t\t\ttry\n\t\t\t\tset this_extension to the name extension of item_info\n\t\t\ton error\n\t\t\t\tset this_extension to \"\"\n\t\t\tend try\n\t\t\tif (this_extension is in the extension_list) then\n\t\t\t\tprocess_file(this_item)\n\t\t\tend if\n\t\tend if\n\tend repeat\nend check_files\n\non process_file(this_item)\n\tset the file_path to the POSIX path of this_item\n\t-- set options\n\tset svgo_options to \"\"\n\tif pretty_code is true then\n\t\tset svgo_options to \"--pretty\"\n\tend if\n\tif remove_title is true then\n\t\tset svgo_options to svgo_options & \" --enable=removeTitle\"\n\tend if\n\tif remove_desc is true then\n\t\tset svgo_options to svgo_options & \" --enable=removeDesc\"\n\tend if\n\t-- do the job\n\ttry\n\t\tdo shell script \"\/bin\/bash -l -c 'svgo\" & space & svgo_options & space & \"\\\"\" & file_path & \"\\\"\" & \"'\"\n\ton error err_msg number err_num\n\t\tdisplay dialog \"Error: \" & err_msg buttons {\"OK\"} with icon stop\n\t\treturn err_num\n\tend try\nend process_file","new_contents":"(*\n\tSVGOdrop 1.0.2\n\t(c) 2016 Superpixel, Nico Rohrbach\n*)\n\nproperty extension_list : {\"svg\"}\n\nproperty pretty_code : true\nproperty remove_title : true\nproperty remove_desc : true\n\non run\n\tif isSVGOInstalled() is false then\n\t\tbeep\n\t\tdisplay alert \"SVGO seem not to be installed!\" message \n\t\t\t\"Install the tool via \\\"npm install -g svgo\\\" and try again.\" buttons \n\t\t\t{\"OK\"} default button \"OK\" as critical\n\t\treturn\n\tend if\n\tset these_items to choose file with multiple selections allowed\n\tcheck_files(these_items)\nend run\n\non open these_items\n\tif isSVGOInstalled() is false then\n\t\tbeep\n\t\tdisplay alert \"SVGO seem not to be installed!\" message \n\t\t\t\"Install the tool via \\\"npm install -g svgo\\\" and try again.\" buttons \n\t\t\t{\"OK\"} default button \"OK\" as critical\n\t\treturn\n\tend if\n\tcheck_files(these_items)\nend open\n\non isSVGOInstalled()\n\ttry\n\t\tset temp to do shell script \"\/bin\/bash -l -c 'svgo'\"\n\ton error err_msg number err_num\n\t\tif err_num is equal to 127 then\n\t\t\treturn false\n\t\telse\n\t\t\treturn true\n\t\tend if\n\tend try\nend isSVGOInstalled\n\non check_files(these_items)\n\trepeat with i from 1 to the count of these_items\n\t\tset this_item to item i of these_items\n\t\tset the item_info to info for this_item\n\t\tif folder of the item_info is false then\n\t\t\ttry\n\t\t\t\tset this_extension to the name extension of item_info\n\t\t\ton error\n\t\t\t\tset this_extension to \"\"\n\t\t\tend try\n\t\t\tif (this_extension is in the extension_list) then\n\t\t\t\tprocess_file(this_item)\n\t\t\tend if\n\t\tend if\n\tend repeat\nend check_files\n\non process_file(this_item)\n\tset the file_path to the POSIX path of this_item\n\t-- set options\n\tset svgo_options to \"\"\n\tif pretty_code is true then\n\t\tset svgo_options to \"--pretty\"\n\tend if\n\tif remove_title is true then\n\t\tset svgo_options to svgo_options & \" --enable=removeTitle\"\n\tend if\n\tif remove_desc is true then\n\t\tset svgo_options to svgo_options & \" --enable=removeDesc\"\n\tend if\n\t-- do the job\n\ttry\n\t\tdo shell script \"\/bin\/bash -l -c 'svgo\" & space & svgo_options & space & \"\\\"\" & file_path & \"\\\"\" & \"'\"\n\ton error err_msg number err_num\n\t\tbeep\n\t\tdisplay alert \"Error\" message err_msg buttons {\"OK\"} default button \"OK\" as critical\n\t\treturn err_num\n\tend try\nend process_file","subject":"check for the presence of SVGO on launch","message":"check for the presence of SVGO on launch\n","lang":"AppleScript","license":"mit","repos":"superpixel\/SVGOdrop"}
{"commit":"95d823a466dc795a65a7b53b185c626579494c08","old_file":"Uninstall.applescript","new_file":"Uninstall.applescript","old_contents":"property stdout : \"\"\non run\n\tset newline to ASCII character 10\n\t\n\tset stdout to stdout & \"  shutdown TotalFinderCrashWatcher ...\" & newline\n\ttry\n\t\tdo shell script \"killall -SIGINT TotalFinderCrashWatcher\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    TotalFinderCrashWatcher not running\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  shutdown Finder ...\" & newline\n\ttry\n\t\ttell application \"Finder\" to quit\n\ton error\n\t\tset stdout to stdout & \"    Finder was not running prior uninstallation\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.app from login items ...\" & newline\n\ttry\n\t\ttell application \"System Events\"\n\t\t\tget the name of every login item\n\t\t\tif login item \"TotalFinder.app\" exists then\n\t\t\t\tdelete login item \"TotalFinder.app\"\n\t\t\tend if\n\t\tend tell\n\ton error\n\t\tset stdout to stdout & \"    Encountered problems when removing TotalFinder.app from login items\"\n\tend try\n\t\n\t-- old version\n\tset stdout to stdout & \"  removing the old TotalFinder files (0.8.2 and earlier) ...\" & newline\n\ttry\n\t\tdo shell script \"sudo launchctl unload -w \\\"\/Library\/LaunchDaemons\/com.binaryage.echelon.launcher.plist\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -f \\\"\/Library\/LaunchDaemons\/com.binaryage.echelon.launcher.plist\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo kextunload \\\"\/System\/Library\/Extensions\/echelon.kext\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/System\/Library\/Extensions\/echelon.kext\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Library\/Application Support\/SIMBL\/Plugins\/TotalFinder.bundle\\\"\" with administrator privileges\n\tend try\n\t\n\t\n\t-- new version\n\tset stdout to stdout & \"  unload TotalFinder.kext ...\" & newline\n\ttry\n\t\tdo shell script \"sudo kextunload \\\"\/System\/Library\/Extensions\/TotalFinder.kext\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    TotalFinder.kext not loaded\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.app ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Applications\/TotalFinder.app\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Applications\/TotalFinder.app\" & newline\n\tend try\n\t\n\t\n\tset stdout to stdout & \"  remove TotalFinder.kext ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/System\/Library\/Extensions\/TotalFinder.kext\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/System\/Library\/Extensions\/TotalFinder.kext\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.osax ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Library\/ScriptingAdditions\/TotalFinder.osax\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Library\/ScriptingAdditions\/TotalFinder.osax\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  enable Finder animations again ...\" & newline\n\ttry\n\t\tdo shell script \"defaults write com.apple.finder DisableAllAnimations -bool false\" with administrator privileges\n\t\tdo shell script \"defaults write com.apple.finder AnimateWindowZoom -bool true\" with administrator privileges\n\t\tdo shell script \"defaults write com.apple.finder FXDisableFancyWindowTransition -bool false\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to enable animations back\" & newline\n\tend try\n\n\tset stdout to stdout & \"  hide system files in Finder again ...\" & newline\n\ttry\n\t\tdo shell script \"defaults write com.apple.finder AppleShowAllFiles -bool false\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    hide system files in Finder back\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  relaunch Finder ...\" & newline\n\ttry\n\t\ttell application \"Finder\" to launch\n\ton error\n\t\tset stdout to stdout & \"    failed to relaunch Finder\" & newline\n\tend try\n\t\n\t-- at this point Finder should start cleanly and with no signs of TotalFinder\n\t-- you may check Events\/Replies tab to see if there were no issues with uninstallation\n\t\n\tstdout -- this is needed for platypus to display output in details window\nend run","new_contents":"property stdout : \"\"\non run\n\tset newline to ASCII character 10\n\t\n\tset stdout to stdout & \"  shutdown TotalFinderCrashWatcher ...\" & newline\n\ttry\n\t\tdo shell script \"killall -SIGINT TotalFinderCrashWatcher\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    TotalFinderCrashWatcher was not running\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  shutdown Finder ...\" & newline\n\ttry\n\t\ttell application \"Finder\" to quit\n\ton error\n\t\tset stdout to stdout & \"    Finder was not running prior uninstallation\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.app from login items ...\" & newline\n\ttry\n\t\ttell application \"System Events\"\n\t\t\tget the name of every login item\n\t\t\tif login item \"TotalFinder.app\" exists then\n\t\t\t\tdelete login item \"TotalFinder.app\"\n\t\t\tend if\n\t\tend tell\n\ton error\n\t\tset stdout to stdout & \"    Encountered problems when removing TotalFinder.app from login items\"\n\tend try\n\t\n\t-- old version\n\tset stdout to stdout & \"  removing the old TotalFinder files (0.8.2 and earlier) ...\" & newline\n\ttry\n\t\tdo shell script \"sudo launchctl unload -w \\\"\/Library\/LaunchDaemons\/com.binaryage.echelon.launcher.plist\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -f \\\"\/Library\/LaunchDaemons\/com.binaryage.echelon.launcher.plist\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo kextunload \\\"\/System\/Library\/Extensions\/echelon.kext\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/System\/Library\/Extensions\/echelon.kext\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Library\/Application Support\/SIMBL\/Plugins\/TotalFinder.bundle\\\"\" with administrator privileges\n\tend try\n\t\n\t\n\t-- new version\n\tset stdout to stdout & \"  unload TotalFinder.kext ...\" & newline\n\ttry\n\t\tdo shell script \"sudo kextunload \\\"\/System\/Library\/Extensions\/TotalFinder.kext\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    TotalFinder.kext not loaded\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.app ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Applications\/TotalFinder.app\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Applications\/TotalFinder.app\" & newline\n\tend try\n\t\n\t\n\tset stdout to stdout & \"  remove TotalFinder.kext ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/System\/Library\/Extensions\/TotalFinder.kext\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/System\/Library\/Extensions\/TotalFinder.kext\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.osax ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Library\/ScriptingAdditions\/TotalFinder.osax\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Library\/ScriptingAdditions\/TotalFinder.osax\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  enable Finder animations again ...\" & newline\n\ttry\n\t\tdo shell script \"defaults write com.apple.finder DisableAllAnimations -bool false\" with administrator privileges\n\t\tdo shell script \"defaults write com.apple.finder AnimateWindowZoom -bool true\" with administrator privileges\n\t\tdo shell script \"defaults write com.apple.finder FXDisableFancyWindowTransition -bool false\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to enable animations back\" & newline\n\tend try\n\n\tset stdout to stdout & \"  hide system files in Finder again ...\" & newline\n\ttry\n\t\tdo shell script \"defaults write com.apple.finder AppleShowAllFiles -bool false\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    hide system files in Finder back\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  relaunch Finder ...\" & newline\n\ttry\n\t\ttell application \"Finder\" to launch\n\ton error\n\t\tset stdout to stdout & \"    failed to relaunch Finder\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"TotalFinder uninstallation done\" & newline\n\t\n\t-- at this point Finder should start cleanly and with no signs of TotalFinder\n\t-- you may check Events\/Replies tab to see if there were no issues with uninstallation\n\t\n\tstdout -- this is needed for platypus to display output in details window\nend run","subject":"add final message to the uninstaller","message":"add final message to the uninstaller\n","lang":"AppleScript","license":"bsd-3-clause","repos":"binaryage\/totalfinder-installer"}
{"commit":"bf2785dd256e04fa1ca204a6d5eeabcbb27971cc","old_file":"src\/Resources\/package.applescript","new_file":"src\/Resources\/package.applescript","old_contents":"-- Go AppleScript library\n\nproperty package : \"Go\"\nproperty packageRoot : missing value\n\n-- Get working directory for a given document\non getWorkingDirectory(doc)\n\ttell application \"Finder\"\n\t\treturn POSIX path of ((container of ((file of doc) as alias) as string))\n\tend tell\nend getWorkingDirectory\n\n-- Find Go.bbpackage root\n-- Assumption: this is *always* run from within the package!\non getPackageRoot()\n\ttell application \"Finder\"\n\t\tset cwd to ((container of (path to me)) as alias)\n\t\trepeat until name of cwd is \"Go.bbpackage\"\n\t\t\tset cwd to (container of cwd as alias)\n\t\tend repeat\n\tend tell\n\treturn POSIX path of (cwd as string)\nend getPackageRoot\n\non exec(doc, cmd)\n\ttell application \"BBEdit\"\n\t\tif source language of doc is not \"Go\" then\n\t\t\terror \"Not a Go source file\"\n\t\tend if\n\tend tell\n\t\n\tif packageRoot is missing value then\n\t\tset packageRoot to getPackageRoot()\n\tend if\n\t\n\tset runner to quoted form of (POSIX path of (packageRoot as string) & \"Contents\/Resources\/gorunner\")\n\tset shellCmd to runner & space & \"-d \" & POSIX path of ((file of doc) as alias) & space & cmd\n\treturn do shell script (shellCmd)\nend exec\n\non execCommands(doc, commands)\n\tset output to {}\n\trepeat with cmd in commands\n\t\tset entry to exec(doc, cmd)\n\t\tif length of entry > 0 then\n\t\t\tcopy entry to the end of output\n\t\tend if\n\tend repeat\n\treturn output\nend execCommands\n\non packagePath(doc)\n\treturn quoted form of exec(doc, \"go list\")\nend packagePath\n\n# Parse message into result browser entry\n#\n# Format:\n#     [\/path\/to\/file]:[line]:(col): [message]\non makeEntry(itemData, cwd)\n\ttry\n\t\t# Get source path\n\t\tset src to text 1 thru ((offset of \":\" in itemData) - 1) of itemData\n\t\tif src starts with \".\/\" then\n\t\t\tset srcFile to POSIX file (cwd & text 3 thru -1 of src)\n\t\telse\n\t\t\tset srcFile to POSIX file (src)\n\t\tend if\n\t\t\n\t\t# Get line:column\n\t\tset lineColumn to text ((offset of \":\" in itemData) + 1) thru ((offset of \": \" in itemData) - 1) of itemData\n\t\tset lineNumber to (text 1 thru ((offset of \":\" in lineColumn) - 1) of lineColumn) as number\n\t\tset columnNumber to (text ((offset of \":\" in lineColumn) + 1) thru -1 of lineColumn) as number\n\t\t\n\t\t# Get message\n\t\tset msg to text ((offset of \": \" in itemData) + 2) thru -1 of itemData\n\t\t\n\t\ttell application \"BBEdit\"\n\t\t\tset resultKind to error_kind\n\t\t\t#\tif resultType is \"note\" then\n\t\t\t#\t\tset resultKind to note_kind\n\t\t\t#\telse if resultType is \"warning\" then\n\t\t\t#\t\tset resultKind to warning_kind\n\t\t\t#\telse\n\t\t\t#\t\tset resultKind to error_kind\n\t\t\t#\tend if\n\t\t\t\n\t\t\tset entry to {result_kind:resultKind, result_file:srcFile, result_line:lineNumber, message:msg}\n\t\tend tell\n\t\treturn entry\n\ton error msg\n\t\tlog \"Error: \" & msg\n\t\treturn missing value\n\tend try\nend makeEntry\n\n-- Filter and sort incoming messages\non prepareMessages(messages)\n\tset prevDelimiter to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to {ASCII character 10}\n\tset filteredString to do shell script (\"echo \" & quoted form of (messages as string) & \" | sort -f | uniq\")\n\tset AppleScript's text item delimiters to prevDelimiter\n\treturn paragraphs of filteredString\nend prepareMessages\n\non showResults(title, doc, messages)\n\ttell application \"Finder\"\n\t\tset cwd to POSIX path of ((container of (doc as alias) as string))\n\tend tell\n\t\n\tset errorList to {}\n\tset messageList to prepareMessages(messages)\n\t\n\trepeat with msg in messageList\n\t\tif msg does not start with \"#\" then\n\t\t\tset entry to makeEntry(msg, cwd)\n\t\t\tif entry is not missing value then\n\t\t\t\tcopy entry to the end of errorList\n\t\t\tend if\n\t\tend if\n\tend repeat\n\t\n\tif (count of errorList) > 0 then\n\t\ttry\n\t\t\ttell application \"BBEdit\"\n\t\t\t\tmake new results browser with data errorList with properties {name:title}\n\t\t\tend tell\n\t\ton error msg\n\t\t\tlog \"Error: \" & msg\n\t\tend try\n\tend if\nend showResults\n\non handleDocumentDidSave(doc)\n\ttry\n\t\tset docPath to POSIX path of ((file of doc) as string)\n\t\tset pkgPath to packagePath(doc)\n\t\tset goCommands to {\"goimports -w \" & quoted form of docPath, \"golint \" & quoted form of docPath, \"go build\", \"go test\"}\n\t\tset output to execCommands(doc, goCommands)\n\t\tif output is not missing value then\n\t\t\tshowResults(\"Save \" & (name of doc), POSIX file (docPath), output)\n\t\tend if\n\ton error msg\n\t\tlog \"Error handleDocumentDidSave: \" & msg\n\tend try\nend handleDocumentDidSave\n\n(*\non run\n\ttell application \"BBEdit\" to set doc to active document of window 1\n\thandleDocumentDidSave(doc)\nend run\n*)\n","new_contents":"-- Go AppleScript library\n\nproperty package : \"Go\"\nproperty packageRoot : missing value\n\n-- Get working directory for a given document\non getWorkingDirectory(doc)\n\ttell application \"Finder\"\n\t\treturn POSIX path of ((container of ((file of doc) as alias) as string))\n\tend tell\nend getWorkingDirectory\n\n-- Find Go.bbpackage root\n-- Assumption: this is *always* run from within the package!\non getPackageRoot()\n\ttell application \"Finder\"\n\t\tset cwd to ((container of (path to me)) as alias)\n\t\trepeat until name of cwd is \"Go.bbpackage\"\n\t\t\tset cwd to (container of cwd as alias)\n\t\tend repeat\n\tend tell\n\treturn POSIX path of (cwd as string)\nend getPackageRoot\n\non exec(doc, cmd)\n\ttell application \"BBEdit\"\n\t\tif source language of doc is not \"Go\" then\n\t\t\terror \"Not a Go source file\"\n\t\tend if\n\tend tell\n\t\n\tif packageRoot is missing value then\n\t\tset packageRoot to getPackageRoot()\n\tend if\n\t\n\tset runner to quoted form of (POSIX path of (packageRoot as string) & \"Contents\/Resources\/gorunner\")\n\tset shellCmd to runner & space & \"-d \" & POSIX path of ((file of doc) as alias) & space & cmd\n\treturn do shell script (shellCmd)\nend exec\n\non execCommands(doc, commands)\n\tset output to {}\n\trepeat with cmd in commands\n\t\tset entry to exec(doc, cmd)\n\t\tif length of entry > 0 then\n\t\t\tcopy entry to the end of output\n\t\tend if\n\tend repeat\n\treturn output\nend execCommands\n\non packagePath(doc)\n\treturn quoted form of exec(doc, \"go list\")\nend packagePath\n\n-- Parse message into result browser entry\n--\n-- Format:\n--     [\/path\/to\/file]:[line]:(col): [message]\non makeEntry(itemData, cwd)\n\ttry\n\t\t-- Get source path\n\t\tset src to text 1 thru ((offset of \":\" in itemData) - 1) of itemData\n\t\tif src starts with \".\/\" then\n\t\t\tset srcFile to POSIX file (cwd & text 3 thru -1 of src)\n\t\telse\n\t\t\tset srcFile to POSIX file (src)\n\t\tend if\n\t\t\n\t\t-- Get line:column\n\t\tset lineColumn to text ((offset of \":\" in itemData) + 1) thru ((offset of \": \" in itemData) - 1) of itemData\n\t\tset lineNumber to (text 1 thru ((offset of \":\" in lineColumn) - 1) of lineColumn) as number\n\t\tset columnNumber to (text ((offset of \":\" in lineColumn) + 1) thru -1 of lineColumn) as number\n\t\t\n\t\t-- Get message\n\t\tset msg to text ((offset of \": \" in itemData) + 2) thru -1 of itemData\n\t\t\n\t\ttell application \"BBEdit\"\n\t\t\tset resultKind to error_kind\n\t\t\t--\tif resultType is \"note\" then\n\t\t\t--\t\tset resultKind to note_kind\n\t\t\t--\telse if resultType is \"warning\" then\n\t\t\t--\t\tset resultKind to warning_kind\n\t\t\t--\telse\n\t\t\t--\t\tset resultKind to error_kind\n\t\t\t--\tend if\n\t\t\t\n\t\t\tset entry to {result_kind:resultKind, result_file:srcFile, result_line:lineNumber, message:msg}\n\t\tend tell\n\t\treturn entry\n\ton error msg\n\t\tlog \"Error: \" & msg\n\t\treturn missing value\n\tend try\nend makeEntry\n\n-- Filter and sort incoming messages\non prepareMessages(messages)\n\tset prevDelimiter to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to {ASCII character 10}\n\tset filteredString to do shell script (\"echo \" & quoted form of (messages as string) & \" | sort -f | uniq\")\n\tset AppleScript's text item delimiters to prevDelimiter\n\treturn paragraphs of filteredString\nend prepareMessages\n\non showResults(title, doc, messages)\n\ttell application \"Finder\"\n\t\tset cwd to POSIX path of ((container of (doc as alias) as string))\n\tend tell\n\t\n\tset errorList to {}\n\tset messageList to prepareMessages(messages)\n\t\n\trepeat with msg in messageList\n\t\tif msg does not start with \"#\" then\n\t\t\tset entry to makeEntry(msg, cwd)\n\t\t\tif entry is not missing value then\n\t\t\t\tcopy entry to the end of errorList\n\t\t\tend if\n\t\tend if\n\tend repeat\n\t\n\tif (count of errorList) > 0 then\n\t\ttry\n\t\t\ttell application \"BBEdit\"\n\t\t\t\tmake new results browser with data errorList with properties {name:title}\n\t\t\tend tell\n\t\ton error msg\n\t\t\tlog \"Error: \" & msg\n\t\tend try\n\tend if\nend showResults\n\non handleDocumentDidSave(doc)\n\ttry\n\t\tset docPath to POSIX path of ((file of doc) as string)\n\t\tset pkgPath to packagePath(doc)\n\t\tset goCommands to {\"goimports -w \" & quoted form of docPath, \"golint \" & quoted form of docPath, \"go build\", \"go test\"}\n\t\tset output to execCommands(doc, goCommands)\n\t\tif output is not missing value then\n\t\t\tshowResults(\"Save \" & (name of doc), POSIX file (docPath), output)\n\t\tend if\n\ton error msg\n\t\tlog \"Error handleDocumentDidSave: \" & msg\n\tend try\nend handleDocumentDidSave\n\n(*\non run\n\ttell application \"BBEdit\" to set doc to active document of window 1\n\thandleDocumentDidSave(doc)\nend run\n*)\n","subject":"Change comments to be proper AppleScript style","message":"Change comments to be proper AppleScript style\n","lang":"AppleScript","license":"mit","repos":"ascarter\/Go.bbpackage,grmartin\/Go-bbpackage,ascarter\/Go-bbpackage,ascarter\/Go.bbpackage,grmartin\/Go-bbpackage,grmartin\/Go-bbpackage,ascarter\/Go-bbpackage,ascarter\/Go-bbpackage,ascarter\/Go.bbpackage"}
{"commit":"6e11027e160c9fea709e1266c9f8d5be978e23ba","old_file":"log_page.applescript","new_file":"log_page.applescript","old_contents":"(*\n\tLog Page - Log categorized web page bookmarks to a text file\n\n\tVersion: @@VERSION@@\n\tDate:    2011-02-09\n\tAuthor:  Steve Wheeler\n\n\tGet the title, URL, current date and time, and a user-definable\n\tcategory for the frontmost Safari window and log the info to a text\n\tfile.\n\n\tThis program is free software available under the terms of a\n\tBSD-style (3-clause) open source license detailed below.\n*)\n\n(*\nCopyright (c) 2011 Steve Wheeler\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and\/or other materials provided with the distribution.\n\n* Neither the name of the copyright holder nor the names of\n  contributors may be used to endorse or promote products derived from\n  this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*)\n\n(*\n\tTODO: Change the following local-only config before any public release.\n\tThe log file should be: $GTD_IN\/logs\/urls\/urls.YYYY.txt\n\tOr just: $GTD_IN\/logs\/urls.txt\n*)\n\nproperty script_name : \"Log Page\"\nproperty script_version : \"@@VERSION@@\"\n\n---------- USER CONFIGURATION ----------------------------------------\n-- Default log directory to use if one is not read from config file:\nset log_dir to POSIX path of (path to application support folder from user domain) & \"Jazzhead\/Log Page\/\"\n--set log_dir to POSIX path of (path to desktop folder) & \"Log Page\/\" -- :DEBUG:\n\n-- Log file name:\nset log_name to \"urls.txt\"\n\n-- Default categories\/labels if none are found in (or there is no)\n-- URL file. Modify as desired:\nset default_cats to \"Development\nDevelopment:AppleScript\nDevelopment:AppleScript:Mail\nDesign\nProductivity:GTD\nApple:Mac OS X\nApple:iOS\nCareer\nEducation\nHealth\nHealth:Diet\nHealth:Fitness\nGeneral\"\n---------- END User Configuration ----------------------------------------\n\n\n---------- ADVANCED (EXPERIMENTAL) ---------------------------------------------\n-- For advanced users familiar with the command-line, override the default log\n-- directory path. This probably won't be in a public release.\n--\n-- Grab an exported shell environment variable from a config file to use as the\n-- log directory path. For this example, I have a \"~\/.gtdrc\" config file that I\n-- source from my \"~\/.bash_profile\" file so that it exportss environment\n-- variables relating to my GTD system. That makes those variables available to\n-- any of the shell scripts and tools that I use. For instance, when I'm\n-- editing files in Vim, I can write paths to other files using one of the\n-- environment variables rather than a full or relative path and the 'gf'\n-- command will work for jumping to that file. The config file looks like this:\n--\n--         # ~\/.gtdrc\n--         #\n--         # File locations for GTD documents\n--\n--         export GTD_DIR=$HOME\/Documents\/org  # GTD root directory\n--         export GTD_IN=$GTD_DIR\/content      # source\/input files\n--         export GTD_OUT=$GTD_DIR\/html        # generated HTML output files\n--         export GTD_LIB=$GTD_DIR\/lib         # code library files\n--         export GTD_BIN=$GTD_LIB\/script      # scripts\n--\n-- Remove (or comment out) the \"(*\" and \"*)\" comment markers below to use this\n-- section. Make sure you also configure the two variables for your system.\n--(*\n--------------- USER CONFIGURATION ----------\n-- Path to your config file:\nset cfg_file to POSIX path of (path to home folder) & \".gtdrc\"\n-- The environment variable you're interested in:\nset env_var to \"GTD_IN\"\n--------------- END User Configuration ---------\n\n-- Check for environment variable in config file:\nset s to \"egrep '\\\\<\" & env_var & \"=' \" & quoted form of cfg_file & \n\t\" > \/dev\/null 2>&1; echo $?\"\nset shell_status to (do shell script s) as integer\n-- Source the config file and echo the desired variable:\nif shell_status is 0 then -- (means that grep found a match)\n\tset s to \". \" & quoted form of cfg_file & \" && echo $\" & env_var\n\tset log_dir to (do shell script s) & \"\/logs\/\"\nend if\n---------- END Advanced --------------------------------------------------------\n--*)\n\n--return log_dir -- :DEBUG:\n\n\n--\n-- Get URL and title from front browser window\n--\ntell application \"Safari\"\n\t--activate\n\ttry\n\t\tset this_url to URL of front document\n\t\tset this_title to name of first tab of front window whose visible is true\n\ton error\n\t\treturn false\n\tend try\nend tell\n-- Transliterate non-ASCII characters to ASCII\nset this_title to convert_to_ascii(this_title)\n\n--return this_title -- :DEBUG:\n\n--\n-- Format the record separator between log entries\n--\nset rule_char to \"-\"\nset rule_width to 80\nset field_width to 7\nset field_sep to \" | \"\nset rec_sep to \"\" & multiply_text(rule_char, field_width - 1) & \n\t\"+\" & multiply_text(rule_char, rule_width - field_width)\n\n--\n-- Format date-time string as \"YYYY-MM-DD HH:MM:SS\"\n--\nset {year:y, month:m, day:d, hours:hh, minutes:mm, seconds:ss} to current date\nset m to m as integer -- coerce month string\n-- Pad numbers with leading zeros:\nset tmp_list to {}\nrepeat with this_item in {m, d, hh, mm, ss}\n\tset this_item to text 2 thru -1 of (100 + this_item as text)\n\tset end of tmp_list to this_item\nend repeat\nset {m, d, hh, mm, ss} to tmp_list\n-- Final string:\nset date_time to join_list({y, m, d}, \"-\") & \" \" & join_list({hh, mm, ss}, \":\")\n\n-- Log file name\n--set log_name to \"urls.\" & y & \".txt\"\n\n--\n-- Create log directory if it doesn't already exist. (Go ahead and use a shell\n-- command since it's easy to create intermediate directories all in one step.):\n--\ntry\n\tset s to \"mkdir -pm700 \" & quoted form of log_dir\n\tdo shell script s\non error err_msg number err_num\n\terror \"Can't create log directory: \" & err_msg number err_num\n\treturn \"Fatal Error: Can't create log directory\"\nend try\n\nset log_file_posix to \"\" & log_dir & log_name\nset log_file to POSIX file log_file_posix\n\n\n--\n-- Add header to new or empty log file\n--\nset should_init to false\ntell application \"Finder\"\n\tif (not (exists log_file)) or (_IO's read_file(log_file) is \"\") then\n\t\tset should_init to true\n\tend if\nend tell\n\nset head_sep to multiply_text(\"#\", 80)\nif should_init then\n\tset file_header to head_sep & \"\n# urls.txt - Timestamped and categorized URL archive\n# ==================================================\n# Optionally list some categories\/labels of URLs below that might not yet\n# be used. Any categories\/lables listed here or in the web page records\n# will be presented as a list to select from when saving new URLs.\n\" & head_sep & linefeed & default_cats & linefeed & head_sep & \"\n# END: category\/label list\n\" & head_sep & linefeed\n\ttell _IO to write_file(log_file, file_header)\n\tset cat_txt to default_cats\nelse\n\t-- Read categories from file\n\t(*\n\t\t:TODO: Error handling.\n\t*)\n\tset cat_txt to text 2 thru -2 of (item 3 of split_text(_IO's read_file(log_file), head_sep))\nend if\n\n-- Parse any existing labels from the \"Label\" fields of the URLs file:\nset s to \"egrep '^Label ' \" & quoted form of log_file_posix & \n\t\" | sed 's\/^Label | \/\/' | sort | uniq\"\n--return s\nset used_cats to do shell script s without altering line endings\n-- Sort those along with the manually entered categories\/labels:\nset s to \"echo \\\"\" & cat_txt & linefeed & used_cats & \"\\\" | egrep -v '^$' | sort | uniq\"\nset cat_txt to do shell script s\n-- Coerce the lines into a list:\nset cat_list to paragraphs of cat_txt\n--return cat_list -- :DEBUG:\n\n\n--\n-- Prompt for category\/subcategory of URL\n--\n\n-- Select an existing category\nset msg to \"Please select a category for the URL you want to log. You will have a chance to edit your choice.\"\nset cat_choice to choose from list cat_list with title script_name with prompt msg OK button name \"Select\"\n--if cat_choice is false then return false\nif cat_choice is false then set cat_choice to \"Please enter a category...\"\n\n-- Modify or enter a new category\nset btns to {\"Cancel\", \"TODO: Edit Log File\", \"Append URL to File\"}\nset msg to \"To log the URL for:\" & return & return \n\t& tab & \"\\\"\" & this_title & \"\\\"\" & return & return & \n\t\"please provide a category and any optional subcategories (or edit your selected category) for the URL. Example: \\\"Development:AppleScript:Mail\\\"\"\ndisplay dialog msg default answer cat_choice with title script_name buttons btns default button last item of btns\nset {this_label, btn_pressed} to {text returned of result, button returned of result}\n\n--\n-- Append or edit the log file\n--\nif btn_pressed is last item of btns then\n\tset final_text to join_list({\n\t\t\"Date \" & field_sep & date_time, \n\t\t\"Label\" & field_sep & this_label, \n\t\t\"Title\" & field_sep & this_title, \n\t\t\"URL  \" & field_sep & this_url, \n\t\trec_sep}, linefeed) & linefeed\n\t_IO's append_file(log_file, final_text)\nelse\n\tedit_log()\nend if\n\n\n(************************************************************\n *\tSubroutines\n ************************************************************)\n\n-- ===== Main Functions =====\n\non edit_log()\n\t(*\n\t\tTODO:MAYBE:\n\t\tHave a configuration variable in the main script to specify which text\n\t\teditor to use. Have another variable for configuring whether or not\n\t\tit's a GUI application. Then this function would use 'open' to launch a\n\t\tGUI app or script the Terminal to launch a command-line editor.\n\t\tOptionally use 'do shell script' to launch a compatible GUI app from a\n\t\tcommand line (so that the working directory can be changed to that of\n\t\tthe file first), but I don't know if that will really be necessary\n\t\tsince I have a Vim shortcut for quickly changing the working directory\n\t\tif need be.\n\t*)\n\tset t to script_name\n\tset m to \":TODO: Implement edit_log() function.\"\n\tset b to {\"Cancel\"}\n\tdisplay alert t message m buttons b cancel button 1 as critical\n\treturn false\nend edit_log\n\n-- ===== Utility Functions =====\n\non convert_to_ascii(non_ascii_txt)\n\tset s to \"iconv -f UTF-8 -t US-ASCII\/\/TRANSLIT <<<\" & quoted form of non_ascii_txt\n\tdo shell script s\nend convert_to_ascii\n\non multiply_text(str, n)\n\tif n < 1 or str = \"\" then return \"\"\n\tset lst to {}\n\trepeat n times\n\t\tset end of lst to str\n\tend repeat\n\treturn lst as string\nend multiply_text\n\non split_text(txt, delim)\n\tset old_tids to AppleScript's text item delimiters\n\ttry\n\t\tset AppleScript's text item delimiters to (delim as string)\n\t\tset lst to every text item of (txt as string)\n\t\tset AppleScript's text item delimiters to old_tids\n\t\treturn lst\n\ton error err_msg number err_num\n\t\tset AppleScript's text item delimiters to old_tids\n\t\terror \"Can't split_text(): \" & err_msg number err_num\n\tend try\nend split_text\n\non join_list(lst, delim)\n\tset old_tids to AppleScript's text item delimiters\n\ttry\n\t\tset AppleScript's text item delimiters to (delim as string)\n\t\tset txt to lst as string\n\t\tset AppleScript's text item delimiters to old_tids\n\t\treturn txt\n\ton error err_msg number err_num\n\t\tset AppleScript's text item delimiters to old_tids\n\t\terror \"Can't join_list(): \" & err_msg number err_num\n\tend try\nend join_list\n\n(************************************************************\n *\tScript Objects\n ************************************************************)\n\nscript _IO\n\t\n\t(* == PUBLIC == *)\n\t\n\ton write_file(file_path, this_data)\n\t\t_write_file(file_path, this_data, string, false) -- overwrite existing file\n\tend write_file\n\t\n\ton append_file(file_path, this_data)\n\t\t_write_file(file_path, this_data, string, true) -- append new data to end of existing file\n\tend append_file\n\t\n\ton read_file(file_path)\n\t\t_read_file(file_path, string)\n\tend read_file\n\t\n\t(* == PRIVATE == *)\n\t\n\ton _write_file(file_path, this_data, data_class, should_append_data)\n\t\ttry\n\t\t\tset file_path to file_path as text\n\t\t\tset file_handle to \n\t\t\t\topen for access file file_path with write permission\n\t\t\tif not should_append_data then \n\t\t\t\tset eof of the file_handle to 0\n\t\t\twrite this_data as data_class to file_handle starting at eof\n\t\t\tclose access file_handle\n\t\t\treturn true\n\t\ton error err_msg number err_num\n\t\t\ttry\n\t\t\t\tclose access file file_path\n\t\t\tend try\n\t\t\terror err_msg number err_num\n\t\t\treturn false\n\t\tend try\n\tend _write_file\n\t\n\ton _read_file(file_path, data_class)\n\t\ttry\n\t\t\tset file_path to file_path as text\n\t\t\tif (get eof file file_path) is 0 then\n\t\t\t\tset file_contents to \"\"\n\t\t\telse\n\t\t\t\tset file_contents to read file file_path as data_class\n\t\t\tend if\n\t\t\treturn file_contents\n\t\ton error\n\t\t\treturn 0\n\t\tend try\n\tend _read_file\nend script\n","new_contents":"(*\n\tLog Page - Log categorized web page bookmarks to a text file\n\n\tVersion: @@VERSION@@\n\tDate:    2011-02-09\n\tAuthor:  Steve Wheeler\n\n\tGet the title, URL, current date and time, and a user-definable\n\tcategory for the frontmost Safari window and log the info to a text\n\tfile.\n\n\tThis program is free software available under the terms of a\n\tBSD-style (3-clause) open source license detailed below.\n*)\n\n(*\nCopyright (c) 2011 Steve Wheeler\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and\/or other materials provided with the distribution.\n\n* Neither the name of the copyright holder nor the names of\n  contributors may be used to endorse or promote products derived from\n  this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*)\n\n(*\n\tTODO: Change the following local-only config before any public release.\n\tThe log file should be: $GTD_IN\/logs\/urls\/urls.YYYY.txt\n\tOr just: $GTD_IN\/logs\/urls.txt\n\n\tTODO: The edit_log() function is currently incomplete. It will only launch\n\tan editor from the shell and only if that editor is a GUI editor (in this\n\tcase, MacVim). If I release this script publicly, I will still need to\n\timplement funtionality to launch a GUI editor normally (with the 'open'\n\tAppleScript commmand) as well as a command-line editor run in the Terminal.\n*)\n\nproperty script_name : \"Log Page\"\nproperty script_version : \"@@VERSION@@\"\n\n---------- USER CONFIGURATION ----------------------------------------\n-- Default log directory to use if one is not read from config file:\n--set log_dir to POSIX path of (path to application support folder from user domain) & \"Jazzhead\/Log Page\/\"\nset log_dir to POSIX path of (path to desktop folder) & \"Log Page\/\" -- :DEBUG:\n\n-- Log file name:\nset log_name to \"urls.txt\"\n\n-- Default categories\/labels if none are found in (or there is no)\n-- URL file. Modify as desired:\nset default_cats to \"Development\nDevelopment:AppleScript\nDevelopment:AppleScript:Mail\nDesign\nProductivity:GTD\nApple:Mac OS X\nApple:iOS\nCareer\nEducation\nHealth\nHealth:Diet\nHealth:Fitness\nGeneral\"\n\n-- Text editor to use if manually editing the log file.\n--\n-- This example:\n--\t1. Opens the file using MacVim ('mvim' as installed by MacPorts)\n--\t2. Switches the local working directory for just that buffer to the\n--\t    directory containing the file ('lcd')\n--\t3. Gives the MacVim window a name ('--servername').\n--\nset text_editor to \"\/opt\/local\/bin\/mvim \\\"+lcd %:p:h\\\" --servername LOG_PAGE\"\n\n-- Should the specified editor be launched from the unix shell?\nset should_use_shell to true\n---------- END User Configuration ----------------------------------------\n\n\n---------- ADVANCED (EXPERIMENTAL) ---------------------------------------------\n-- For advanced users familiar with the command-line, override the default log\n-- directory path. This probably won't be in a public release.\n--\n-- Grab an exported shell environment variable from a config file to use as the\n-- log directory path. For this example, I have a \"~\/.gtdrc\" config file that I\n-- source from my \"~\/.bash_profile\" file so that it exportss environment\n-- variables relating to my GTD system. That makes those variables available to\n-- any of the shell scripts and tools that I use. For instance, when I'm\n-- editing files in Vim, I can write paths to other files using one of the\n-- environment variables rather than a full or relative path and the 'gf'\n-- command will work for jumping to that file. The config file looks like this:\n--\n--         # ~\/.gtdrc\n--         #\n--         # File locations for GTD documents\n--\n--         export GTD_DIR=$HOME\/Documents\/org  # GTD root directory\n--         export GTD_IN=$GTD_DIR\/content      # source\/input files\n--         export GTD_OUT=$GTD_DIR\/html        # generated HTML output files\n--         export GTD_LIB=$GTD_DIR\/lib         # code library files\n--         export GTD_BIN=$GTD_LIB\/script      # scripts\n--\n-- Remove (or comment out) the \"(*\" and \"*)\" comment markers below to use this\n-- section. Make sure you also configure the two variables for your system.\n--(*\n--------------- USER CONFIGURATION ----------\n-- Path to your config file:\nset cfg_file to POSIX path of (path to home folder) & \".gtdrc\"\n-- The environment variable you're interested in:\nset env_var to \"GTD_IN\"\n--------------- END User Configuration ---------\n\n-- Check for environment variable in config file:\nset s to \"egrep '\\\\<\" & env_var & \"=' \" & quoted form of cfg_file & \n\t\" > \/dev\/null 2>&1; echo $?\"\nset shell_status to (do shell script s) as integer\n-- Source the config file and echo the desired variable:\nif shell_status is 0 then -- (means that grep found a match)\n\tset s to \". \" & quoted form of cfg_file & \" && echo $\" & env_var\n\tset gtd_in_dir to do shell script s\n\tset log_dir to gtd_in_dir & \"\/logs\/\"\n\t\n\t--------------------\n\t-- OPTIONAL: Override the Text editor to integrate with my GTD system.\n\t--\n\t-- This example:\n\t--\t1. Opens the file using MacVim ('mvim' as installed by MacPorts)\n\t--\t2. Switches the local working directory ('lcd') for just that buffer to\n\t--\t    my GTD content directory ($GTD_IN after escaping potential spaces)\n\t--\t3. Gives the MacVim window a name ('--servername').\n\t\n\t----- First, escape any potential spaces in the directory path:\n\t--\n\t--set gtd_in_dir to gtd_in_dir & \" foo    bar\" -- :DEBUG: spaces in path\n\t--\n\tset s to \"echo \" & quoted form of gtd_in_dir & \" | sed 's\/ \\\\{1,\\\\}\/\\\\\\\\ \/g'\" -- escape spaces\n\tset gtd_in_dir to do shell script s\n\t--\n\t--log gtd_in_dir -- :DEBUG: need to use 'log' to see the value w\/o AppleScript escapes\n\t\n\t----- Finally, set the editor with all of the options:\n\t--\n\tset text_editor to \"\/opt\/local\/bin\/mvim \\\"+lcd \" & gtd_in_dir & \"\\\" --servername GTD --remote-silent\"\n\t--\n\t--log text_editor -- :DEBUG:\n\t--return text_editor -- :DEBUG:\n\t--------------------\nend if\n---------- END Advanced --------------------------------------------------------\n--*)\n\n--return log_dir -- :DEBUG:\n\n\n--\n-- Get URL and title from front browser window\n--\ntell application \"Safari\"\n\t--activate\n\ttry\n\t\tset this_url to URL of front document\n\t\tset this_title to name of first tab of front window whose visible is true\n\ton error\n\t\treturn false\n\tend try\nend tell\n-- Transliterate non-ASCII characters to ASCII\nset this_title to convert_to_ascii(this_title)\n\n--return this_title -- :DEBUG:\n\n--\n-- Format the record separator between log entries\n--\nset rule_char to \"-\"\nset rule_width to 80\nset field_width to 7\nset field_sep to \" | \"\nset rec_sep to \"\" & multiply_text(rule_char, field_width - 1) & \n\t\"+\" & multiply_text(rule_char, rule_width - field_width)\n\n--\n-- Format date-time string as \"YYYY-MM-DD HH:MM:SS\"\n--\nset {year:y, month:m, day:d, hours:hh, minutes:mm, seconds:ss} to current date\nset m to m as integer -- coerce month string\n-- Pad numbers with leading zeros:\nset tmp_list to {}\nrepeat with this_item in {m, d, hh, mm, ss}\n\tset this_item to text 2 thru -1 of (100 + this_item as text)\n\tset end of tmp_list to this_item\nend repeat\nset {m, d, hh, mm, ss} to tmp_list\n-- Final string:\nset date_time to join_list({y, m, d}, \"-\") & \" \" & join_list({hh, mm, ss}, \":\")\n\n-- Log file name\n--set log_name to \"urls.\" & y & \".txt\"\n\n--\n-- Create log directory if it doesn't already exist. (Go ahead and use a shell\n-- command since it's easy to create intermediate directories all in one step.):\n--\ntry\n\tset s to \"mkdir -pm700 \" & quoted form of log_dir\n\tdo shell script s\non error err_msg number err_num\n\terror \"Can't create log directory: \" & err_msg number err_num\n\treturn \"Fatal Error: Can't create log directory\"\nend try\n\nset log_file_posix to \"\" & log_dir & log_name\nset log_file to POSIX file log_file_posix\n\n\n--\n-- Add header to new or empty log file\n--\nset should_init to false\ntell application \"Finder\"\n\tif (not (exists log_file)) or (_IO's read_file(log_file) is \"\") then\n\t\tset should_init to true\n\tend if\nend tell\n\nset head_sep to multiply_text(\"#\", 80)\nif should_init then\n\tset file_header to head_sep & \"\n# urls.txt - Timestamped and categorized URL archive\n# ==================================================\n# Optionally list some categories\/labels of URLs below that might not yet\n# be used. Any categories\/lables listed here or in the web page records\n# will be presented as a list to select from when saving new URLs.\n\" & head_sep & linefeed & default_cats & linefeed & head_sep & \"\n# END: category\/label list\n\" & head_sep & linefeed\n\ttell _IO to write_file(log_file, file_header)\n\tset cat_txt to default_cats\nelse\n\t-- Read categories from file\n\t(*\n\t\t:TODO: Error handling.\n\t*)\n\tset cat_txt to text 2 thru -2 of (item 3 of split_text(_IO's read_file(log_file), head_sep))\nend if\n\n-- Parse any existing labels from the \"Label\" fields of the URLs file:\nset s to \"egrep '^Label ' \" & quoted form of log_file_posix & \n\t\" | sed 's\/^Label | \/\/' | sort | uniq\"\n--return s\nset used_cats to do shell script s without altering line endings\n-- Sort those along with the manually entered categories\/labels:\nset s to \"echo \\\"\" & cat_txt & linefeed & used_cats & \"\\\" | egrep -v '^$' | sort | uniq\"\nset cat_txt to do shell script s\n-- Coerce the lines into a list:\nset cat_list to paragraphs of cat_txt\n--return cat_list -- :DEBUG:\n\n\n--\n-- Prompt for category\/subcategory of URL\n--\n\n-- Select an existing category\nset msg to \"Please select a category for the URL you want to log. You will have a chance to edit your choice.\"\nset cat_choice to choose from list cat_list with title script_name with prompt msg OK button name \"Select\"\n--if cat_choice is false then return false\nif cat_choice is false then set cat_choice to \"Please enter a category...\"\n\n-- Modify or enter a new category\nset btns to {\"Cancel\", \"Manually Edit Log File\", \"Append URL to Log File\"}\nset msg to \"To log the URL for:\" & return & return \n\t& tab & \"\\\"\" & this_title & \"\\\"\" & return & return & \n\t\"please provide a category and any optional subcategories (or edit your selected category) for the URL. Example: \\\"Development:AppleScript:Mail\\\"\"\ndisplay dialog msg default answer cat_choice with title script_name buttons btns default button last item of btns\nset {this_label, btn_pressed} to {text returned of result, button returned of result}\n\n--\n-- Append or edit the log file\n--\nif btn_pressed is last item of btns then\n\tset final_text to join_list({\n\t\t\"Date \" & field_sep & date_time, \n\t\t\"Label\" & field_sep & this_label, \n\t\t\"Title\" & field_sep & this_title, \n\t\t\"URL  \" & field_sep & this_url, \n\t\trec_sep}, linefeed) & linefeed\n\t_IO's append_file(log_file, final_text)\nelse\n\tif should_use_shell then\n\t\tset this_log_file to quoted form of log_file_posix\n\telse\n\t\tset this_log_file to log_file\n\tend if\n\tedit_log(this_log_file, text_editor, should_use_shell)\nend if\n\n--display alert \"Log Page\" message \"DEBUG: Script complete.\"\n\n\n(************************************************************\n *\tSubroutines\n ************************************************************)\n\n-- ===== Main Functions =====\n\non edit_log(log_file, text_editor, should_use_shell)\n\t(*\n\t\tTODO:MAYBE:\n\t\tHave a configuration variable in the main script to specify which text\n\t\teditor to use. Have another variable for configuring whether or not\n\t\tit's a GUI application. Then this function would use 'open' to launch a\n\t\tGUI app or script the Terminal to launch a command-line editor.\n\t\tOptionally use 'do shell script' to launch a compatible GUI app from a\n\t\tcommand line (so that the working directory can be changed to that of\n\t\tthe file first), but I don't know if that will really be necessary\n\t\tsince I have a Vim shortcut for quickly changing the working directory\n\t\tif need be.\n\t*)\n\tif should_use_shell then\n\t\tset s to text_editor & space & log_file & space & \"> \/dev\/null 2>&1\"\n\t\tdo shell script s\n\t\treturn\n\telse\n\t\tset t to script_name\n\t\tset m to \":TODO: edit_log() function: use non-shell-invoked editor.\"\n\t\tset b to {\"Cancel\"}\n\t\tdisplay alert t message m buttons b cancel button 1 as critical\n\t\treturn false\n\tend if\nend edit_log\n\n-- ===== Utility Functions =====\n\non convert_to_ascii(non_ascii_txt)\n\tset s to \"iconv -f UTF-8 -t US-ASCII\/\/TRANSLIT <<<\" & quoted form of non_ascii_txt\n\tdo shell script s\nend convert_to_ascii\n\non multiply_text(str, n)\n\tif n < 1 or str = \"\" then return \"\"\n\tset lst to {}\n\trepeat n times\n\t\tset end of lst to str\n\tend repeat\n\treturn lst as string\nend multiply_text\n\non split_text(txt, delim)\n\tset old_tids to AppleScript's text item delimiters\n\ttry\n\t\tset AppleScript's text item delimiters to (delim as string)\n\t\tset lst to every text item of (txt as string)\n\t\tset AppleScript's text item delimiters to old_tids\n\t\treturn lst\n\ton error err_msg number err_num\n\t\tset AppleScript's text item delimiters to old_tids\n\t\terror \"Can't split_text(): \" & err_msg number err_num\n\tend try\nend split_text\n\non join_list(lst, delim)\n\tset old_tids to AppleScript's text item delimiters\n\ttry\n\t\tset AppleScript's text item delimiters to (delim as string)\n\t\tset txt to lst as string\n\t\tset AppleScript's text item delimiters to old_tids\n\t\treturn txt\n\ton error err_msg number err_num\n\t\tset AppleScript's text item delimiters to old_tids\n\t\terror \"Can't join_list(): \" & err_msg number err_num\n\tend try\nend join_list\n\n(************************************************************\n *\tScript Objects\n ************************************************************)\n\nscript _IO\n\t\n\t(* == PUBLIC == *)\n\t\n\ton write_file(file_path, this_data)\n\t\t_write_file(file_path, this_data, string, false) -- overwrite existing file\n\tend write_file\n\t\n\ton append_file(file_path, this_data)\n\t\t_write_file(file_path, this_data, string, true) -- append new data to end of existing file\n\tend append_file\n\t\n\ton read_file(file_path)\n\t\t_read_file(file_path, string)\n\tend read_file\n\t\n\t(* == PRIVATE == *)\n\t\n\ton _write_file(file_path, this_data, data_class, should_append_data)\n\t\ttry\n\t\t\tset file_path to file_path as text\n\t\t\tset file_handle to \n\t\t\t\topen for access file file_path with write permission\n\t\t\tif not should_append_data then \n\t\t\t\tset eof of the file_handle to 0\n\t\t\twrite this_data as data_class to file_handle starting at eof\n\t\t\tclose access file_handle\n\t\t\treturn true\n\t\ton error err_msg number err_num\n\t\t\ttry\n\t\t\t\tclose access file file_path\n\t\t\tend try\n\t\t\terror err_msg number err_num\n\t\t\treturn false\n\t\tend try\n\tend _write_file\n\t\n\ton _read_file(file_path, data_class)\n\t\ttry\n\t\t\tset file_path to file_path as text\n\t\t\tif (get eof file file_path) is 0 then\n\t\t\t\tset file_contents to \"\"\n\t\t\telse\n\t\t\t\tset file_contents to read file file_path as data_class\n\t\t\tend if\n\t\t\treturn file_contents\n\t\ton error\n\t\t\treturn 0\n\t\tend try\n\tend _read_file\nend script\n","subject":"Add \"Edit Log\" action","message":"Add \"Edit Log\" action\n","lang":"AppleScript","license":"bsd-3-clause","repos":"jazzhead\/log-page,jazzhead\/log-page"}
{"commit":"c2d816b43172bd2b342d8e3e54fe494dc5ad0197","old_file":"etc\/pdf.scpt","new_file":"etc\/pdf.scpt","old_contents":"############################\n# How to generate the PDFs #\n############################\n# 1. Generate Cover.pdf with latest version date\n#    a. Create \"ebook\" folder in ~\/Downloads\n#    b. update date in cover.html\n#    c. open in safari file:\/\/\/Users\/frank\/Sites\/ServerlessStackCom\/etc\/cover.html\n#    d. \"Export to PDF\u2026\"\n#    e. Place Cover.pdf in ~\/ebook folder\n# 2. Ensure \"ebook\" folder is an option when \"Export to PDF\u2026\" in Safari\n# 3. In terminal, run \"osascript pdf.scpt\"\n\n\nset theChaptersStr to \"who-is-this-guide-for\nwhat-does-this-guide-cover\nhow-to-get-help\nwhat-is-serverless\nwhat-is-aws-lambda\nwhy-create-serverless-apps\ncreate-an-aws-account\ncreate-an-iam-user\nwhat-is-iam\nwhat-is-an-arn\nconfigure-the-aws-cli\ncreate-a-dynamodb-table\ncreate-an-s3-bucket-for-file-uploads\ncreate-a-cognito-user-pool\ncreate-a-cognito-test-user\nsetup-the-serverless-framework\nadd-support-for-es6-es7-javascript\ninitialize-the-backend-repo\nadd-a-create-note-api\nadd-a-get-note-api\nadd-a-list-all-the-notes-api\nadd-an-update-note-api\nadd-a-delete-note-api\nworking-with-3rd-party-apis\nsetup-a-stripe-account\nadd-a-billing-api\nload-secrets-from-env\ntest-the-billing-api\nunit-tests-in-serverless\nhandle-api-gateway-cors-errors\ndeploy-the-apis\ncreate-a-cognito-identity-pool\ncognito-user-pool-vs-identity-pool\ntest-the-apis\ncreate-a-new-reactjs-app\ninitialize-the-frontend-repo\nadd-app-favicons\nsetup-custom-fonts\nsetup-bootstrap\nhandle-routes-with-react-router\ncreate-containers\nadding-links-in-the-navbar\nhandle-404s\nconfigure-aws-amplify\ncreate-a-login-page\nlogin-with-aws-cognito\nadd-the-session-to-the-state\nload-the-state-from-the-session\nclear-the-session-on-logout\nredirect-on-login-and-logout\ngive-feedback-while-logging-in\ncreate-a-custom-react-hook-to-handle-form-fields\ncreate-a-signup-page\ncreate-the-signup-form\nsignup-with-aws-cognito\nadd-the-create-note-page\ncall-the-create-api\nupload-a-file-to-s3\nlist-all-the-notes\ncall-the-list-api\ndisplay-a-note\nrender-the-note-form\nsave-changes-to-a-note\ndelete-a-note\ncreate-a-settings-page\nadd-stripe-keys-to-config\ncreate-a-billing-form\nconnect-the-billing-form\nsetup-secure-pages\ncreate-a-route-that-redirects\nuse-the-redirect-routes\nredirect-on-login\ngetting-production-ready\nwhat-is-infrastructure-as-code\nconfigure-dynamodb-in-serverless\nconfigure-s3-in-serverless\nconfigure-cognito-user-pool-in-serverless\nconfigure-cognito-identity-pool-in-serverless\ndeploy-your-serverless-infrastructure\nautomating-serverless-deployments\nsetting-up-your-project-on-seed\nconfigure-secrets-in-seed\ndeploying-through-seed\nset-custom-domains-through-seed\ntest-the-configured-apis\nautomating-react-deployments\nmanage-environments-in-create-react-app\ncreate-a-build-script\nsetting-up-your-project-on-netlify\ncustom-domain-in-netlify\nfrontend-workflow\ndebugging-full-stack-serverless-apps\nsetup-error-reporting-in-react\nreport-api-errors-in-react\nsetup-an-error-boundary-in-react\nsetup-error-logging-in-serverless\nlogic-errors-in-lambda-functions\nunexpected-errors-in-lambda-functions\nerrors-outside-lambda-functions\nerrors-in-api-gateway\nwrapping-up\nfurther-reading\ntranslations\ngiving-back\nchangelog\nstaying-up-to-date\nbest-practices-for-building-serverless-apps\norganizing-serverless-projects\ncross-stack-references-in-serverless\ndynamodb-as-a-serverless-service\ns3-as-a-serverless-service\ncognito-as-a-serverless-service\nshare-code-between-services\nshare-an-api-endpoint-between-services\ndeploy-a-serverless-app-with-dependencies\nenvironments-in-serverless-apps\nstructure-environments-across-aws-accounts\nmanage-aws-accounts-using-aws-organizations\nparameterize-serverless-resources-names\ndeploying-to-multiple-aws-accounts\ndeploy-the-resources-repo\ndeploy-the-api-services-repo\nmanage-environment-related-config\nstoring-secrets-in-serverless-apps\nshare-route-53-domains-across-aws-accounts\nmonitor-usage-for-environments\nworking-on-serverless-apps\ninvoke-lambda-functions-locally\ninvoke-api-gateway-endpoints-locally\ncreating-feature-environments\ncreating-pull-request-environments\npromoting-to-production\nrollback-changes\ndeploying-only-updated-services\ntracing-serverless-apps-with-x-ray\nwrapping-up-the-best-practices\napi-gateway-and-lambda-logs\ndebugging-serverless-api-issues\nserverless-environment-variables\nstages-in-serverless-framework\nbackups-in-dynamodb\nconfigure-multiple-aws-profiles\ncustomize-the-serverless-iam-policy\nmapping-cognito-identity-id-and-user-pool-id\nconnect-to-api-gateway-with-iam-auth\nserverless-nodejs-starter\npackage-lambdas-with-serverless-bundle\nunderstanding-react-hooks\ncode-splitting-in-create-react-app\nenvironments-in-create-react-app\ndeploying-a-react-app-to-aws\ncreate-an-s3-bucket\ndeploy-to-s3\ncreate-a-cloudfront-distribution\npurchase-a-domain-with-route-53\nsetup-ssl\nsetup-your-domain-with-cloudfront\nsetup-www-domain-redirect\ndeploy-updates\nmanage-user-accounts-in-aws-amplify\nhandle-forgot-and-reset-password\nallow-users-to-change-passwords\nallow-users-to-change-their-email\nfacebook-login-with-cognito-using-aws-amplify\"\n\nset text item delimiters to \"\n\"\n\nset theChapters to text items of theChaptersStr\n\n\n########\n# Main #\n########\ndownloadPdfs(theChapters)\nmergePdfs(theChapters)\n\n##############\n# Merge PDFs #\n##############\non mergePdfs(theChapters)\n  set outputFile to \"~\/Downloads\/ebook\/ServerlessStack.pdf\"\n\n  set pdfFiles to \"~\/Downloads\/ebook\/Cover.pdf\"\n  repeat with theCurrentChapter in theChapters\n    set pdfFiles to pdfFiles & \" ~\/Downloads\/ebook\/\" & theCurrentChapter & \".pdf\"\n  end repeat\n\n  do shell script \"\/System\/Library\/Automator\/Combine\\\\ PDF\\\\ Pages.action\/Contents\/Resources\/join.py \" & \"-o \" & outputFile & \" \" & pdfFiles\nend mergePdfs\n\n#################\n# Download PDFs #\n#################\non downloadPdfs(theChapters)\n  repeat with theCurrentChapter in theChapters\n    if not(checkFileExist(theCurrentChapter)) then\n      downloadPdf(theCurrentChapter)\n    end if\n  end repeat\nend downloadPdfs\n\non checkFileExist(theChapterName)\n  set basePath to POSIX path of (path to home folder) & \"Downloads\/ebook\/\"\n\n  tell application \"Finder\"\n    return exists basePath & theChapterName & \".pdf\" as POSIX file\n  end tell\nend checkFileExist\n\non downloadPdf(theChapterName)\n  tell application \"System Events\"\n\n    tell process \"Safari\"\n      set frontmost to true\n\n      if ((theChapterName as string) is equal to \"index\") then\n        set urlPath to theChapterName\n      else\n        set urlPath to \"chapters\/\" & theChapterName\n      end if\n      open location \"https:\/\/serverless-stack.com\/\" & urlPath & \".html\"\n\n      delay 1\n\n      repeat until menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 exists\n        delay 0.2\n      end repeat\n      repeat\n        if ((value of menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 is enabled) = true)\n          exit repeat\n        end if\n        delay 0.2\n      end repeat\n      click menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1\n\n      tell window 1\n        repeat until sheet 1 exists\n        end repeat\n\n        tell sheet 1\n          keystroke theChapterName\n          click pop up button \"Where:\"\n\n          repeat until menu 1 of pop up button \"Where:\" exists\n          end repeat\n          click menu item \"ebook\" of menu 1 of pop up button \"Where:\"\n          click button \"Save\"\n        end tell\n\n      end tell\n\n      delay 2\n\n      click menu item \"Close Tab\" of menu \"File\" of menu bar 1\n\n    end tell\n\n  end tell\nend downloadPdf\n","new_contents":"############################\n# How to generate the PDFs #\n############################\n# 1. Generate Cover.pdf with latest version date\n#    a. Create \"ebook\" folder in ~\/Downloads\n#    b. update date in cover.html\n#    c. open in safari file:\/\/\/Users\/frank\/Sites\/ServerlessStackCom\/etc\/cover.html\n#    d. \"Export to PDF\u2026\"\n#    e. Place Cover.pdf in ~\/ebook folder\n# 2. Ensure \"ebook\" folder is an option when \"Export to PDF\u2026\" in Safari\n# 3. In terminal, run \"osascript pdf.scpt\"\n\n\nset theChaptersStr to \"who-is-this-guide-for\nwhat-does-this-guide-cover\nhow-to-get-help\nwhat-is-serverless\nwhat-is-aws-lambda\nwhy-create-serverless-apps\ncreate-an-aws-account\ncreate-an-iam-user\nwhat-is-iam\nwhat-is-an-arn\nconfigure-the-aws-cli\ncreate-a-dynamodb-table\ncreate-an-s3-bucket-for-file-uploads\ncreate-a-cognito-user-pool\ncreate-a-cognito-test-user\nsetup-the-serverless-framework\nadd-support-for-es6-and-typescript\ninitialize-the-backend-repo\nadd-a-create-note-api\nadd-a-get-note-api\nadd-a-list-all-the-notes-api\nadd-an-update-note-api\nadd-a-delete-note-api\nworking-with-3rd-party-apis\nsetup-a-stripe-account\nadd-a-billing-api\nload-secrets-from-env\ntest-the-billing-api\nunit-tests-in-serverless\nhandle-api-gateway-cors-errors\ndeploy-the-apis\ncreate-a-cognito-identity-pool\ncognito-user-pool-vs-identity-pool\ntest-the-apis\ncreate-a-new-reactjs-app\ninitialize-the-frontend-repo\nadd-app-favicons\nsetup-custom-fonts\nsetup-bootstrap\nhandle-routes-with-react-router\ncreate-containers\nadding-links-in-the-navbar\nhandle-404s\nconfigure-aws-amplify\ncreate-a-login-page\nlogin-with-aws-cognito\nadd-the-session-to-the-state\nload-the-state-from-the-session\nclear-the-session-on-logout\nredirect-on-login-and-logout\ngive-feedback-while-logging-in\ncreate-a-custom-react-hook-to-handle-form-fields\ncreate-a-signup-page\ncreate-the-signup-form\nsignup-with-aws-cognito\nadd-the-create-note-page\ncall-the-create-api\nupload-a-file-to-s3\nlist-all-the-notes\ncall-the-list-api\ndisplay-a-note\nrender-the-note-form\nsave-changes-to-a-note\ndelete-a-note\ncreate-a-settings-page\nadd-stripe-keys-to-config\ncreate-a-billing-form\nconnect-the-billing-form\nsetup-secure-pages\ncreate-a-route-that-redirects\nuse-the-redirect-routes\nredirect-on-login\ngetting-production-ready\nwhat-is-infrastructure-as-code\nwhat-is-aws-cdk\nusing-aws-cdk-with-serverless-framework\nbuilding-a-cdk-app-with-sst\nconfigure-dynamodb-in-cdk\nconfigure-s3-in-cdk\nconfigure-cognito-user-pool-in-cdk\nconfigure-cognito-identity-pool-in-cdk\nconnect-serverless-framework-and-cdk-with-sst\ndeploy-your-serverless-infrastructure\nautomating-serverless-deployments\nsetting-up-your-project-on-seed\nconfigure-secrets-in-seed\ndeploying-through-seed\nset-custom-domains-through-seed\ntest-the-configured-apis\nautomating-react-deployments\nmanage-environments-in-create-react-app\ncreate-a-build-script\nsetting-up-your-project-on-netlify\ncustom-domain-in-netlify\nfrontend-workflow\ndebugging-full-stack-serverless-apps\nsetup-error-reporting-in-react\nreport-api-errors-in-react\nsetup-an-error-boundary-in-react\nsetup-error-logging-in-serverless\nlogic-errors-in-lambda-functions\nunexpected-errors-in-lambda-functions\nerrors-outside-lambda-functions\nerrors-in-api-gateway\nwrapping-up\nfurther-reading\ntranslations\ngiving-back\nchangelog\nstaying-up-to-date\nbest-practices-for-building-serverless-apps\norganizing-serverless-projects\ncross-stack-references-in-serverless\nshare-code-between-services\nshare-an-api-endpoint-between-services\ndeploy-a-serverless-app-with-dependencies\nenvironments-in-serverless-apps\nstructure-environments-across-aws-accounts\nmanage-aws-accounts-using-aws-organizations\nparameterize-serverless-resources-names\ndeploying-to-multiple-aws-accounts\ndeploy-the-resources-repo\ndeploy-the-api-services-repo\nmanage-environment-related-config\nstoring-secrets-in-serverless-apps\nshare-route-53-domains-across-aws-accounts\nmonitor-usage-for-environments\nworking-on-serverless-apps\ninvoke-lambda-functions-locally\ninvoke-api-gateway-endpoints-locally\ncreating-feature-environments\ncreating-pull-request-environments\npromoting-to-production\nrollback-changes\ndeploying-only-updated-services\ntracing-serverless-apps-with-x-ray\nwrapping-up-the-best-practices\"\n\nset text item delimiters to \"\n\"\n\nset theChapters to text items of theChaptersStr\n\n\n########\n# Main #\n########\ndownloadPdfs(theChapters)\nmergePdfs(theChapters)\n\n##############\n# Merge PDFs #\n##############\non mergePdfs(theChapters)\n  set outputFile to \"~\/Downloads\/ebook\/ServerlessStack.pdf\"\n\n  set pdfFiles to \"~\/Downloads\/ebook\/Cover.pdf\"\n  repeat with theCurrentChapter in theChapters\n    set pdfFiles to pdfFiles & \" ~\/Downloads\/ebook\/\" & theCurrentChapter & \".pdf\"\n  end repeat\n\n  do shell script \"\/System\/Library\/Automator\/Combine\\\\ PDF\\\\ Pages.action\/Contents\/Resources\/join.py \" & \"-o \" & outputFile & \" \" & pdfFiles\nend mergePdfs\n\n#################\n# Download PDFs #\n#################\non downloadPdfs(theChapters)\n  repeat with theCurrentChapter in theChapters\n    if not(checkFileExist(theCurrentChapter)) then\n      downloadPdf(theCurrentChapter)\n    end if\n  end repeat\nend downloadPdfs\n\non checkFileExist(theChapterName)\n  set basePath to POSIX path of (path to home folder) & \"Downloads\/ebook\/\"\n\n  tell application \"Finder\"\n    return exists basePath & theChapterName & \".pdf\" as POSIX file\n  end tell\nend checkFileExist\n\non downloadPdf(theChapterName)\n  tell application \"System Events\"\n\n    tell process \"Safari\"\n      set frontmost to true\n\n      if ((theChapterName as string) is equal to \"index\") then\n        set urlPath to theChapterName\n      else\n        set urlPath to \"chapters\/\" & theChapterName\n      end if\n      open location \"https:\/\/serverless-stack.com\/\" & urlPath & \".html\"\n\n      delay 1\n\n      repeat until menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 exists\n        delay 0.2\n      end repeat\n      repeat\n        if ((value of menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 is enabled) = true)\n          exit repeat\n        end if\n        delay 0.2\n      end repeat\n      click menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1\n\n      tell window 1\n        repeat until sheet 1 exists\n        end repeat\n\n        tell sheet 1\n          keystroke theChapterName\n          click pop up button \"Where:\"\n\n          repeat until menu 1 of pop up button \"Where:\" exists\n          end repeat\n          click menu item \"ebook\" of menu 1 of pop up button \"Where:\"\n          click button \"Save\"\n        end tell\n\n      end tell\n\n      delay 2\n\n      click menu item \"Close Tab\" of menu \"File\" of menu bar 1\n\n    end tell\n\n  end tell\nend downloadPdf\n","subject":"Update chapter list in pdf generation script","message":"Update chapter list in pdf generation script\n","lang":"AppleScript","license":"mit","repos":"AnomalyInnovations\/serverless-stack-com,AnomalyInnovations\/serverless-stack-com"}
{"commit":"b3abb2b37c912ac262165f5c162976b76113b4e0","old_file":"hammerspoon\/connect_sony.applescript","new_file":"hammerspoon\/connect_sony.applescript","old_contents":"activate application \"SystemUIServer\"\ntell application \"System Events\"\n    tell process \"SystemUIServer\"\n        set btMenu to (menu bar item 1 of menu bar 1 whose description contains \"bluetooth\")\n        tell btMenu\n            click\n            try\n                tell (menu item \"WH-1000XM3\" of menu 1)\n                    click\n                    if exists menu item \"Connect\" of menu 1 then\n                        click menu item \"Connect\" of menu 1\n                        return \"Connecting...\"\n                    else if exists menu item \"Disconnect\" of menu 1 then\n                        click menu item \"Disconnect\" of menu 1\n                        return \"Disconnecting...\"\n                    end if\n                end tell\n            end try\n        end tell\n    end tell\n    key code 53\n    return \"Device not found or Bluetooth turned off\"\nend tell\n\n\n","new_contents":"activate application \"SystemUIServer\"\ntell application \"System Events\"\n    tell process \"SystemUIServer\"\n        set btMenu to (menu bar item 1 of menu bar 1 whose description contains \"bluetooth\")\n        tell btMenu\n            click\n            try\n                tell (menu item \"Rosco's Headphones\" of menu 1)\n                    click\n                    if exists menu item \"Connect\" of menu 1 then\n                        click menu item \"Connect\" of menu 1\n                        return \"Connecting...\"\n                    else if exists menu item \"Disconnect\" of menu 1 then\n                        click menu item \"Disconnect\" of menu 1\n                        return \"Disconnecting...\"\n                    end if\n                end tell\n            end try\n        end tell\n    end tell\n    key code 53\n    return \"Device not found or Bluetooth turned off\"\nend tell\n\n\n","subject":"Rename headphones","message":"Rename headphones\n","lang":"AppleScript","license":"mit","repos":"rkalis\/dotfiles,rkalis\/dotfiles"}
{"commit":"7d08a4e2c7766a1d0f04c4020128e3edb1c47ca7","old_file":"contrib\/mac\/watch-workers.applescript","new_file":"contrib\/mac\/watch-workers.applescript","old_contents":"set broker to \"h8.opera.com\"\nset workers to {\"h6.opera.com\", \"h8.opera.com\", \"h9.opera.com\", \"h10.opera.com\"}\ntell application \"iTerm\"\n    activate\n    set myterm to (make new terminal)\n    tell myterm\n        set number of columns to 80\n        set number of rows to 50\n        repeat with workerhost in workers\n            set worker to (make new session at the end of sessions)\n            tell worker\n                set name to workerhost\n                set foreground color to \"white\"\n                set background color to \"black\"\n                set transparency to 0.1\n                exec command \"\/bin\/sh -i\"\n                write text \"ssh root@\" & workerhost & \" 'tail -f \/var\/log\/celeryd.log'\"\n            end tell\n        end repeat\n        set rabbit to (make new session at the end of sessions)\n        tell rabbit\n            set name to \"rabbit.log\"\n            set foreground color to \"white\"\n            set background color to \"black\"\n            set transparency to 0.1\n            exec command \"\/bin\/sh -i\"\n            write text \"ssh root@\" & broker & \" 'tail -f \/var\/log\/rabbitmq\/rabbit.log'\"\n        end tell\n        tell the first session\n            activate\n        end tell\n    end tell\nend tell\n","new_contents":"set broker to \"h8.opera.com\"\nset workers to {\"h6.opera.com\", \"h8.opera.com\", \"h9.opera.com\", \"h10.opera.com\"}\nset clock to \"h6.opera.com\"\ntell application \"iTerm\"\n    activate\n    set myterm to (make new terminal)\n    tell myterm\n        set number of columns to 80\n        set number of rows to 50\n        repeat with workerhost in workers\n            set worker to (make new session at the end of sessions)\n            tell worker\n                set name to workerhost\n                set foreground color to \"white\"\n                set background color to \"black\"\n                set transparency to 0.1\n                exec command \"\/bin\/sh -i\"\n                write text \"ssh root@\" & workerhost & \" 'tail -f \/var\/log\/celeryd.log'\"\n            end tell\n        end repeat\n        set celerybeat to (make new session at the end of sessions)\n        tell celerybeat\n            set name to \"celerybeat.log\"\n            set foreground color to \"white\"\n            set background color to \"black\"\n            set transparency to 0.1\n            exec command \"\/bin\/sh -i\"\n            write text \"ssh root@\" & clock & \" 'tail -f \/var\/log\/celerybeat.log'\"\n        end tell\n        set rabbit to (make new session at the end of sessions)\n        tell rabbit\n            set name to \"rabbit.log\"\n            set foreground color to \"white\"\n            set background color to \"black\"\n            set transparency to 0.1\n            exec command \"\/bin\/sh -i\"\n            write text \"ssh root@\" & broker & \" 'tail -f \/var\/log\/rabbitmq\/rabbit.log'\"\n        end tell\n        tell the first session\n            activate\n        end tell\n    end tell\nend tell\n","subject":"Update the watch workers applescript to watch the celerybeat log file.","message":"Update the watch workers applescript to watch the celerybeat log file.\n","lang":"AppleScript","license":"bsd-3-clause","repos":"frac\/celery,mitsuhiko\/celery,ask\/celery,frac\/celery,WoLpH\/celery,cbrepo\/celery,mitsuhiko\/celery,WoLpH\/celery,ask\/celery,cbrepo\/celery"}
{"commit":"3dc01c3693fcf24756484ec6c9597e576c470a9a","old_file":"keynote.applescript","new_file":"keynote.applescript","old_contents":"on newPresentation(themeName)\n\ttell application \"Keynote\"\n\t\tactivate\n\t\t-- FIXME: Make this selectable?\n\t\tset targetWidth to 1024 -- 1440 <-- higher resolution\n\t\tset targetHeight to 768 -- 1080 <-- higher resolution\n\n\t\tset props to {document theme:theme (themeName as string), width:targetWidth, height:targetHeight}\n\n\t\tset thisDocument to make new document with properties props\n\t\treturn name of thisDocument\n\tend tell\nend newPresentation\n\non openPresentation(posixPath)\n\ttell application \"Keynote\"\n\t\topen posixPath\n\tend tell\nend openPresentation\n\non savePresentation(docname, posixPath)\n\ttell application \"Keynote\"\n\t\tsave document named docname in POSIX file posixPath\n\tend tell\nend savePresentation\t\n\non createSlide(docname, masterSlideName)\n\ttry\n\t\ttell application \"Keynote\"\n\t\t\ttell document named docname\n\t\t\t\tset thisSlide to make new slide with properties {base slide:master slide masterSlideName}\n\t\t\tend tell\n\t  return thisSlide\n\t\tend tell\n\ton error\n\t\treturn 0\n\tend try\nend createSlide\n\non finalize(docname)\n\ttell application \"Keynote\"\n\t\ttell document named docname to delete slide 1\n\tend tell\nend finalize\n\non themeMasters(docname)\n\t--\t  tell application \"Keynote\" to get the name of every master slide of thisDocument\n\ttell application \"Keynote\"\n\t\tset names to the name of every master slide of document named docname\n\t\treturn names\n\tend tell\nend themeMasters\n\non addImage(docname, filepath)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n  tell application \"Keynote\"\n\ttell document named docname\n\t\ttell the current slide\n\t\t\t\n\t\t\t-- TO REPLACE A PLACEHOLDER OR EXISTING IMAGE:\n\t\t\tset thisPlaceholderImageItem to image 1\n\t\t\t-- change the value of the \u201cfile name\u201d property of the image to be an HFS file reference to the replacement image file\n\t\tset macPath to POSIX file filepath as Unicode text\n\t\t\tset file name of thisPlaceholderImageItem to \u00ac\n\t\t\t\talias macPath\n\t\t\t\n\t\tend tell\n\tend tell\n  end tell\nend addImage\n\n\non addTitle(docname, thisSlideTitle)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n\ttell application \"Keynote\"\n\t\ttell document named docname\n\t\t\ttell the current slide\n\t\t\t\tif title showing is true then\n\t\t\t\t\tset the object text of the default title item to thisSlideTitle\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend tell\n\tend tell\nend addTitle\n\non addBody(docname, thisSlideBody)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n\ttell application \"Keynote\"\n\t\ttell document named docname\n\t\t\ttell the current slide\n\t\t\t\tif body showing is true then\n\t\t\t\t\tset the object text of the default body item to thisSlideBody\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend tell\n\tend tell\nend addTitle\n","new_contents":"on newPresentation(themeName)\n\ttell application \"Keynote\"\n\t\tactivate\n\t\t-- FIXME: Make this selectable?\n\t\tset targetWidth to 1024 -- 1440 <-- higher resolution\n\t\tset targetHeight to 768 -- 1080 <-- higher resolution\n\n\t\tset props to {document theme:theme (themeName as string), width:targetWidth, height:targetHeight}\n\n\t\tset thisDocument to make new document with properties props\n\t\treturn name of thisDocument\n\tend tell\nend newPresentation\n\non openPresentation(posixPath)\n\ttell application \"Keynote\"\n\t\topen posixPath\n\tend tell\nend openPresentation\n\non savePresentation(docname, posixPath)\n\ttell application \"Keynote\"\n\t\tsave document named docname in POSIX file posixPath\n\tend tell\nend savePresentation\t\n\non createSlide(docname, masterSlideName)\n\ttry\n\t\ttell application \"Keynote\"\n\t\t\ttell document named docname\n\t\t\t\tset thisSlide to make new slide with properties {base slide:master slide masterSlideName}\n\t\t\tend tell\n\t  return thisSlide\n\t\tend tell\n\ton error\n\t\treturn 0\n\tend try\nend createSlide\n\non deleteAllSlides(docname)\n\ttell application \"Keynote\"\n\t\ttell document named docname to delete every slide\n\tend tell\nend deleteAllSlides\n\non finalize(docname)\n\ttell application \"Keynote\"\n\t\ttell document named docname to delete slide 1\n\tend tell\nend finalize\n\non themeMasters(docname)\n\t--\t  tell application \"Keynote\" to get the name of every master slide of thisDocument\n\ttell application \"Keynote\"\n\t\tset names to the name of every master slide of document named docname\n\t\treturn names\n\tend tell\nend themeMasters\n\non addImage(docname, filepath)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n  tell application \"Keynote\"\n\ttell document named docname\n\t\ttell the current slide\n\t\t\t\n\t\t\t-- TO REPLACE A PLACEHOLDER OR EXISTING IMAGE:\n\t\t\tset thisPlaceholderImageItem to image 1\n\t\t\t-- change the value of the \u201cfile name\u201d property of the image to be an HFS file reference to the replacement image file\n\t\tset macPath to POSIX file filepath as Unicode text\n\t\t\tset file name of thisPlaceholderImageItem to \u00ac\n\t\t\t\talias macPath\n\t\t\t\n\t\tend tell\n\tend tell\n  end tell\nend addImage\n\n\non addTitle(docname, thisSlideTitle)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n\ttell application \"Keynote\"\n\t\ttell document named docname\n\t\t\ttell the current slide\n\t\t\t\tif title showing is true then\n\t\t\t\t\tset the object text of the default title item to thisSlideTitle\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend tell\n\tend tell\nend addTitle\n\non addBody(docname, thisSlideBody)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n\ttell application \"Keynote\"\n\t\ttell document named docname\n\t\t\ttell the current slide\n\t\t\t\tif body showing is true then\n\t\t\t\t\tset the object text of the default body item to thisSlideBody\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend tell\n\tend tell\nend addTitle\n","subject":"Add deleteAllSlides","message":"Add deleteAllSlides\n","lang":"AppleScript","license":"mit","repos":"persquare\/md2keynote"}
{"commit":"a081db731a3f568812e719200162fc6ed3f87c26","old_file":"files\/extra\/uninstaller.applescript","new_file":"files\/extra\/uninstaller.applescript","old_contents":"try\n    display dialog \"Are you sure you want to remove NoEjectDelay?\" buttons {\"Cancel\", \"OK\"}\n    if the button returned of the result is \"OK\" then\n        try\n            do shell script \"test -f '\/Library\/Application Support\/org.pqrs\/NoEjectDelay\/uninstall.sh'\"\n            try\n                do shell script \"sh '\/Library\/Application Support\/org.pqrs\/NoEjectDelay\/uninstall.sh'\" with administrator privileges\n                display alert \"NoEjectDelay has been uninstalled. Please restart OS X.\"\n            on error\n                display alert \"Failed to uninstall NoEjectDelay.\"\n            end try\n        on error\n            display alert \"NoEjectDelay is not installed.\"\n        end try\n    end if\non error\n    display alert \"NoEjectDelay uninstallation was canceled.\"\nend try\n","new_contents":"try\n    display dialog \"Are you sure you want to remove NoEjectDelay?\" buttons {\"Cancel\", \"OK\"}\n    if the button returned of the result is \"OK\" then\n        try\n            do shell script \"test -f '\/Library\/Application Support\/org.pqrs\/NoEjectDelay\/uninstall.sh'\"\n            try\n                do shell script \"sh '\/Library\/Application Support\/org.pqrs\/NoEjectDelay\/uninstall.sh'\" with administrator privileges\n                display alert \"NoEjectDelay has been uninstalled. Please restart OS X.\"\n                do shell script \"killall 'NoEjectDelay Utility'\"\n            on error\n                display alert \"Failed to uninstall NoEjectDelay.\"\n            end try\n        on error\n            display alert \"NoEjectDelay is not installed.\"\n        end try\n    end if\non error\n    display alert \"NoEjectDelay uninstallation was canceled.\"\nend try\n","subject":"add killall at uninstaller.applescript","message":"add killall at uninstaller.applescript\n","lang":"AppleScript","license":"unlicense","repos":"tekezo\/NoEjectDelay,tekezo\/NoEjectDelay,tekezo\/NoEjectDelay"}
{"commit":"624760deb2429e8880fa4b3ffbee4789c066c2a5","old_file":"Opener\/AppDelegate.applescript","new_file":"Opener\/AppDelegate.applescript","old_contents":"--\n--  AppDelegate.applescript\n--  PerianOpener\n--\n--  Created by C.W. Betts on 9\/25\/13.\n--  Copyright (c) 2013 Perian Team. All rights reserved.\n--\n\nscript AppDelegate\n\tproperty parent : class \"NSObject\"\n\t\n\ton isMavericksOrLater()\n\t\t-- TODO: Implement\n\t\treturn yes\n\tend isMavericksOrLater\n\t\n\ton applicationWillFinishLaunching_(aNotification)\n\t\t-- Insert code here to initialize your application before any files are opened \n\tend applicationWillFinishLaunching_\n\t\n\ton applicationDidFinishLaunching_(aNotification)\n\t\t-- Insert code here to initialize your application before any files are opened\n\t\ttell current application's NSTimer to set theTimer to scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_(10, me, \"timerFired:\", missing value, false)\n\tend applicationDidFinishLaunching_\n\t\n\ton timerFired_(timer)\n\t\tquit\n\tend timerFired_\n\t\n\ton applicationShouldTerminate_(sender)\n\t\t-- Insert code here to do any housekeeping before your application quits \n\t\treturn current application's NSTerminateNow\n\tend applicationShouldTerminate_\n\t\n\ton application_openFiles_(appl, theFiles)\n\t\t\n\t\tset mavericks to isMavericksOrLater()\n\t\tif mavericks is true\n\t\ttell application \"com.apple.quicktimeplayer\"\n\t\t\trepeat with theFile in theFiles's allObjects()\n\t\t\t\tset theFilePox to (theFile's fileSystemRepresentation())\n\t\t\t\topen theFilePox as POSIX file\n\t\t\tend repeat\n\t\t\t\n\t\t\tactivate\n\t\tend tell\n\n\t\telse\n\t\t\n\t\ttell application \"QuickTime Player\"\n\t\t\trepeat with theFile in theFiles's allObjects()\n\t\t\t\tset theFilePox to (theFile's fileSystemRepresentation())\n\t\t\t\topen theFilePox as POSIX file\n\t\t\tend repeat\n\t\t\t\n\t\t\tactivate\n\t\tend tell\n\t\tend\n\t\tquit\n\t\t\n\t\treturn yes\n\tend application_openFiles_\n\t\nend script\n","new_contents":"--\n--  AppDelegate.applescript\n--  PerianOpener\n--\n--  Created by C.W. Betts on 9\/25\/13.\n--  Copyright (c) 2013 Perian Team. All rights reserved.\n--\n\nscript AppDelegate\n\tproperty parent : class \"NSObject\"\n\t\n\ton isMavericksOrLater()\n\t\tset osver to system version of (system info)\n\t\t(* skip the first three characters: We don't run on pre-OS X systems,\n\t\t and we won't reach Mac OS version 100 any time soon. *)\n\t\tset osList to characters 4 thru 6 of osver\n\t\t(* If we get a decimal as the last item, the second version value is greater than 10.\n\t\t We're looking for Mac versions greater than nine. *)\n\t\tif (osList's item 3) is equal to \".\" then\n\t\t\treturn yes\n\t\t\telse\n\t\t\tset preTen to osList's as text as real\n\t\t\tif preTen is greater than or equal to 9.0 then\n\t\t\t\treturn yes\n\t\t\t\telse\n\t\t\t\treturn no\n\t\t\tend if\n\t\tend if\n\tend isMavericksOrLater\n\t\n\ton applicationWillFinishLaunching_(aNotification)\n\t\t-- Insert code here to initialize your application before any files are opened \n\tend applicationWillFinishLaunching_\n\t\n\ton applicationDidFinishLaunching_(aNotification)\n\t\t-- Insert code here to initialize your application before any files are opened\n\t\ttell current application's NSTimer to set theTimer to scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_(10, me, \"timerFired:\", missing value, false)\n\tend applicationDidFinishLaunching_\n\t\n\ton timerFired_(timer)\n\t\tquit\n\tend timerFired_\n\t\n\ton applicationShouldTerminate_(sender)\n\t\t-- Insert code here to do any housekeeping before your application quits \n\t\treturn current application's NSTerminateNow\n\tend applicationShouldTerminate_\n\t\n\ton application_openFiles_(appl, theFiles)\n\t\t\n\t\tset mavericks to isMavericksOrLater()\n\t\tif mavericks is true\n\t\t(* TODO: check for QuickTime 7, and point the user to the download location if they don't *)\n\t\ttell application id \"com.apple.quicktimeplayer\"\n\t\t\trepeat with theFile in theFiles's allObjects()\n\t\t\t\tset theFilePox to (theFile's fileSystemRepresentation())\n\t\t\t\topen theFilePox as POSIX file\n\t\t\tend repeat\n\t\t\t\n\t\t\tactivate\n\t\tend tell\n\n\t\telse\n\t\t\n\t\ttell application \"QuickTime Player\"\n\t\t\trepeat with theFile in theFiles's allObjects()\n\t\t\t\tset theFilePox to (theFile's fileSystemRepresentation())\n\t\t\t\topen theFilePox as POSIX file\n\t\t\tend repeat\n\t\t\t\n\t\t\tactivate\n\t\tend tell\n\t\tend\n\t\tquit\n\t\t\n\t\treturn yes\n\tend application_openFiles_\n\t\nend script\n","subject":"Implement isMavericksOrLater on the updater.","message":"Implement isMavericksOrLater on the updater.\n","lang":"AppleScript","license":"lgpl-2.1","repos":"MaddTheSane\/perian,MaddTheSane\/perian,MaddTheSane\/perian,MaddTheSane\/perian,MaddTheSane\/perian,MaddTheSane\/perian"}
{"commit":"6d11fe3774ad16f29b5f099cdb2dc82ff33db66e","old_file":"macosx\/scripts\/iTunes\/mobile-speakers.applescript","new_file":"macosx\/scripts\/iTunes\/mobile-speakers.applescript","old_contents":"(*\n  Script object to make calling a defined function easier while in the\n  iTunes and System Events name space.\n*)\nscript remoteSpeakerFinder\n  -- Given a list of buttons, find the remote speakers button\n  -- by finding the first button with a name that isn't in a \n  -- rejection list.\n  on findCorrectButton (in_buttons)\n    set buttons_to_skip to {\"Burn Disc\"}\n\n    repeat with a_button in in_buttons\n      try -- some buttons don't have names\n        set the_name to name of a_button\n        if buttons_to_skip does not contain {the_name} then\n          return the_name\n        end if\n      end try\n    end repeat\n\n    return 16 -- default response\n  end findCorrectButton\nend script\n\n(*\n  Tell iTunes to use the \"Mobile\" set of remote speakers.\n*)\ntell application \"System Events\"\n  tell process \"iTunes\"\n     set the_buttons to (get buttons of window 1)\n     set the_speaker_button to (remoteSpeakerFinder's findCorrectButton(the_buttons))\n\n     -- Switch to the speakers in my bedroom\n     set frontmost to true\n     click button the_speaker_button of window 1\n     key code 115                -- Home Key (first speaker in list)\n     key code 125                -- Down Arrow\n     key code 125                -- Down Arrow\n     key code 36                 -- Return Key\n  end tell\nend tell\n","new_contents":"(*\n  Script object to make calling a defined function easier while in the\n  iTunes and System Events name space.\n*)\nscript remoteSpeakerFinder\n  -- Given a list of buttons, find the remote speakers button\n  -- by finding the first button with a name that isn't in a \n  -- rejection list.\n  on findCorrectButton (in_buttons)\n    set buttons_to_skip to {\"Burn Disc\"}\n\n    repeat with a_button in in_buttons\n      try -- some buttons don't have names\n        set the_name to name of a_button\n        if buttons_to_skip does not contain {the_name} then\n          return the_name\n        end if\n      end try\n    end repeat\n\n    return 16 -- default response\n  end findCorrectButton\nend script\n\n(*\n  Tell iTunes to use the \"Mobile\" set of remote speakers.\n*)\ntell application \"System Events\"\n  tell process \"iTunes\"\n     set the_buttons to (get buttons of window 1)\n     set the_speaker_button to (remoteSpeakerFinder's findCorrectButton(the_buttons))\n\n     -- Switch to the speakers in my bedroom\n     set frontmost to true\n     click button the_speaker_button of window 1\n     key code 115                -- Home Key (first speaker in list)\n     key code 125                -- Down Arrow\n     key code 125                -- Down Arrow\n     key code 36                 -- Return Key\n\n     -- Wait for iTunes to connect to the speakers\n     delay 5\n  end tell\nend tell\n","subject":"Work around an issue with iTunes 9 that causes it to delay a connection to remote speakers","message":"Work around an issue with iTunes 9 that causes it to delay a\nconnection to remote speakers\n","lang":"AppleScript","license":"bsd-3-clause","repos":"pjones\/emacsrc"}
{"commit":"4fa706df5e87b9dd4df0ea572cd7c6914b0b546d","old_file":"javascript\/safari-driver\/reinstall.scpt","new_file":"javascript\/safari-driver\/reinstall.scpt","old_contents":"#!\/usr\/bin\/osascript\n(*\nCopyright 2012 Software Freedom Conservancy. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*)\n\n(*\nThis script can be used to quickly re-install the SafariDriver extension\nduring development.\n\nRequirements:\n- The extension must be manually installed before use\n- This script must be run from the trunk.\n*)\n\n\n-- Keep this in sync with the name of the extension in the Info.plist\nset EXTENSION to \"WebDriver\"\n\ntell application \"System Events\"\n\tset ui_elements_enabled to UI elements enabled\nend tell\n\nif ui_elements_enabled is false then\n\ttell application \"System Preferences\"\n\t\tactivate\n\t\tset current pane to pane id \"com.apple.preference.universalaccess\"\n\t\tdisplay dialog \"Please \\\"Enable access for assistive devices\\\" \" & \u00ac\n\t\t    \"and try again...\"\n\t\terror number -128\n\tend tell\nend if\n\n\ntell application \"Safari\" to activate\n\ntell application \"System Events\"\n\ttell process \"Safari\"\n\t\ttell menu bar 1\n\t\t\ttell menu \"Develop\"\n\t\t\t\tclick menu item \"Show Extension Builder\"\n\t\t\t\tdelay 1\n\t\t\tend tell\n\t\tend tell\n\t\t\n\t\t-- https:\/\/discussions.apple.com\/thread\/2726674?start=0&tstart=0\n\t\ttell UI element 1 of scroll area 1 of window \"Extension Builder\"\n\t\t\tset found_extension to false\n\t\t\tset tc to (count (groups whose its images is not {}))\n\t\t\trepeat with i from 1 to tc\n\t\t\t\tif exists (static text 1 of group i) then\n\t\t\t\t\tset t_name to name of static text 1 of group i\n\t\t\t\t\tif t_name is EXTENSION then\n\t\t\t\t\t\tset found_extension to true\n\t\t\t\t\t\tclick button \"Reload\" of UI element (\"ReloadUninstall\" & t_name)\n\t\t\t\t\t\texit repeat\n\t\t\t\t\tend if\n\t\t\t\tend if\n\t\t\t\tkeystroke (character id 31)\n\t\t\t\tdelay 0.2\n\t\t\tend repeat\n\t\t\t\n\t\t\tif found_extension is false then\n\t\t\t\tdisplay dialog \"Was unable to locate the extension \\\"\" & EXTENSION \u00ac\n\t\t\t\t    & \"\\\"\" & return & return \u00ac\n\t\t\t\t    & \"It must be manually installed before this script may be used.\"\n\t\t\t\terror number -128\n\t\t\tend if\n\t\tend tell\n\tend tell\nend tell\n\ntell application \"Safari\" to quit\n","new_contents":"#!\/usr\/bin\/osascript\n(*\nCopyright 2012 Software Freedom Conservancy. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n      http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*)\n\n(*\nThis script can be used to quickly re-install the SafariDriver extension\nduring development.\n\nRequirements:\n- The extension must be manually installed before use\n- This script must be run from the trunk.\n*)\n\n\n-- Keep this in sync with the name of the extension in the Info.plist\nset EXTENSION to \"WebDriver\"\n\ntell application \"System Events\"\n\tset ui_elements_enabled to UI elements enabled\nend tell\n\nif ui_elements_enabled is false then\n\ttell application \"System Preferences\"\n\t\tactivate\n\t\tset current pane to pane id \"com.apple.preference.universalaccess\"\n\t\tdisplay dialog \"Please \\\"Enable access for assistive devices\\\" \" & \u00ac\n\t\t\t\"and try again...\"\n\t\terror number -128\n\tend tell\nend if\n\ntell application \"Safari\" to activate\n\ntell application \"System Events\"\n\ttell process \"Safari\"\n\t\ttell menu bar 1\n\t\t\t-- tell menu \"Develop\"\n\t\t\ttell menu bar item 8\n\t\t\t\ttell menu 1\n\t\t\t\t\t-- click menu item \"Show Extension Builder\"\n\t\t\t\t\tclick menu item 7\n\t\t\t\tend tell\n\t\t\tend tell\n\t\tend tell\n\t\t\n\t\tdelay 0.2\n\t\t\n\t\t-- https:\/\/discussions.apple.com\/thread\/2726674?start=0&tstart=0\n\t\t-- tell UI element 1 of scroll area 1 of window \"Extension Builder\"\n\t\ttell UI element 1 of scroll area 1 of window 1\n\t\t\tset found_extension to false\n\t\t\tset tc to (count (groups whose its images is not {}))\n\t\t\trepeat with i from 1 to tc\n\t\t\t\tif exists (static text 1 of group i) then\n\t\t\t\t\tset t_name to name of static text 1 of group i\n\t\t\t\t\tif t_name is EXTENSION then\n\t\t\t\t\t\tset found_extension to true\n\t\t\t\t\t\t-- click button \"Reload\" of UI element (\"ReloadUninstall\" & t_name)\n\t\t\t\t\t\tclick button 1 of UI element 4\n\t\t\t\t\t\texit repeat\n\t\t\t\t\tend if\n\t\t\t\tend if\n\t\t\t\tkeystroke (character id 31)\n\t\t\t\tdelay 0.2\n\t\t\tend repeat\n\t\t\t\n\t\t\tif found_extension is false then\n\t\t\t\tdisplay dialog \"Was unable to locate the extension \\\"\" & EXTENSION \u00ac\n\t\t\t\t\t& \"\\\"\" & return & return \u00ac\n\t\t\t\t\t& \"It must be manually installed before this script may be used.\"\n\t\t\t\terror number -128\n\t\t\tend if\n\t\tend tell\n\tend tell\nend tell\n\ntell application \"Safari\" to quit\n","subject":"Make reinstall.scpt system language independent.","message":"JasonLeyba: Make reinstall.scpt system language independent.\n\nr16964\n","lang":"AppleScript","license":"apache-2.0","repos":"gurayinan\/selenium,kalyanjvn1\/selenium,amar-sharma\/selenium,jerome-jacob\/selenium,knorrium\/selenium,BlackSmith\/selenium,isaksky\/selenium,BlackSmith\/selenium,compstak\/selenium,lrowe\/selenium,Herst\/selenium,dibagga\/selenium,lilredindy\/selenium,Tom-Trumper\/selenium,clavery\/selenium,meksh\/selenium,DrMarcII\/selenium,oddui\/selenium,denis-vilyuzhanin\/selenium-fastview,carlosroh\/selenium,skurochkin\/selenium,slongwang\/selenium,tbeadle\/selenium,tkurnosova\/selenium,mojwang\/selenium,customcommander\/selenium,mach6\/selenium,Dude-X\/selenium,gotcha\/selenium,DrMarcII\/selenium,Dude-X\/selenium,carsonmcdonald\/selenium,SevInf\/IEDriver,o-schneider\/selenium,thanhpete\/selenium,minhthuanit\/selenium,joshbruning\/selenium,temyers\/selenium,meksh\/selenium,Dude-X\/selenium,chrsmithdemos\/selenium,lilredindy\/selenium,i17c\/selenium,xsyntrex\/selenium,pulkitsinghal\/selenium,asashour\/selenium,orange-tv-blagnac\/selenium,RamaraoDonta\/ramarao-clone,slongwang\/selenium,jabbrwcky\/selenium,sevaseva\/selenium,chrsmithdemos\/selenium,gemini-testing\/selenium,orange-tv-blagnac\/selenium,alb-i986\/selenium,gotcha\/selenium,Appdynamics\/selenium,JosephCastro\/selenium,markodolancic\/selenium,valfirst\/selenium,gorlemik\/selenium,titusfortner\/selenium,rovner\/selenium,Tom-Trumper\/selenium,joshuaduffy\/selenium,joshmgrant\/selenium,gregerrag\/selenium,yukaReal\/selenium,lummyare\/lummyare-test,denis-vilyuzhanin\/selenium-fastview,asashour\/selenium,TheBlackTuxCorp\/selenium,krosenvold\/selenium,GorK-ChO\/selenium,quoideneuf\/selenium,freynaud\/selenium,dbo\/selenium,markodolancic\/selenium,xsyntrex\/selenium,onedox\/selenium,uchida\/selenium,livioc\/selenium,bmannix\/selenium,lummyare\/lummyare-test,joshuaduffy\/selenium,sebady\/selenium,SevInf\/IEDriver,blackboarddd\/selenium,temyers\/selenium,houchj\/selenium,telefonicaid\/selenium,dandv\/selenium,knorrium\/selenium,clavery\/selenium,zenefits\/selenium,sevaseva\/selenium,Herst\/selenium,dibagga\/selenium,krosenvold\/selenium,mojwang\/selenium,JosephCastro\/selenium,kalyanjvn1\/selenium,arunsingh\/selenium,dbo\/selenium,tkurnosova\/selenium,GorK-ChO\/selenium,5hawnknight\/selenium,sag-enorman\/selenium,gotcha\/selenium,denis-vilyuzhanin\/selenium-fastview,yukaReal\/selenium,MeetMe\/selenium,SouWilliams\/selenium,jsakamoto\/selenium,MeetMe\/selenium,blueyed\/selenium,petruc\/selenium,blackboarddd\/selenium,GorK-ChO\/selenium,wambat\/selenium,chrsmithdemos\/selenium,davehunt\/selenium,customcommander\/selenium,DrMarcII\/selenium,carsonmcdonald\/selenium,sankha93\/selenium,chrsmithdemos\/selenium,lilredindy\/selenium,soundcloud\/selenium,tkurnosova\/selenium,juangj\/selenium,lilredindy\/selenium,jerome-jacob\/selenium,livioc\/selenium,vinay-qa\/vinayit-android-server-apk,sebady\/selenium,rovner\/selenium,oddui\/selenium,freynaud\/selenium,tkurnosova\/selenium,AutomatedTester\/selenium,gabrielsimas\/selenium,alb-i986\/selenium,joshmgrant\/selenium,krosenvold\/selenium,pulkitsinghal\/selenium,lilredindy\/selenium,alexec\/selenium,Herst\/selenium,chrisblock\/selenium,jsakamoto\/selenium,skurochkin\/selenium,isaksky\/selenium,mestihudson\/selenium,vinay-qa\/vinayit-android-server-apk,thanhpete\/selenium,misttechnologies\/selenium,TheBlackTuxCorp\/selenium,joshmgrant\/selenium,joshbruning\/selenium,misttechnologies\/selenium,gotcha\/selenium,amar-sharma\/selenium,DrMarcII\/selenium,joshuaduffy\/selenium,zenefits\/selenium,kalyanjvn1\/selenium,dcjohnson1989\/selenium,jerome-jacob\/selenium,Ardesco\/selenium,gurayinan\/selenium,joshuaduffy\/selenium,Jarob22\/selenium,quoideneuf\/selenium,bmannix\/selenium,rrussell39\/selenium,stupidnetizen\/selenium,zenefits\/selenium,p0deje\/selenium,bartolkaruza\/selenium,mach6\/selenium,lukeis\/selenium,lukeis\/selenium,anshumanchatterji\/selenium,compstak\/selenium,s2oBCN\/selenium,sankha93\/selenium,xsyntrex\/selenium,meksh\/selenium,uchida\/selenium,bmannix\/selenium,lukeis\/selenium,aluedeke\/chromedriver,Sravyaksr\/selenium,blueyed\/selenium,clavery\/selenium,Ardesco\/selenium,xsyntrex\/selenium,wambat\/selenium,HtmlUnit\/selenium,chrsmithdemos\/selenium,kalyanjvn1\/selenium,Herst\/selenium,onedox\/selenium,markodolancic\/selenium,alexec\/selenium,dkentw\/selenium,jerome-jacob\/selenium,amikey\/selenium,lmtierney\/selenium,jknguyen\/josephknguyen-selenium,lummyare\/lummyare-test,knorrium\/selenium,eric-stanley\/selenium,joshbruning\/selenium,Tom-Trumper\/selenium,orange-tv-blagnac\/selenium,amikey\/selenium,amar-sharma\/selenium,amar-sharma\/selenium,lummyare\/lummyare-test,tarlabs\/selenium,customcommander\/selenium,titusfortner\/selenium,arunsingh\/selenium,lmtierney\/selenium,rovner\/selenium,mach6\/selenium,joshuaduffy\/selenium,vinay-qa\/vinayit-android-server-apk,valfirst\/selenium,chrisblock\/selenium,RamaraoDonta\/ramarao-clone,dimacus\/selenium,lilredindy\/selenium,GorK-ChO\/selenium,jsakamoto\/selenium,anshumanchatterji\/selenium,blackboarddd\/selenium,DrMarcII\/selenium,slongwang\/selenium,twalpole\/selenium,misttechnologies\/selenium,bayandin\/selenium,aluedeke\/chromedriver,yukaReal\/selenium,mestihudson\/selenium,JosephCastro\/selenium,Jarob22\/selenium,jknguyen\/josephknguyen-selenium,lummyare\/lummyare-test,sevaseva\/selenium,juangj\/selenium,MCGallaspy\/selenium,uchida\/selenium,orange-tv-blagnac\/selenium,sevaseva\/selenium,gregerrag\/selenium,xmhubj\/selenium,TheBlackTuxCorp\/selenium,pulkitsinghal\/selenium,s2oBCN\/selenium,orange-tv-blagnac\/selenium,p0deje\/selenium,gorlemik\/selenium,xsyntrex\/selenium,alexec\/selenium,gregerrag\/selenium,wambat\/selenium,sankha93\/selenium,doungni\/selenium,denis-vilyuzhanin\/selenium-fastview,juangj\/selenium,tkurnosova\/selenium,RamaraoDonta\/ramarao-clone,Tom-Trumper\/selenium,SevInf\/IEDriver,twalpole\/selenium,dandv\/selenium,dandv\/selenium,TikhomirovSergey\/selenium,thanhpete\/selenium,telefonicaid\/selenium,tkurnosova\/selenium,blueyed\/selenium,gurayinan\/selenium,onedox\/selenium,JosephCastro\/selenium,jabbrwcky\/selenium,freynaud\/selenium,jabbrwcky\/selenium,asolntsev\/selenium,markodolancic\/selenium,rovner\/selenium,xmhubj\/selenium,freynaud\/selenium,compstak\/selenium,actmd\/selenium,sankha93\/selenium,juangj\/selenium,isaksky\/selenium,Jarob22\/selenium,valfirst\/selenium,knorrium\/selenium,lmtierney\/selenium,tarlabs\/selenium,AutomatedTester\/selenium,i17c\/selenium,thanhpete\/selenium,sebady\/selenium,davehunt\/selenium,5hawnknight\/selenium,vveliev\/selenium,tbeadle\/selenium,sankha93\/selenium,carlosroh\/selenium,JosephCastro\/selenium,isaksky\/selenium,carsonmcdonald\/selenium,krmahadevan\/selenium,lummyare\/lummyare-test,lummyare\/lummyare-lummy,aluedeke\/chromedriver,actmd\/selenium,Herst\/selenium,zenefits\/selenium,orange-tv-blagnac\/selenium,joshmgrant\/selenium,lummyare\/lummyare-lummy,dibagga\/selenium,o-schneider\/selenium,mestihudson\/selenium,bmannix\/selenium,titusfortner\/selenium,jerome-jacob\/selenium,bayandin\/selenium,Sravyaksr\/selenium,alb-i986\/selenium,jsakamoto\/selenium,Herst\/selenium,meksh\/selenium,orange-tv-blagnac\/selenium,Ardesco\/selenium,lukeis\/selenium,blackboarddd\/selenium,bartolkaruza\/selenium,joshmgrant\/selenium,stupidnetizen\/selenium,5hawnknight\/selenium,wambat\/selenium,minhthuanit\/selenium,Appdynamics\/selenium,zenefits\/selenium,tarlabs\/selenium,JosephCastro\/selenium,sri85\/selenium,MCGallaspy\/selenium,gotcha\/selenium,chrisblock\/selenium,onedox\/selenium,vveliev\/selenium,xmhubj\/selenium,zenefits\/selenium,rrussell39\/selenium,clavery\/selenium,lrowe\/selenium,gorlemik\/selenium,sebady\/selenium,amar-sharma\/selenium,Dude-X\/selenium,blackboarddd\/selenium,quoideneuf\/selenium,joshbruning\/selenium,twalpole\/selenium,vinay-qa\/vinayit-android-server-apk,misttechnologies\/selenium,rplevka\/selenium,isaksky\/selenium,jerome-jacob\/selenium,HtmlUnit\/selenium,denis-vilyuzhanin\/selenium-fastview,dibagga\/selenium,onedox\/selenium,p0deje\/selenium,jknguyen\/josephknguyen-selenium,mojwang\/selenium,MeetMe\/selenium,kalyanjvn1\/selenium,temyers\/selenium,skurochkin\/selenium,HtmlUnit\/selenium,dcjohnson1989\/selenium,rrussell39\/selenium,valfirst\/selenium,sag-enorman\/selenium,SeleniumHQ\/selenium,compstak\/selenium,jabbrwcky\/selenium,joshmgrant\/selenium,TheBlackTuxCorp\/selenium,blueyed\/selenium,clavery\/selenium,gurayinan\/selenium,SeleniumHQ\/selenium,amikey\/selenium,livioc\/selenium,denis-vilyuzhanin\/selenium-fastview,dcjohnson1989\/selenium,lilredindy\/selenium,thanhpete\/selenium,juangj\/selenium,mojwang\/selenium,Appdynamics\/selenium,temyers\/selenium,dibagga\/selenium,temyers\/selenium,oddui\/selenium,soundcloud\/selenium,arunsingh\/selenium,i17c\/selenium,dandv\/selenium,AutomatedTester\/selenium,asashour\/selenium,dimacus\/selenium,Sravyaksr\/selenium,xmhubj\/selenium,Sravyaksr\/selenium,mestihudson\/selenium,alexec\/selenium,gregerrag\/selenium,alb-i986\/selenium,TikhomirovSergey\/selenium,lukeis\/selenium,amikey\/selenium,rrussell39\/selenium,telefonicaid\/selenium,gemini-testing\/selenium,lukeis\/selenium,bmannix\/selenium,bartolkaruza\/selenium,stupidnetizen\/selenium,carsonmcdonald\/selenium,jknguyen\/josephknguyen-selenium,krmahadevan\/selenium,Jarob22\/selenium,twalpole\/selenium,orange-tv-blagnac\/selenium,carsonmcdonald\/selenium,GorK-ChO\/selenium,TikhomirovSergey\/selenium,krosenvold\/selenium,vveliev\/selenium,customcommander\/selenium,misttechnologies\/selenium,SouWilliams\/selenium,SevInf\/IEDriver,pulkitsinghal\/selenium,lummyare\/lummyare-lummy,Dude-X\/selenium,gabrielsimas\/selenium,manuelpirez\/selenium,DrMarcII\/selenium,eric-stanley\/selenium,dimacus\/selenium,alb-i986\/selenium,jabbrwcky\/selenium,gemini-testing\/selenium,davehunt\/selenium,yukaReal\/selenium,rrussell39\/selenium,soundcloud\/selenium,quoideneuf\/selenium,mach6\/selenium,alb-i986\/selenium,misttechnologies\/selenium,markodolancic\/selenium,houchj\/selenium,slongwang\/selenium,5hawnknight\/selenium,Appdynamics\/selenium,Herst\/selenium,petruc\/selenium,jsakamoto\/selenium,dkentw\/selenium,doungni\/selenium,alexec\/selenium,krmahadevan\/selenium,lrowe\/selenium,compstak\/selenium,i17c\/selenium,sevaseva\/selenium,manuelpirez\/selenium,dkentw\/selenium,oddui\/selenium,MCGallaspy\/selenium,titusfortner\/selenium,joshbruning\/selenium,aluedeke\/chromedriver,TheBlackTuxCorp\/selenium,vinay-qa\/vinayit-android-server-apk,houchj\/selenium,actmd\/selenium,bartolkaruza\/selenium,i17c\/selenium,misttechnologies\/selenium,freynaud\/selenium,anshumanchatterji\/selenium,asolntsev\/selenium,TikhomirovSergey\/selenium,Sravyaksr\/selenium,o-schneider\/selenium,mestihudson\/selenium,yukaReal\/selenium,eric-stanley\/selenium,chrisblock\/selenium,telefonicaid\/selenium,minhthuanit\/selenium,AutomatedTester\/selenium,xmhubj\/selenium,krmahadevan\/selenium,customcommander\/selenium,bayandin\/selenium,actmd\/selenium,rplevka\/selenium,dimacus\/selenium,lummyare\/lummyare-lummy,Herst\/selenium,gurayinan\/selenium,bartolkaruza\/selenium,petruc\/selenium,o-schneider\/selenium,onedox\/selenium,uchida\/selenium,MeetMe\/selenium,p0deje\/selenium,BlackSmith\/selenium,pulkitsinghal\/selenium,eric-stanley\/selenium,gorlemik\/selenium,actmd\/selenium,sag-enorman\/selenium,lmtierney\/selenium,markodolancic\/selenium,petruc\/selenium,joshuaduffy\/selenium,gurayinan\/selenium,quoideneuf\/selenium,davehunt\/selenium,temyers\/selenium,temyers\/selenium,i17c\/selenium,oddui\/selenium,Appdynamics\/selenium,blueyed\/selenium,krmahadevan\/selenium,GorK-ChO\/selenium,lummyare\/lummyare-test,o-schneider\/selenium,meksh\/selenium,rrussell39\/selenium,titusfortner\/selenium,amar-sharma\/selenium,BlackSmith\/selenium,sag-enorman\/selenium,valfirst\/selenium,actmd\/selenium,JosephCastro\/selenium,TikhomirovSergey\/selenium,houchj\/selenium,minhthuanit\/selenium,HtmlUnit\/selenium,freynaud\/selenium,s2oBCN\/selenium,lmtierney\/selenium,skurochkin\/selenium,lukeis\/selenium,dcjohnson1989\/selenium,jabbrwcky\/selenium,quoideneuf\/selenium,vveliev\/selenium,asolntsev\/selenium,actmd\/selenium,chrisblock\/selenium,MCGallaspy\/selenium,davehunt\/selenium,actmd\/selenium,houchj\/selenium,dbo\/selenium,amar-sharma\/selenium,skurochkin\/selenium,sag-enorman\/selenium,denis-vilyuzhanin\/selenium-fastview,SouWilliams\/selenium,SevInf\/IEDriver,dkentw\/selenium,meksh\/selenium,carlosroh\/selenium,thanhpete\/selenium,xsyntrex\/selenium,MeetMe\/selenium,joshbruning\/selenium,titusfortner\/selenium,clavery\/selenium,slongwang\/selenium,bayandin\/selenium,valfirst\/selenium,dbo\/selenium,krmahadevan\/selenium,blackboarddd\/selenium,sri85\/selenium,dcjohnson1989\/selenium,rrussell39\/selenium,yukaReal\/selenium,compstak\/selenium,s2oBCN\/selenium,titusfortner\/selenium,dbo\/selenium,dimacus\/selenium,rrussell39\/selenium,RamaraoDonta\/ramarao-clone,sevaseva\/selenium,TheBlackTuxCorp\/selenium,clavery\/selenium,denis-vilyuzhanin\/selenium-fastview,dandv\/selenium,gemini-testing\/selenium,wambat\/selenium,JosephCastro\/selenium,kalyanjvn1\/selenium,clavery\/selenium,tbeadle\/selenium,JosephCastro\/selenium,jknguyen\/josephknguyen-selenium,rplevka\/selenium,sebady\/selenium,compstak\/selenium,slongwang\/selenium,gregerrag\/selenium,AutomatedTester\/selenium,markodolancic\/selenium,chrsmithdemos\/selenium,krmahadevan\/selenium,sankha93\/selenium,Appdynamics\/selenium,vveliev\/selenium,mach6\/selenium,bmannix\/selenium,joshmgrant\/selenium,jabbrwcky\/selenium,o-schneider\/selenium,jabbrwcky\/selenium,dimacus\/selenium,Sravyaksr\/selenium,thanhpete\/selenium,s2oBCN\/selenium,sag-enorman\/selenium,stupidnetizen\/selenium,arunsingh\/selenium,manuelpirez\/selenium,mach6\/selenium,carlosroh\/selenium,dibagga\/selenium,stupidnetizen\/selenium,sankha93\/selenium,manuelpirez\/selenium,gemini-testing\/selenium,joshmgrant\/selenium,joshmgrant\/selenium,i17c\/selenium,anshumanchatterji\/selenium,carlosroh\/selenium,joshuaduffy\/selenium,RamaraoDonta\/ramarao-clone,freynaud\/selenium,DrMarcII\/selenium,rplevka\/selenium,5hawnknight\/selenium,yukaReal\/selenium,rovner\/selenium,eric-stanley\/selenium,bartolkaruza\/selenium,lummyare\/lummyare-test,HtmlUnit\/selenium,sri85\/selenium,sebady\/selenium,gurayinan\/selenium,jsarenik\/jajomojo-selenium,mach6\/selenium,jabbrwcky\/selenium,asashour\/selenium,s2oBCN\/selenium,rovner\/selenium,sebady\/selenium,valfirst\/selenium,bayandin\/selenium,Jarob22\/selenium,titusfortner\/selenium,livioc\/selenium,TikhomirovSergey\/selenium,twalpole\/selenium,carlosroh\/selenium,dkentw\/selenium,actmd\/selenium,amikey\/selenium,lummyare\/lummyare-lummy,arunsingh\/selenium,gorlemik\/selenium,dkentw\/selenium,anshumanchatterji\/selenium,skurochkin\/selenium,houchj\/selenium,jsarenik\/jajomojo-selenium,rplevka\/selenium,telefonicaid\/selenium,tkurnosova\/selenium,dandv\/selenium,sevaseva\/selenium,p0deje\/selenium,HtmlUnit\/selenium,jsarenik\/jajomojo-selenium,jsakamoto\/selenium,mach6\/selenium,MeetMe\/selenium,Dude-X\/selenium,sevaseva\/selenium,skurochkin\/selenium,dimacus\/selenium,manuelpirez\/selenium,arunsingh\/selenium,vveliev\/selenium,customcommander\/selenium,mojwang\/selenium,Jarob22\/selenium,zenefits\/selenium,orange-tv-blagnac\/selenium,jknguyen\/josephknguyen-selenium,compstak\/selenium,dbo\/selenium,asolntsev\/selenium,petruc\/selenium,tbeadle\/selenium,blueyed\/selenium,blueyed\/selenium,jsarenik\/jajomojo-selenium,gorlemik\/selenium,MeetMe\/selenium,asolntsev\/selenium,isaksky\/selenium,minhthuanit\/selenium,krosenvold\/selenium,dimacus\/selenium,lummyare\/lummyare-lummy,MCGallaspy\/selenium,SeleniumHQ\/selenium,sag-enorman\/selenium,joshuaduffy\/selenium,dkentw\/selenium,5hawnknight\/selenium,AutomatedTester\/selenium,Jarob22\/selenium,mojwang\/selenium,sri85\/selenium,BlackSmith\/selenium,p0deje\/selenium,customcommander\/selenium,petruc\/selenium,lilredindy\/selenium,amikey\/selenium,rovner\/selenium,knorrium\/selenium,Ardesco\/selenium,MCGallaspy\/selenium,oddui\/selenium,clavery\/selenium,houchj\/selenium,carsonmcdonald\/selenium,BlackSmith\/selenium,lrowe\/selenium,dimacus\/selenium,s2oBCN\/selenium,lmtierney\/selenium,bmannix\/selenium,sri85\/selenium,SeleniumHQ\/selenium,SeleniumHQ\/selenium,SeleniumHQ\/selenium,valfirst\/selenium,dibagga\/selenium,jsarenik\/jajomojo-selenium,juangj\/selenium,gregerrag\/selenium,Tom-Trumper\/selenium,kalyanjvn1\/selenium,BlackSmith\/selenium,xsyntrex\/selenium,rplevka\/selenium,tarlabs\/selenium,vinay-qa\/vinayit-android-server-apk,mestihudson\/selenium,lilredindy\/selenium,lmtierney\/selenium,vveliev\/selenium,blueyed\/selenium,AutomatedTester\/selenium,amikey\/selenium,jsakamoto\/selenium,asashour\/selenium,Tom-Trumper\/selenium,TikhomirovSergey\/selenium,o-schneider\/selenium,dcjohnson1989\/selenium,joshbruning\/selenium,SouWilliams\/selenium,SouWilliams\/selenium,HtmlUnit\/selenium,RamaraoDonta\/ramarao-clone,lrowe\/selenium,livioc\/selenium,dbo\/selenium,HtmlUnit\/selenium,p0deje\/selenium,tarlabs\/selenium,gorlemik\/selenium,SouWilliams\/selenium,s2oBCN\/selenium,SeleniumHQ\/selenium,houchj\/selenium,isaksky\/selenium,customcommander\/selenium,SevInf\/IEDriver,GorK-ChO\/selenium,dcjohnson1989\/selenium,knorrium\/selenium,carsonmcdonald\/selenium,tarlabs\/selenium,s2oBCN\/selenium,blackboarddd\/selenium,dibagga\/selenium,SeleniumHQ\/selenium,tarlabs\/selenium,gabrielsimas\/selenium,amikey\/selenium,Dude-X\/selenium,gregerrag\/selenium,minhthuanit\/selenium,MCGallaspy\/selenium,tarlabs\/selenium,onedox\/selenium,telefonicaid\/selenium,chrisblock\/selenium,SouWilliams\/selenium,RamaraoDonta\/ramarao-clone,Ardesco\/selenium,lukeis\/selenium,slongwang\/selenium,vinay-qa\/vinayit-android-server-apk,chrsmithdemos\/selenium,krmahadevan\/selenium,titusfortner\/selenium,gurayinan\/selenium,titusfortner\/selenium,gorlemik\/selenium,vveliev\/selenium,soundcloud\/selenium,aluedeke\/chromedriver,twalpole\/selenium,tbeadle\/selenium,Sravyaksr\/selenium,o-schneider\/selenium,petruc\/selenium,SevInf\/IEDriver,manuelpirez\/selenium,slongwang\/selenium,sebady\/selenium,livioc\/selenium,jsarenik\/jajomojo-selenium,knorrium\/selenium,BlackSmith\/selenium,Ardesco\/selenium,doungni\/selenium,chrsmithdemos\/selenium,gemini-testing\/selenium,twalpole\/selenium,chrisblock\/selenium,stupidnetizen\/selenium,denis-vilyuzhanin\/selenium-fastview,krosenvold\/selenium,sri85\/selenium,carsonmcdonald\/selenium,GorK-ChO\/selenium,joshuaduffy\/selenium,xsyntrex\/selenium,davehunt\/selenium,gorlemik\/selenium,sebady\/selenium,gabrielsimas\/selenium,lukeis\/selenium,krosenvold\/selenium,gabrielsimas\/selenium,lrowe\/selenium,uchida\/selenium,jsarenik\/jajomojo-selenium,5hawnknight\/selenium,markodolancic\/selenium,sevaseva\/selenium,quoideneuf\/selenium,aluedeke\/chromedriver,asashour\/selenium,krosenvold\/selenium,doungni\/selenium,tbeadle\/selenium,GorK-ChO\/selenium,bartolkaruza\/selenium,manuelpirez\/selenium,zenefits\/selenium,amar-sharma\/selenium,SeleniumHQ\/selenium,MCGallaspy\/selenium,eric-stanley\/selenium,asashour\/selenium,asashour\/selenium,krmahadevan\/selenium,jerome-jacob\/selenium,Ardesco\/selenium,bmannix\/selenium,amar-sharma\/selenium,jerome-jacob\/selenium,temyers\/selenium,minhthuanit\/selenium,lmtierney\/selenium,dandv\/selenium,uchida\/selenium,meksh\/selenium,meksh\/selenium,MeetMe\/selenium,jknguyen\/josephknguyen-selenium,chrisblock\/selenium,arunsingh\/selenium,mestihudson\/selenium,twalpole\/selenium,AutomatedTester\/selenium,carsonmcdonald\/selenium,misttechnologies\/selenium,gemini-testing\/selenium,oddui\/selenium,dkentw\/selenium,titusfortner\/selenium,gemini-testing\/selenium,bartolkaruza\/selenium,Appdynamics\/selenium,davehunt\/selenium,carlosroh\/selenium,tbeadle\/selenium,uchida\/selenium,Appdynamics\/selenium,asolntsev\/selenium,kalyanjvn1\/selenium,HtmlUnit\/selenium,vinay-qa\/vinayit-android-server-apk,carlosroh\/selenium,gotcha\/selenium,vveliev\/selenium,aluedeke\/chromedriver,lrowe\/selenium,manuelpirez\/selenium,jknguyen\/josephknguyen-selenium,slongwang\/selenium,eric-stanley\/selenium,RamaraoDonta\/ramarao-clone,amikey\/selenium,uchida\/selenium,tkurnosova\/selenium,mach6\/selenium,Jarob22\/selenium,pulkitsinghal\/selenium,mojwang\/selenium,soundcloud\/selenium,TheBlackTuxCorp\/selenium,jsarenik\/jajomojo-selenium,joshbruning\/selenium,sri85\/selenium,blackboarddd\/selenium,isaksky\/selenium,TikhomirovSergey\/selenium,blackboarddd\/selenium,joshmgrant\/selenium,gotcha\/selenium,p0deje\/selenium,dbo\/selenium,alexec\/selenium,anshumanchatterji\/selenium,gregerrag\/selenium,livioc\/selenium,soundcloud\/selenium,valfirst\/selenium,Tom-Trumper\/selenium,misttechnologies\/selenium,tbeadle\/selenium,minhthuanit\/selenium,rplevka\/selenium,wambat\/selenium,carlosroh\/selenium,knorrium\/selenium,compstak\/selenium,bayandin\/selenium,lmtierney\/selenium,xmhubj\/selenium,SeleniumHQ\/selenium,quoideneuf\/selenium,wambat\/selenium,joshmgrant\/selenium,xsyntrex\/selenium,Tom-Trumper\/selenium,soundcloud\/selenium,TheBlackTuxCorp\/selenium,sag-enorman\/selenium,yukaReal\/selenium,soundcloud\/selenium,valfirst\/selenium,aluedeke\/chromedriver,chrsmithdemos\/selenium,anshumanchatterji\/selenium,gotcha\/selenium,petruc\/selenium,Dude-X\/selenium,BlackSmith\/selenium,rrussell39\/selenium,bartolkaruza\/selenium,alb-i986\/selenium,rplevka\/selenium,alexec\/selenium,tkurnosova\/selenium,juangj\/selenium,meksh\/selenium,HtmlUnit\/selenium,dcjohnson1989\/selenium,pulkitsinghal\/selenium,mojwang\/selenium,arunsingh\/selenium,doungni\/selenium,onedox\/selenium,i17c\/selenium,krosenvold\/selenium,arunsingh\/selenium,DrMarcII\/selenium,Tom-Trumper\/selenium,jerome-jacob\/selenium,rovner\/selenium,rplevka\/selenium,TikhomirovSergey\/selenium,mestihudson\/selenium,Jarob22\/selenium,markodolancic\/selenium,doungni\/selenium,lrowe\/selenium,valfirst\/selenium,doungni\/selenium,knorrium\/selenium,yukaReal\/selenium,jsarenik\/jajomojo-selenium,sri85\/selenium,anshumanchatterji\/selenium,juangj\/selenium,wambat\/selenium,p0deje\/selenium,doungni\/selenium,davehunt\/selenium,dandv\/selenium,SouWilliams\/selenium,bayandin\/selenium,Sravyaksr\/selenium,sri85\/selenium,asolntsev\/selenium,bayandin\/selenium,telefonicaid\/selenium,livioc\/selenium,Herst\/selenium,alb-i986\/selenium,Ardesco\/selenium,rovner\/selenium,mestihudson\/selenium,eric-stanley\/selenium,asolntsev\/selenium,dibagga\/selenium,TheBlackTuxCorp\/selenium,chrisblock\/selenium,xmhubj\/selenium,AutomatedTester\/selenium,xmhubj\/selenium,joshbruning\/selenium,dcjohnson1989\/selenium,lrowe\/selenium,gabrielsimas\/selenium,uchida\/selenium,thanhpete\/selenium,o-schneider\/selenium,Ardesco\/selenium,eric-stanley\/selenium,mojwang\/selenium,i17c\/selenium,alexec\/selenium,Dude-X\/selenium,sankha93\/selenium,asashour\/selenium,kalyanjvn1\/selenium,gabrielsimas\/selenium,xmhubj\/selenium,aluedeke\/chromedriver,lummyare\/lummyare-lummy,vinay-qa\/vinayit-android-server-apk,juangj\/selenium,zenefits\/selenium,pulkitsinghal\/selenium,gemini-testing\/selenium,jknguyen\/josephknguyen-selenium,temyers\/selenium,alb-i986\/selenium,doungni\/selenium,manuelpirez\/selenium,SevInf\/IEDriver,soundcloud\/selenium,pulkitsinghal\/selenium,lummyare\/lummyare-lummy,stupidnetizen\/selenium,blueyed\/selenium,customcommander\/selenium,sag-enorman\/selenium,isaksky\/selenium,anshumanchatterji\/selenium,MeetMe\/selenium,thanhpete\/selenium,DrMarcII\/selenium,dandv\/selenium,livioc\/selenium,telefonicaid\/selenium,stupidnetizen\/selenium,onedox\/selenium,5hawnknight\/selenium,SouWilliams\/selenium,tbeadle\/selenium,dkentw\/selenium,Appdynamics\/selenium,gregerrag\/selenium,wambat\/selenium,stupidnetizen\/selenium,quoideneuf\/selenium,skurochkin\/selenium,5hawnknight\/selenium,jsakamoto\/selenium,SeleniumHQ\/selenium,RamaraoDonta\/ramarao-clone,alexec\/selenium,lummyare\/lummyare-test,oddui\/selenium,petruc\/selenium,dbo\/selenium,gurayinan\/selenium,SevInf\/IEDriver,lummyare\/lummyare-lummy,Sravyaksr\/selenium,jsakamoto\/selenium,sankha93\/selenium,gabrielsimas\/selenium,telefonicaid\/selenium,gotcha\/selenium,bayandin\/selenium,houchj\/selenium,MCGallaspy\/selenium,bmannix\/selenium,freynaud\/selenium,gabrielsimas\/selenium,twalpole\/selenium,davehunt\/selenium,tarlabs\/selenium,asolntsev\/selenium,minhthuanit\/selenium,oddui\/selenium,freynaud\/selenium,skurochkin\/selenium"}
{"commit":"70ef4fe62b06ca79438400ea702b324ba94c1b71","old_file":"XcodeWayExtensions\/Script\/XcodeWayScript.scpt","new_file":"XcodeWayExtensions\/Script\/XcodeWayScript.scpt","old_contents":"use scripting additions\nuse framework \"Foundation\"\nproperty NSString : a reference to current application's NSString\n\n-- Helper\n\non myRemoveLastPath(myPath)\nset myString to NSString's stringWithString:myPath\nset removedLastPathString to myString's stringByDeletingLastPathComponent\nremovedLastPathString as text\nend myRemoveLastPath\n\non myFolderExists(myFolder) -- (String) as Boolean\ntell application \"System Events\"\nif exists folder myFolder then\nreturn true\nelse\nreturn false\nend if\nend tell\nend myFolderExists\n\non myGetRemote(myText)\nset myString to NSString's stringWithString:myText\nset myParts to myString's componentsSeparatedByString:\"\\t\"\nset myFirstParts to item 1 of myParts\nmyFirstParts as text\nend myGetRemote\n\n-- Path\n\non myHomePath()\ntell application \"System Events\"\n\"\/Users\/\" & (name of current user)\nend tell\nend myHomePath\n\non myLibraryPath()\nmyHomePath() & \"\/Library\"\nend myLibraryPath\n\non myXcodePath()\nmyLibraryPath() & \"\/Developer\/Xcode\"\nend myXcodePath\n\non myUserDataPath()\nmyXcodePath() & \"\/UserData\"\nend myUserDataPath\n\non myProjectPath()\ntell application \"Xcode\"\ntell active workspace document\nset myPath to path\nend tell\nend tell\nmyRemoveLastPath(myPath)\nend myProjectPath\n\n-- Generic Open\n\non myOpenFolder(myPath)\ntell application \"Finder\"\nactivate\nopen myPath as POSIX file\nend tell\nend myOpenFolder\n\non myOpeniTerm(myPath)\ntell application \"Finder\"\ndo shell script \"open -a iTerm \" & quoted form of myPath\nend tell\nend myOpeniTerm\n\n-- Open\n\non myOpenThemesFolder()\nset myPath to myUserDataPath() & \"\/FontAndColorThemes\/\"\nmyOpenFolder(myPath)\nend myOpenThemesFolder\n\non myOpenCodeSnippetsFolder()\nset myPath to myUserDataPath() & \"\/CodeSnippets\/\"\nmyOpenFolder(myPath)\nend myOpenCodeSnippetsFolder\n\non myOpenDeviceSupportFolder()\nset myPath to \"\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/DeviceSupport\"\nmyOpenFolder(myPath)\nend myOpenDeviceSupportFolder\n\non myOpenArchivesFolder()\nset myPath to myXcodePath() & \"\/Archives\/\"\nmyOpenFolder(myPath)\nend myOpenArchivesFolder\n\non myOpenProvisioningProfileFolder()\nset myPath to myLibraryPath() & \"\/MobileDevice\/Provisioning Profiles\"\nmyOpenFolder(myPath)\nend myOpenProvisioningProfileFolder\n\non myOpenProjectFolder()\nset myPath to myProjectPath()\nmyOpenFolder(myPath)\nend myOpenProjectFolder\n\non myOpeniTermForCurrentProject()\nset myPath to myProjectPath()\nmyOpeniTerm(myPath)\nend myOpeniTermForCurrentProject\n\non myOpenDerivedDataFolder()\nset myRelativePath to myProjectPath() & \"\/DerivedData\/\"\nif myFolderExists(myRelativePath) then\nmyOpenFolder(myRelativePath)\nelse\nmyOpenFolder(myXcodePath() & \"\/DerivedData\/\")\nend if\nend myOpenDerivedDataFolder\n\non myOpenGitHub()\nset myPath to myProjectPath()\nset myConsoleOutput to (do shell script \"cd \" & quoted form of myPath & \"; git remote -v\")\nset myRemote to myGetRemote(myConsoleOutput)\nset myUrl to (do shell script \"cd \" & quoted form of myPath & \"; git config --get remote.\" & quoted form of myRemote & \".url\")\nopen location myUrl\nend myOpenGitHub\n\non myOpenDocument()\nset command1 to \"cd ~\/Library\/Developer\/CoreSimulator\/Devices\/;\"\nset command2 to \"cd `ls -t | head -n 1`\/data\/Containers\/Data\/Application;\"\nset command3 to \"cd `ls -t | head -n 1`\/Documents;\"\nset command4 to \"open .\"\ndo shell script command1 & command2 & command3 & command4\nend myOpenDocument\n\non myOpenAbout()\nopen location \"https:\/\/github.com\/onmyway133\/XcodeWay\"\nend myOpenAbout\n","new_contents":"use scripting additions\nuse framework \"Foundation\"\nproperty NSString : a reference to current application's NSString\n\n-- Helper\n\non myRemoveLastPath(myPath)\nset myString to NSString's stringWithString:myPath\nset removedLastPathString to myString's stringByDeletingLastPathComponent\nremovedLastPathString as text\nend myRemoveLastPath\n\non myFolderExists(myFolder) -- (String) as Boolean\ntell application \"System Events\"\nif exists folder myFolder then\nreturn true\nelse\nreturn false\nend if\nend tell\nend myFolderExists\n\non myRemoveSubString(oldString, subString)\nset myString to NSString's stringWithString:oldString\nset newString to myString's stringByReplacingOccurrencesOfString:subString withString:\"\"\nnewString as text\nend myRemoveSubString\n\non myGetRemote(myText)\nset myString to NSString's stringWithString:myText\nset myParts to myString's componentsSeparatedByString:\"\\t\"\nset myFirstParts to item 1 of myParts\nmyFirstParts as text\nend myGetRemote\n\n-- Path\n\non myHomePath()\ntell application \"System Events\"\n\"\/Users\/\" & (name of current user)\nend tell\nend myHomePath\n\non myLibraryPath()\nmyHomePath() & \"\/Library\"\nend myLibraryPath\n\non myXcodePath()\nmyLibraryPath() & \"\/Developer\/Xcode\"\nend myXcodePath\n\non myUserDataPath()\nmyXcodePath() & \"\/UserData\"\nend myUserDataPath\n\non myProjectPath()\ntell application \"Xcode\"\ntell active workspace document\nset myPath to path\nend tell\nend tell\nmyRemoveLastPath(myPath)\nend myProjectPath\n\non myCurrentFilePath()\ntell application \"Xcode\"\nset activeDocument to document 1 whose name ends with (word -1 of (get name of window 1))\npath of activeDocument\nend tell\nend myCurrentFilePath\n\n-- Generic Open\n\non myOpenFolder(myPath)\ntell application \"Finder\"\nactivate\nopen myPath as POSIX file\nend tell\nend myOpenFolder\n\non myOpeniTerm(myPath)\ntell application \"Finder\"\ndo shell script \"open -a iTerm \" & quoted form of myPath\nend tell\nend myOpeniTerm\n\n-- Open\n\non myOpenThemesFolder()\nset myPath to myUserDataPath() & \"\/FontAndColorThemes\/\"\nmyOpenFolder(myPath)\nend myOpenThemesFolder\n\non myOpenCodeSnippetsFolder()\nset myPath to myUserDataPath() & \"\/CodeSnippets\/\"\nmyOpenFolder(myPath)\nend myOpenCodeSnippetsFolder\n\non myOpenDeviceSupportFolder()\nset myPath to \"\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/DeviceSupport\"\nmyOpenFolder(myPath)\nend myOpenDeviceSupportFolder\n\non myOpenArchivesFolder()\nset myPath to myXcodePath() & \"\/Archives\/\"\nmyOpenFolder(myPath)\nend myOpenArchivesFolder\n\non myOpenProvisioningProfileFolder()\nset myPath to myLibraryPath() & \"\/MobileDevice\/Provisioning Profiles\"\nmyOpenFolder(myPath)\nend myOpenProvisioningProfileFolder\n\non myOpenProjectFolder()\nset myPath to myProjectPath()\nmyOpenFolder(myPath)\nend myOpenProjectFolder\n\non myOpeniTermForCurrentProject()\nset myPath to myProjectPath()\nmyOpeniTerm(myPath)\nend myOpeniTermForCurrentProject\n\non myOpenDerivedDataFolder()\nset myRelativePath to myProjectPath() & \"\/DerivedData\/\"\nif myFolderExists(myRelativePath) then\nmyOpenFolder(myRelativePath)\nelse\nmyOpenFolder(myXcodePath() & \"\/DerivedData\/\")\nend if\nend myOpenDerivedDataFolder\n\non myGitHubURL()\nset myPath to myProjectPath()\nset myConsoleOutput to (do shell script \"cd \" & quoted form of myPath & \"; git remote -v\")\nset myRemote to myGetRemote(myConsoleOutput)\nset myUrl to (do shell script \"cd \" & quoted form of myPath & \"; git config --get remote.\" & quoted form of myRemote & \".url\")\nset myUrlWithOutDotGit to myRemoveSubString(myUrl, \".git\")\nend myGitHubURL\n\non myOpenGitHub()\nset myUrl to myGitHubUrlOnMaster()\nopen location myUrl\nend myOpenGitHub\n\non myGitHubUrlOnMaster()\nset gitHubPath to myGitHubURL()\nset myUrl to gitHubPath & \"\/blob\/master\"\nend myGitHubUrlOnMaster\n\non myOpenFileInGitHub()\nset currentFilePath to myCurrentFilePath()\nset projectPath to myProjectPath()\nset gitHubPath to myGitHubUrlOnMaster()\nset relativePath to myRemoveSubString(currentFilePath, projectPath)\nset fullUrl to gitHubPath & relativePath\nopen location fullUrl\nend myOpenFileInGitHub\n\non myOpenDocument()\nset command1 to \"cd ~\/Library\/Developer\/CoreSimulator\/Devices\/;\"\nset command2 to \"cd `ls -t | head -n 1`\/data\/Containers\/Data\/Application;\"\nset command3 to \"cd `ls -t | head -n 1`\/Documents;\"\nset command4 to \"open .\"\ndo shell script command1 & command2 & command3 & command4\nend myOpenDocument\n\non myOpenAbout()\nopen location \"https:\/\/github.com\/onmyway133\/XcodeWay\"\nend myOpenAbout\n","subject":"Update script for open current document","message":"Update script for open current document\n","lang":"AppleScript","license":"mit","repos":"onmyway133\/XcodeWay,onmyway133\/XcodeWay"}
{"commit":"d47dca835ccb7345b9af35a2e38a5242d910f663","old_file":"src\/scripts\/clean-tabs.scpt","new_file":"src\/scripts\/clean-tabs.scpt","old_contents":"tell application \"Safari\"\n  repeat with t in tabs of windows\n    tell t\n      -- If you open lots of windows in Safari, some of this book-\n      -- keeping goes wrong.  It will try to look up tab N, except\n      -- tab N was already closed -- error!\n      --\n      -- For safety, we just catch and discard all errors.\n      {% for condition in conditionss %}\n      try\n        tell t\n          if (URL {{ condition}}) then close\n        end tell\n      end try\n      {% endfor %}\n    end tell\n  end repeat\nend tell\n","new_contents":"tell application \"Safari\"\n  repeat with t in tabs of windows\n    tell t\n      -- If you open lots of windows in Safari, some of this book-\n      -- keeping goes wrong.  It will try to look up tab N, except\n      -- tab N was already closed -- error!\n      --\n      -- For safety, we just catch and discard all errors.\n      {% for condition in conditions %}\n      try\n        tell t\n          if (URL {{ condition}}) then close\n        end tell\n      end try\n      {% endfor %}\n    end tell\n  end repeat\nend tell\n","subject":"Fix typo in script","message":"Fix typo in script\n","lang":"AppleScript","license":"mit","repos":"alexwlchan\/safari.rs,alexwlchan\/safari.rs"}
{"commit":"566f1b7b22da3a015ae12141c76d42c2424442d3","old_file":"recall.applescript","new_file":"recall.applescript","old_contents":"#!\/usr\/bin\/env osascript\n\nset journal to \"~\/ia\/Journal\/Journal.txt\"\ntell application \"Terminal\"\n\tset lineCount to (do shell script \"wc -l < \" & journal) as integer\n\tset randomLine to (random number from 1 to lineCount) as integer\n\tactivate\n\tdo script \"vim -c ':Goyo' -c ':set bg=light' \" & journal & \":\" & randomLine\n\tset current settings of first window to settings set \"Solarized Light\"\n\ttell application \"System Events\" to keystroke \"f\" using {command down, control down}\nend tell\n","new_contents":"#!\/usr\/bin\/env osascript\n\nset journal to \"~\/ia\/Journal\/Journal.txt\"\ntell application \"Terminal\"\n\tset lineCount to (do shell script \"wc -l < \" & journal) as integer\n\tset randomLine to (random number from 1 to lineCount) as integer\n\tactivate\n\tdo script \"vim -c ':Goyo | set bg=light | \" & randomLine & \"' \" & journal\n\tset current settings of first window to settings set \"Solarized Light\"\n\ttell application \"System Events\" to keystroke \"f\" using {command down, control down}\nend tell\n","subject":"Update recall script so it works with nvim","message":"Update recall script so it works with nvim\n","lang":"AppleScript","license":"mit","repos":"mk12\/scripts,mk12\/scripts,mk12\/scripts,mk12\/scripts"}
{"commit":"74d289ffc4a449e3d4d24d8dd925eff3d56f08bb","old_file":"keynote.applescript","new_file":"keynote.applescript","old_contents":"on newPresentation(themeName)\n\ttell application \"Keynote\"\n\t\tactivate\n\t\t-- FIXME: Make this selectable?\n\t\tset targetWidth to 1024 -- 1440 <-- higher resolution\n\t\tset targetHeight to 768 -- 1080 <-- higher resolution\n\n\t\tset props to {document theme:theme (themeName as string), width:targetWidth, height:targetHeight}\n\n\t\tset thisDocument to make new document with properties props\n\t\treturn name of thisDocument\n\tend tell\nend newPresentation\n\non openPresentation(posixPath)\n\ttell application \"Keynote\"\n\t\topen posixPath\n\tend tell\nend openPresentation\n\non savePresentation(docname, posixPath)\n\ttell application \"Keynote\"\n\t\tsave document named docname in POSIX file posixPath\n\tend tell\nend savePresentation\t\n\non createSlide(docname, masterSlideName)\n\ttry\n\t\ttell application \"Keynote\"\n\t\t\ttell document named docname\n\t\t\t\tset thisSlide to make new slide with properties {base slide:master slide masterSlideName}\n\t\t\tend tell\n\t  return thisSlide\n\t\tend tell\n\ton error\n\t\treturn 0\n\tend try\nend createSlide\n\non deleteAllSlides(docname)\n\ttell application \"Keynote\"\n\t\ttell document named docname to delete every slide\n\tend tell\nend deleteAllSlides\n\non finalize(docname)\n\ttell application \"Keynote\"\n\t\ttell document named docname to delete slide 1\n\tend tell\nend finalize\n\non themeMasters(docname)\n\t--\t  tell application \"Keynote\" to get the name of every master slide of thisDocument\n\ttell application \"Keynote\"\n\t\tset names to the name of every master slide of document named docname\n\t\treturn names\n\tend tell\nend themeMasters\n\non addImage(docname, filepath)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n  tell application \"Keynote\"\n\ttell document named docname\n\t\ttell the current slide\n\t\t\t\n\t\t\t-- TO REPLACE A PLACEHOLDER OR EXISTING IMAGE:\n\t\t\tset thisPlaceholderImageItem to image 1\n\t\t\t-- change the value of the \u201cfile name\u201d property of the image to be an HFS file reference to the replacement image file\n\t\tset macPath to POSIX file filepath as Unicode text\n\t\t\tset file name of thisPlaceholderImageItem to \u00ac\n\t\t\t\talias macPath\n\t\t\t\n\t\tend tell\n\tend tell\n  end tell\nend addImage\n\n\non addTitle(docname, thisSlideTitle)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n\ttell application \"Keynote\"\n\t\ttell document named docname\n\t\t\ttell the current slide\n\t\t\t\tif title showing is true then\n\t\t\t\t\tset the object text of the default title item to thisSlideTitle\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend tell\n\tend tell\nend addTitle\n\non addBody(docname, thisSlideBody)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n\ttell application \"Keynote\"\n\t\ttell document named docname\n\t\t\ttell the current slide\n\t\t\t\tif body showing is true then\n\t\t\t\t\tset the object text of the default body item to thisSlideBody\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend tell\n\tend tell\nend addTitle\n","new_contents":"on newPresentation(themeName)\n\ttell application \"Keynote\"\n\t\tactivate\n\t\t-- FIXME: Make this selectable?\n\t\tset targetWidth to 1024 -- 1440 <-- higher resolution\n\t\tset targetHeight to 768 -- 1080 <-- higher resolution\n\n\t\tset props to {document theme:theme (themeName as string), width:targetWidth, height:targetHeight}\n\n\t\tset thisDocument to make new document with properties props\n\t\treturn name of thisDocument\n\tend tell\nend newPresentation\n\non openPresentation(posixPath)\n\ttell application \"Keynote\"\n\t\topen posixPath\n\tend tell\nend openPresentation\n\non savePresentation(docname, posixPath)\n\ttell application \"Keynote\"\n\t\tsave document named docname in POSIX file posixPath\n\tend tell\nend savePresentation\t\n\non createSlide(docname, masterSlideName)\n\ttry\n\t\ttell application \"Keynote\"\n\t\t\ttell document named docname\n\t\t\t\tset thisSlide to make new slide with properties {base slide:master slide masterSlideName}\n\t\t\tend tell\n\t  return thisSlide\n\t\tend tell\n\ton error\n\t\treturn 0\n\tend try\nend createSlide\n\non deleteAllSlides(docname)\n\ttell application \"Keynote\"\n\t\ttell document named docname to delete every slide\n\tend tell\nend deleteAllSlides\n\non finalize(docname)\n\ttell application \"Keynote\"\n\t\ttell document named docname to delete slide 1\n\tend tell\nend finalize\n\non themeMasters(docname)\n\t--\t  tell application \"Keynote\" to get the name of every master slide of thisDocument\n\ttell application \"Keynote\"\n\t\tset names to the name of every master slide of document named docname\n\t\treturn names\n\tend tell\nend themeMasters\n\non addImage(docname, n, filepath)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n  tell application \"Keynote\"\n\ttell document named docname\n\t\ttell the current slide\n\t\t\t\n\t\t\t-- TO REPLACE A PLACEHOLDER OR EXISTING IMAGE:\n\t\t\tset thisPlaceholderImageItem to image n\n\t\t\t-- change the value of the \u201cfile name\u201d property of the image to be an HFS file reference to the replacement image file\n\t\tset macPath to POSIX file filepath as Unicode text\n\t\t\tset file name of thisPlaceholderImageItem to \u00ac\n\t\t\t\talias macPath\n\t\t\t\n\t\tend tell\n\tend tell\n  end tell\nend addImage\n\n\non addTitle(docname, thisSlideTitle)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n\ttell application \"Keynote\"\n\t\ttell document named docname\n\t\t\ttell the current slide\n\t\t\t\tif title showing is true then\n\t\t\t\t\tset the object text of the default title item to thisSlideTitle\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend tell\n\tend tell\nend addTitle\n\non addBody(docname, thisSlideBody)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n\ttell application \"Keynote\"\n\t\ttell document named docname\n\t\t\ttell the current slide\n\t\t\t\tif body showing is true then\n\t\t\t\t\tset the object text of the default body item to thisSlideBody\n\t\t\t\tend if\n\t\t\tend tell\n\t\tend tell\n\tend tell\nend addTitle\n","subject":"Select placeholder for images","message":"Select placeholder for images\n","lang":"AppleScript","license":"mit","repos":"persquare\/md2keynote"}
{"commit":"7b92e27d1f01f22ded69d30d1f5438fd033005da","old_file":"connector-osx-ppt.scpt","new_file":"connector-osx-ppt.scpt","old_contents":"--\n--  slideshow -- Observe and Control Slideshow Applications\n--  Copyright (c) 2014 Ralf S. Engelschall <http:\/\/engelschall.com>\n--\n--  This Source Code Form is subject to the terms of the Mozilla Public\n--  License (MPL), version 2.0. If a copy of the MPL was not distributed\n--  with this file, You can obtain one at http:\/\/mozilla.org\/MPL\/2.0\/.\n--\n--  File:     connector-osx-ppt.js\n--  Purpose:  connector engine for Microsoft PowerPoint under Mac OS X\n--  Language: AppleScript\n--\n\n--  utility function\non filterText(this_text, allowed_chars)\n   set new_text to \"\"\n   repeat with this_char in this_text\n       set x to the offset of this_char in allowed_chars\n       if x is not 0 then\n           set new_text to (new_text & this_char) as string\n       end if\n   end repeat\n   return new_text\nend filterText\n\n--  utility function\non replaceText(this_text, search_string, replacement_string)\n   set AppleScript's text item delimiters to the search_string\n   set the item_list to every text item of this_text\n   set AppleScript's text item delimiters to the replacement_string\n   set this_text to the item_list as string\n   set AppleScript's text item delimiters to \"\"\n   return this_text\nend replace_chars\n\n--  utility function\non asciiCharset()\n    set charset to \" \\\"'!#$%()*+,-.\/:;<=>?@[\\\\]^_{|}~\"\n    set charset to (charset & \"0123456789\")\n    set charset to (charset & \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\")\n    set charset to (charset & \"abcdefghijklmnopqrstuvwxyz\")\n    return charset\nend asciiCharset\n\n--  get application state\non is_running(appName)\n    tell application \"System Events\" to (name of processes) contains appName\nend is_running\non pptGetState()\n    set state to \"closed\"\n    if is_running(\"Microsoft PowerPoint\") then\n       try\n            set state to \"running\"\n            tell application \"Microsoft PowerPoint\"\n                set theState to (slide state of slide show view of slide show window of active presentation)\n                if theState is (slide show state running) or theState is (slide show state paused) then\n                    set state to \"viewing\"\n                else if (exists active presentation) then\n                    set state to \"editing\"\n                end if\n            end tell\n        on error errMsg\n        end try\n    end if\n    return state\nend pptGetState\n\n--  get current slide\non pptGetCurSlide()\n    try\n        tell application \"Microsoft PowerPoint\"\n            if slide state of slide show view of slide show window of active presentation is slide show state running then\n                --  currently in running slide show mode (for production)\n                set curSlide to (slide number of slide of slide show view of slide show window of active presentation)\n            else\n                --  currently in editing mode (for testing)\n                set curSlide to (slide number of slide range of selection of document window 1)\n            end if\n            return curSlide\n        end tell\n    on error errMsg\n        return 0\n    end try\nend pptGetCurSlide\n\n--  get maximum slide\non pptGetMaxSlide()\n    try\n        tell application \"Microsoft PowerPoint\"\n            set maxSlide to (get count of slides of presentation of document window 1)\n            return maxSlide\n        end tell\n    on error errMsg\n        return 0\n    end try\nend pptGetMaxSlide\n\n--  the STATE command\non cmdSTATE()\n    set state to pptGetState()\n    if state is \"closed\" then\n        set position to 0\n        set slides to 0\n    else\n        set position to pptGetCurSlide()\n        set slides to pptGetMaxSlide()\n    end if\n    return (\"{ \\\"response\\\": { \" & \u00ac\n        \"\\\"state\\\": \\\"\" & state & \"\\\", \" & \u00ac\n        \"\\\"position\\\": \" & position & \", \" & \u00ac\n        \"\\\"slides\\\": \" & slides & \" \" & \u00ac\n    \"} }\")\nend cmdSTATE\n\n--  the INFO command\non cmdINFO()\n    set output to \"\"\n    if pptGetMaxSlide() is 0 then\n        error \"still no active presentation\"\n    end if\n    tell application \"Microsoft PowerPoint\"\n        set thePresentation to presentation of document window 1\n        set theTitles to \"\"\n        set theNotes to \"\"\n        set slideCount to (get count of slides of thePresentation)\n        repeat with slideNum from 1 to slideCount\n            set theSlide to slide slideNum of thePresentation\n\n            set theTitle to \"\"\n            repeat with t_shape in (get shapes of theSlide)\n                set aType to (placeholder type of t_shape)\n                if (aType is placeholder type center title placeholder) or (aType is placeholder type title placeholder) then\n                    tell t_shape to if has text frame then tell its text frame to if has text then\n                        set theText to (content of its text range as string) as string\n                        set theText to (my filterText(theText, my asciiCharset()))\n                        if theTitle is not \"\" then\n                            set theTitle to (theTitle & \" \")\n                        end if\n                        set theTitle to (theTitle & theText)\n                    end if\n                end if\n            end repeat\n            if theTitles is not \"\" then\n                set theTitles to (theTitles & \", \")\n            end if\n            set theTitles to (theTitles & \"\\\"\" & (my replaceText(theTitle, \"\\\"\", \"\\\\\\\"\")) & \"\\\"\")\n\n            set theNote to \"\"\n            repeat with t_shape in (get shapes of notes page of theSlide)\n                set aType to (placeholder type of t_shape)\n                if (aType is placeholder type body placeholder) then\n                    tell t_shape to if has text frame then tell its text frame to if has text then\n                        set theText to (content of its text range as string) as string\n                        set theText to (my filterText(theText, my asciiCharset()))\n                        if theNote is not \"\" then\n                            set theNote to (theNote & \" \")\n                        end if\n                        set theNote to (theNote & theText)\n                    end if\n                end if\n            end repeat\n            if theNotes is not \"\" then\n                set theNotes to (theNotes & \", \")\n            end if\n            set theNotes to (theNotes & \"\\\"\" & (my replaceText(theNote, \"\\\"\", \"\\\\\\\"\")) & \"\\\"\")\n\n        end repeat\n        set theTitles to (\"[ \" & theTitles & \" ]\")\n        set theNotes to (\"[ \" & theNotes & \" ]\")\n        set output to (\"{ \\\"response\\\": { \\\"titles\\\": \" & theTitles & \", \\\"notes\\\": \" & theNotes & \" } }\")\n    end tell\n    return output\nend cmdINFO\n\n--  the control commands\non cmdCTRL(command, arg)\n    set state to pptGetState()\n    if command is \"BOOT\" then\n        if state is not \"closed\" then\n            error \"application already running\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            activate\n        end tell\n    else if command is \"QUIT\" then\n        if state is \"closed\" then\n            error \"application already closed\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            quit\n        end tell\n    else if command is \"OPEN\" then\n        if state is \"editing\" or state is \"viewing\" then\n            error \"active presentation already existing\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            tell application \"Finder\" to set thePath to \u00ac\n                POSIX file (POSIX path of (container of (path to me) as string) & (arg)) as alias\n            open thePath\n        end tell\n    else if command is \"CLOSE\" then\n        if state is \"closed\" or state is \"running\" then\n            error \"still no active presentation\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            close active presentation\n        end tell\n    else if command is \"START\" then\n        if state is \"closed\" or state is \"running\" then\n            error \"still no active presentation\"\n        end if\n        if state is \"viewing\" then\n            error \"active presentation already viewing\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            set slideShowSettings to slide show settings of active presentation\n            set slideShowSettings's starting slide to 1\n            set slideShowSettings's ending slide to 1\n            set slideShowSettings's range type to slide show range\n            set slideShowSettings's show type to slide show type speaker\n            set slideShowSettings's advance mode to slide show advance manual advance\n            run slide show slideShowSettings -- BUGGY: starts blank\n        end tell\n    else if command is \"STOP\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            exit slide show (slideshow view of slide show window 1)\n        end tell\n    else if command is \"BLACK\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            set slide state of (slideshow view of slide show window 1) to (slide show state black screen)\n        end tell\n    else if command is \"NORMAL\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            -- set slide state of (slideshow view of slide show window 1) to (slide show state paused)\n            go to slide (view of document window 1) number \u00ac\n                (slide number of slide of slide show view of slide show window of active presentation)\n        end tell\n    else if command is \"FIRST\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            go to first slide (slideshow view of slide show window 1)\n        end tell\n    else if command is \"LAST\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            go to last slide (slideshow view of slide show window 1)\n        end tell\n    else if command is \"GOTO\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            go to slide (view of document window 1) number (arg as integer) -- BUGGY: does not do anything\n        end tell\n    else if command is \"PREV\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            go to previous slide (slideshow view of slide show window 1)\n        end tell\n    else if command is \"NEXT\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            go to next slide (slideshow view of slide show window 1)\n        end tell\n    end if\n    return \"{ \\\"result\\\": \\\"OK\\\" }\"\nend cmdCTRL\n\n--  main procedure\non run argv\n    set cmd to item 1 of argv\n    set arg to \"\"\n    if count of argv is 2 then\n        set arg to item 2 of argv\n    end if\n    try\n        if cmd is \"STAT\" then\n            set output to cmdSTATE()\n        else if cmd is \"INFO\" then\n            set output to cmdINFO()\n        else if cmd is \"BOOT\" \u00ac\n            or cmd is \"QUIT\" \u00ac\n            or cmd is \"OPEN\" \u00ac\n            or cmd is \"CLOSE\" \u00ac\n            or cmd is \"START\" \u00ac\n            or cmd is \"STOP\" \u00ac\n            or cmd is \"BLACK\" \u00ac\n            or cmd is \"NORMAL\" \u00ac\n            or cmd is \"FIRST\" \u00ac\n            or cmd is \"LAST\" \u00ac\n            or cmd is \"GOTO\" \u00ac\n            or cmd is \"PREV\" \u00ac\n            or cmd is \"NEXT\" then\n            set output to cmdCTRL(cmd, arg)\n        else\n            set output to \"{ \\\"error\\\": \\\"invalid command\\\" }\"\n        end if\n    on error errMsg\n        set output to (\"{ \\\"error\\\": \\\"\" & errMsg & \"\\\" }\")\n    end try\n    copy output to stdout\nend run\n\n","new_contents":"--\n--  slideshow -- Observe and Control Slideshow Applications\n--  Copyright (c) 2014 Ralf S. Engelschall <http:\/\/engelschall.com>\n--\n--  This Source Code Form is subject to the terms of the Mozilla Public\n--  License (MPL), version 2.0. If a copy of the MPL was not distributed\n--  with this file, You can obtain one at http:\/\/mozilla.org\/MPL\/2.0\/.\n--\n--  File:     connector-osx-ppt.js\n--  Purpose:  connector engine for Microsoft PowerPoint under Mac OS X\n--  Language: AppleScript\n--\n\n--  utility function\non filterText(this_text, allowed_chars)\n   set new_text to \"\"\n   repeat with this_char in this_text\n       set x to the offset of this_char in allowed_chars\n       if x is not 0 then\n           set new_text to (new_text & this_char) as string\n       end if\n   end repeat\n   return new_text\nend filterText\n\n--  utility function\non replaceText(this_text, search_string, replacement_string)\n   set AppleScript's text item delimiters to the search_string\n   set the item_list to every text item of this_text\n   set AppleScript's text item delimiters to the replacement_string\n   set this_text to the item_list as string\n   set AppleScript's text item delimiters to \"\"\n   return this_text\nend replace_chars\n\n--  utility function\non asciiCharset()\n    set charset to \" \\\"'!#$%()*+,-.\/:;<=>?@[\\\\]^_{|}~\"\n    set charset to (charset & \"0123456789\")\n    set charset to (charset & \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\")\n    set charset to (charset & \"abcdefghijklmnopqrstuvwxyz\")\n    return charset\nend asciiCharset\n\n--  get application state\non pptGetState()\n    set state to \"closed\"\n    tell application \"System Events\"\n        set is_running to (exists (some process whose name is \"Microsoft PowerPoint\"))\n    end tell\n    if is_running then\n       try\n            set state to \"running\"\n            tell application \"Microsoft PowerPoint\"\n                set theState to (slide state of slide show view of slide show window of active presentation)\n                if theState is (slide show state running) or theState is (slide show state paused) then\n                    set state to \"viewing\"\n                else if (exists active presentation) then\n                    set state to \"editing\"\n                end if\n            end tell\n        on error errMsg\n        end try\n    end if\n    return state\nend pptGetState\n\n--  get current slide\non pptGetCurSlide()\n    try\n        tell application \"Microsoft PowerPoint\"\n            if slide state of slide show view of slide show window of active presentation is slide show state running then\n                --  currently in running slide show mode (for production)\n                set curSlide to (slide number of slide of slide show view of slide show window of active presentation)\n            else\n                --  currently in editing mode (for testing)\n                set curSlide to (slide number of slide range of selection of document window 1)\n            end if\n            return curSlide\n        end tell\n    on error errMsg\n        return 0\n    end try\nend pptGetCurSlide\n\n--  get maximum slide\non pptGetMaxSlide()\n    try\n        tell application \"Microsoft PowerPoint\"\n            set maxSlide to (get count of slides of presentation of document window 1)\n            return maxSlide\n        end tell\n    on error errMsg\n        return 0\n    end try\nend pptGetMaxSlide\n\n--  the STATE command\non cmdSTATE()\n    set state to pptGetState()\n    if state is \"closed\" then\n        set position to 0\n        set slides to 0\n    else\n        set position to pptGetCurSlide()\n        set slides to pptGetMaxSlide()\n    end if\n    return (\"{ \\\"response\\\": { \" & \u00ac\n        \"\\\"state\\\": \\\"\" & state & \"\\\", \" & \u00ac\n        \"\\\"position\\\": \" & position & \", \" & \u00ac\n        \"\\\"slides\\\": \" & slides & \" \" & \u00ac\n    \"} }\")\nend cmdSTATE\n\n--  the INFO command\non cmdINFO()\n    set output to \"\"\n    if pptGetMaxSlide() is 0 then\n        error \"still no active presentation\"\n    end if\n    tell application \"Microsoft PowerPoint\"\n        set thePresentation to presentation of document window 1\n        set theTitles to \"\"\n        set theNotes to \"\"\n        set slideCount to (get count of slides of thePresentation)\n        repeat with slideNum from 1 to slideCount\n            set theSlide to slide slideNum of thePresentation\n\n            set theTitle to \"\"\n            repeat with t_shape in (get shapes of theSlide)\n                set aType to (placeholder type of t_shape)\n                if (aType is placeholder type center title placeholder) or (aType is placeholder type title placeholder) then\n                    tell t_shape to if has text frame then tell its text frame to if has text then\n                        set theText to (content of its text range as string) as string\n                        set theText to (my filterText(theText, my asciiCharset()))\n                        if theTitle is not \"\" then\n                            set theTitle to (theTitle & \" \")\n                        end if\n                        set theTitle to (theTitle & theText)\n                    end if\n                end if\n            end repeat\n            if theTitles is not \"\" then\n                set theTitles to (theTitles & \", \")\n            end if\n            set theTitles to (theTitles & \"\\\"\" & (my replaceText(theTitle, \"\\\"\", \"\\\\\\\"\")) & \"\\\"\")\n\n            set theNote to \"\"\n            repeat with t_shape in (get shapes of notes page of theSlide)\n                set aType to (placeholder type of t_shape)\n                if (aType is placeholder type body placeholder) then\n                    tell t_shape to if has text frame then tell its text frame to if has text then\n                        set theText to (content of its text range as string) as string\n                        set theText to (my filterText(theText, my asciiCharset()))\n                        if theNote is not \"\" then\n                            set theNote to (theNote & \" \")\n                        end if\n                        set theNote to (theNote & theText)\n                    end if\n                end if\n            end repeat\n            if theNotes is not \"\" then\n                set theNotes to (theNotes & \", \")\n            end if\n            set theNotes to (theNotes & \"\\\"\" & (my replaceText(theNote, \"\\\"\", \"\\\\\\\"\")) & \"\\\"\")\n\n        end repeat\n        set theTitles to (\"[ \" & theTitles & \" ]\")\n        set theNotes to (\"[ \" & theNotes & \" ]\")\n        set output to (\"{ \\\"response\\\": { \\\"titles\\\": \" & theTitles & \", \\\"notes\\\": \" & theNotes & \" } }\")\n    end tell\n    return output\nend cmdINFO\n\n--  the control commands\non cmdCTRL(command, arg)\n    set state to pptGetState()\n    if command is \"BOOT\" then\n        if state is not \"closed\" then\n            error \"application already running\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            activate\n        end tell\n    else if command is \"QUIT\" then\n        if state is \"closed\" then\n            error \"application already closed\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            quit\n        end tell\n    else if command is \"OPEN\" then\n        if state is \"editing\" or state is \"viewing\" then\n            error \"active presentation already existing\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            tell application \"Finder\" to set thePath to \u00ac\n                POSIX file (POSIX path of (container of (path to me) as string) & (arg)) as alias\n            open thePath\n        end tell\n    else if command is \"CLOSE\" then\n        if state is \"closed\" or state is \"running\" then\n            error \"still no active presentation\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            close active presentation\n        end tell\n    else if command is \"START\" then\n        if state is \"closed\" or state is \"running\" then\n            error \"still no active presentation\"\n        end if\n        if state is \"viewing\" then\n            error \"active presentation already viewing\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            set slideShowSettings to slide show settings of active presentation\n            set slideShowSettings's starting slide to 1\n            set slideShowSettings's ending slide to 1\n            set slideShowSettings's range type to slide show range\n            set slideShowSettings's show type to slide show type speaker\n            set slideShowSettings's advance mode to slide show advance manual advance\n            run slide show slideShowSettings -- BUGGY: starts blank\n        end tell\n    else if command is \"STOP\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            exit slide show (slideshow view of slide show window 1)\n        end tell\n    else if command is \"BLACK\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            set slide state of (slideshow view of slide show window 1) to (slide show state black screen)\n        end tell\n    else if command is \"NORMAL\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            -- set slide state of (slideshow view of slide show window 1) to (slide show state paused)\n            go to slide (view of document window 1) number \u00ac\n                (slide number of slide of slide show view of slide show window of active presentation)\n        end tell\n    else if command is \"FIRST\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            go to first slide (slideshow view of slide show window 1)\n        end tell\n    else if command is \"LAST\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            go to last slide (slideshow view of slide show window 1)\n        end tell\n    else if command is \"GOTO\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            go to slide (view of document window 1) number (arg as integer) -- BUGGY: does not do anything\n        end tell\n    else if command is \"PREV\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            go to previous slide (slideshow view of slide show window 1)\n        end tell\n    else if command is \"NEXT\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Microsoft PowerPoint\"\n            go to next slide (slideshow view of slide show window 1)\n        end tell\n    end if\n    return \"{ \\\"result\\\": \\\"OK\\\" }\"\nend cmdCTRL\n\n--  main procedure\non run argv\n    set cmd to item 1 of argv\n    set arg to \"\"\n    if count of argv is 2 then\n        set arg to item 2 of argv\n    end if\n    try\n        if cmd is \"STAT\" then\n            set output to cmdSTATE()\n        else if cmd is \"INFO\" then\n            set output to cmdINFO()\n        else if cmd is \"BOOT\" \u00ac\n            or cmd is \"QUIT\" \u00ac\n            or cmd is \"OPEN\" \u00ac\n            or cmd is \"CLOSE\" \u00ac\n            or cmd is \"START\" \u00ac\n            or cmd is \"STOP\" \u00ac\n            or cmd is \"BLACK\" \u00ac\n            or cmd is \"NORMAL\" \u00ac\n            or cmd is \"FIRST\" \u00ac\n            or cmd is \"LAST\" \u00ac\n            or cmd is \"GOTO\" \u00ac\n            or cmd is \"PREV\" \u00ac\n            or cmd is \"NEXT\" then\n            set output to cmdCTRL(cmd, arg)\n        else\n            set output to \"{ \\\"error\\\": \\\"invalid command\\\" }\"\n        end if\n    on error errMsg\n        set output to (\"{ \\\"error\\\": \\\"\" & errMsg & \"\\\" }\")\n    end try\n    copy output to stdout\nend run\n\n","subject":"simplify the process check","message":"simplify the process check\n","lang":"AppleScript","license":"mpl-2.0","repos":"rse\/slideshow,rse\/slideshow"}
{"commit":"e6fd026f91307fc75f35c93c7298b45fa3dad5a9","old_file":"tools\/openBrowser\/openChrome.applescript","new_file":"tools\/openBrowser\/openChrome.applescript","old_contents":"(*\nCopyright (c) 2015-present, Facebook, Inc.\nAll rights reserved.\n\nThis source code is licensed under the BSD-style license found in the\n-- LICENSE file in the root directory of this source tree. An additional grant\nof patent rights can be found in the PATENTS file in the same directory.\n*)\n\non run argv\n  set theURL to item 1 of argv\n\n  tell application \"Chrome\"\n\n    if (count every window) = 0 then\n      make new window\n    end if\n\n    -- Find a tab currently running the debugger\n    set found to false\n    set theTabIndex to -1\n    repeat with theWindow in every window\n      set theTabIndex to 0\n      repeat with theTab in every tab of theWindow\n        set theTabIndex to theTabIndex + 1\n        if theTab's URL is theURL then\n          set found to true\n          exit repeat\n        end if\n      end repeat\n\n      if found then\n        exit repeat\n      end if\n    end repeat\n\n    if found then\n      tell theTab to reload\n      set index of theWindow to 1\n      set theWindow's active tab index to theTabIndex\n    else\n      tell window 1\n        activate\n        make new tab with properties {URL:theURL}\n      end tell\n    end if\n  end tell\nend run\n","new_contents":"(*\nCopyright (c) 2015-present, Facebook, Inc.\nAll rights reserved.\n\nThis source code is licensed under the BSD-style license found in the\n-- LICENSE file in the root directory of this source tree. An additional grant\nof patent rights can be found in the PATENTS file in the same directory.\n*)\n\nproperty targetTab: null\nproperty targetTabIndex: -1\nproperty targetWindow: null\n\non run argv\n  set theURL to item 1 of argv\n\n  tell application \"Chrome\"\n\n    if (count every window) = 0 then\n      make new window\n    end if\n\n    -- 1: Looking for tab running debugger\n    -- then, Reload debugging tab if found\n    -- then return\n    set found to my lookupTabWithUrl(theURL)\n    if found then\n      set targetWindow's active tab index to targetTabIndex\n      tell targetTab to reload\n      tell targetWindow to activate\n      set index of targetWindow to 1\n      return\n    end if\n\n    -- 2: Looking for Empty tab\n    -- In case debugging tab was not found\n    -- We try to find an empty tab instead\n    set found to my lookupTabWithUrl(\"chrome:\/\/newtab\/\")\n    if found then\n      set targetWindow's active tab index to targetTabIndex\n      set URL of targetTab to theURL\n      tell targetWindow to activate\n      return\n    end if\n\n    -- 3: Create new tab\n    -- both debugging and empty tab were not found\n    -- make a new tab with url\n    tell window 1\n      activate\n      make new tab with properties {URL:theURL}\n    end tell\n  end tell\nend run\n\n-- Function:\n-- Lookup tab with given url\n-- if found, store tab, index, and window in properties\n-- (properties were declared on top of file)\non lookupTabWithUrl(lookupUrl)\n  tell application \"Chrome\"\n    -- Find a tab with the given url\n    set found to false\n    set theTabIndex to -1\n    repeat with theWindow in every window\n      set theTabIndex to 0\n      repeat with theTab in every tab of theWindow\n        set theTabIndex to theTabIndex + 1\n        if (theTab's URL as string) contains lookupUrl then\n          -- assign tab, tab index, and window to properties\n          set targetTab to theTab\n          set targetTabIndex to theTabIndex\n          set targetWindow to theWindow\n          set found to true\n          exit repeat\n        end if\n      end repeat\n\n      if found then\n        exit repeat\n      end if\n    end repeat\n  end tell\n  return found\nend lookupTabWithUrl\n","subject":"Upgrade apple script","message":"Upgrade apple script\n","lang":"AppleScript","license":"mit","repos":"wellyshen\/react-cool-starter,wellyshen\/react-cool-starter,zolcman\/calendartest,wellyshen\/react-cool-starter"}
{"commit":"dd9a51a9f691b4adf1334efc2334e1930ef6877d","old_file":"XcodeWayExtensions\/Script\/XcodeWayScript.scpt","new_file":"XcodeWayExtensions\/Script\/XcodeWayScript.scpt","old_contents":"use scripting additions\nuse framework \"Foundation\"\nproperty NSString : a reference to current application's NSString\n\n-- Helper\n\non myRemoveLastPath(myPath)\nset myString to NSString's stringWithString:myPath\nset removedLastPathString to myString's stringByDeletingLastPathComponent\nremovedLastPathString as text\nend myRemoveLastPath\n\non myFolderExists(myFolder) -- (String) as Boolean\ntell application \"System Events\"\nif exists folder myFolder then\nreturn true\nelse\nreturn false\nend if\nend tell\nend myFolderExists\n\n-- Path\n\non myHomePath()\ntell application \"System Events\"\n\"\/Users\/\" & (name of current user)\nend tell\nend myHomePath\n\non myLibraryPath()\nmyHomePath() & \"\/Library\"\nend myLibraryPath\n\non myXcodePath()\nmyLibraryPath() & \"\/Developer\/Xcode\"\nend myXcodePath\n\non myUserDataPath()\nmyXcodePath() & \"\/UserData\"\nend myUserDataPath\n\non myProjectPath()\ntell application \"Xcode\"\ntell active workspace document\nset myPath to path\nend tell\nend tell\nmyRemoveLastPath(myPath)\nend myProjectPath\n\n-- Generic Open\n\non myOpenFolder(myPath)\ntell application \"Finder\"\nactivate\nopen myPath as POSIX file\nend tell\nend myOpenFolder\n\non myOpeniTerm(myPath)\ntell application \"Finder\"\ndo shell script \"open -a iTerm \" & quoted form of myPath\nend tell\nend myOpeniTerm\n\n-- Open\n\non myOpenThemesFolder()\nset myPath to myUserDataPath() & \"\/FontAndColorThemes\/\"\nmyOpenFolder(myPath)\nend myOpenThemesFolder\n\non myOpenCodeSnippetsFolder()\nset myPath to myUserDataPath() & \"\/CodeSnippets\/\"\nmyOpenFolder(myPath)\nend myOpenCodeSnippetsFolder\n\non myOpenDeviceSupportFolder()\nset myPath to \"\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/DeviceSupport\"\nmyOpenFolder(myPath)\nend myOpenDeviceSupportFolder\n\non myOpenArchivesFolder()\nset myPath to myXcodePath() & \"\/Archives\/\"\nmyOpenFolder(myPath)\nend myOpenArchivesFolder\n\non myOpenProvisioningProfileFolder()\nset myPath to myLibraryPath() & \"\/MobileDevice\/Provisioning Profiles\"\nmyOpenFolder(myPath)\nend myOpenProvisioningProfileFolder\n\non myOpenProjectFolder()\nset myPath to myProjectPath()\nmyOpenFolder(myPath)\nend myOpenProjectFolder\n\non myOpeniTermForCurrentProject()\nset myPath to myProjectPath()\nmyOpeniTerm(myPath)\nend myOpeniTermForCurrentProject\n\non myOpenDerivedDataFolder()\nset myRelativePath to myProjectPath() & \"\/DerivedData\/\"\nif myFolderExists(myRelativePath) then\nmyOpenFolder(myRelativePath)\nelse\nmyOpenFolder(myXcodePath() & \"\/DerivedData\/\")\nend if\nend myOpenDerivedDataFolder\n\non myOpenGitHub()\nset myUrl to (do shell script \"cd \/Users\/khoa\/XcodeProject2\/XcodeWay; git config --get remote.origin.url\")\nend myOpenGitHub\n","new_contents":"use scripting additions\nuse framework \"Foundation\"\nproperty NSString : a reference to current application's NSString\n\n-- Helper\n\non myRemoveLastPath(myPath)\nset myString to NSString's stringWithString:myPath\nset removedLastPathString to myString's stringByDeletingLastPathComponent\nremovedLastPathString as text\nend myRemoveLastPath\n\non myFolderExists(myFolder) -- (String) as Boolean\ntell application \"System Events\"\nif exists folder myFolder then\nreturn true\nelse\nreturn false\nend if\nend tell\nend myFolderExists\n\n-- Path\n\non myHomePath()\ntell application \"System Events\"\n\"\/Users\/\" & (name of current user)\nend tell\nend myHomePath\n\non myLibraryPath()\nmyHomePath() & \"\/Library\"\nend myLibraryPath\n\non myXcodePath()\nmyLibraryPath() & \"\/Developer\/Xcode\"\nend myXcodePath\n\non myUserDataPath()\nmyXcodePath() & \"\/UserData\"\nend myUserDataPath\n\non myProjectPath()\ntell application \"Xcode\"\ntell active workspace document\nset myPath to path\nend tell\nend tell\nmyRemoveLastPath(myPath)\nend myProjectPath\n\n-- Generic Open\n\non myOpenFolder(myPath)\ntell application \"Finder\"\nactivate\nopen myPath as POSIX file\nend tell\nend myOpenFolder\n\non myOpeniTerm(myPath)\ntell application \"Finder\"\ndo shell script \"open -a iTerm \" & quoted form of myPath\nend tell\nend myOpeniTerm\n\n-- Open\n\non myOpenThemesFolder()\nset myPath to myUserDataPath() & \"\/FontAndColorThemes\/\"\nmyOpenFolder(myPath)\nend myOpenThemesFolder\n\non myOpenCodeSnippetsFolder()\nset myPath to myUserDataPath() & \"\/CodeSnippets\/\"\nmyOpenFolder(myPath)\nend myOpenCodeSnippetsFolder\n\non myOpenDeviceSupportFolder()\nset myPath to \"\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/DeviceSupport\"\nmyOpenFolder(myPath)\nend myOpenDeviceSupportFolder\n\non myOpenArchivesFolder()\nset myPath to myXcodePath() & \"\/Archives\/\"\nmyOpenFolder(myPath)\nend myOpenArchivesFolder\n\non myOpenProvisioningProfileFolder()\nset myPath to myLibraryPath() & \"\/MobileDevice\/Provisioning Profiles\"\nmyOpenFolder(myPath)\nend myOpenProvisioningProfileFolder\n\non myOpenProjectFolder()\nset myPath to myProjectPath()\nmyOpenFolder(myPath)\nend myOpenProjectFolder\n\non myOpeniTermForCurrentProject()\nset myPath to myProjectPath()\nmyOpeniTerm(myPath)\nend myOpeniTermForCurrentProject\n\non myOpenDerivedDataFolder()\nset myRelativePath to myProjectPath() & \"\/DerivedData\/\"\nif myFolderExists(myRelativePath) then\nmyOpenFolder(myRelativePath)\nelse\nmyOpenFolder(myXcodePath() & \"\/DerivedData\/\")\nend if\nend myOpenDerivedDataFolder\n\non myOpenGitHub()\nset myPath to myProjectPath()\nset myUrl to (do shell script \"cd \" & quoted form of myPath & \"; git config --get remote.origin.url\")\nopen location myUrl\nend myOpenGitHub\n","subject":"Fix myOpenGitHub","message":"Fix myOpenGitHub\n","lang":"AppleScript","license":"mit","repos":"onmyway133\/XcodeWay,onmyway133\/XcodeWay"}
{"commit":"5fffed4f40de82d1f1a07ad11b3ba3312a82191a","old_file":"AppleScript\/Safari-OpenAllStarredArticles.applescript","new_file":"AppleScript\/Safari-OpenAllStarredArticles.applescript","old_contents":"-- This script creates a new Safari window with all the starred articles in a NetNewsWire instance, each in its own tab\n\n-- declare the safariWindow property here so we can use is throughout the whole script\n\nproperty safariWindow : missing value\n\n-- the openTabInSafari() function opens a new tab in the appropriate window\n\nto openTabInSafari(theUrl)\n\ttell application \"Safari\"\n\t\t-- test if this is the first call to openTabInSafari()\n\t\tif (my safariWindow is missing value) then\n\t\t\t-- first time through, make a new window with the given url in the only tab\n\t\t\tset newdoc to make new document at front with properties {URL:theUrl}\n\t\t\t-- because we created the doucument \"at front\", we know it is window 1\n\t\t\tset safariWindow to window 1\n\t\telse\n\t\t\t-- after the first time, make a new tab in the wndow we created the first tim\n\t\t\ttell safariWindow\n\t\t\t\tmake new tab with properties {URL:theUrl}\n\t\t\tend tell\n\t\tend if\n\tend tell\nend openTabInSafari\n\n\n-- the script starts here\n-- First, initialize safariWindow to be missing value, so that the first time through \n-- openTabInSafari() we'll make a new window to hold all our articles\n\nset safariWindow to missing value\n\n\n-- Then we loop though all the feeds of all the accounts\n-- for each feed, we find all the starred articles\n--for each one of those, open a new tab in Safari\n\ntell application \"NetNewsWire\"\n\tset allAccounts to every account\n\trepeat with nthAccount in allAccounts\n    set userFeeds to allFeeds of nthAccount\n\t\trepeat with nthFeed in userFeeds\n\t\t\tset starredArticles to (get every article of nthFeed where starred is true)\n\t\t\trepeat with nthArticle in starredArticles\n\t\t\t\tmy openTabInSafari(url of nthArticle)\n\t\t\tend repeat\n\t\tend repeat\n\tend repeat\nend tell\n","new_contents":"-- This script creates a new Safari window with all the starred articles in a NetNewsWire instance, each in its own tab\n\n-- declare the safariWindow property here so we can use is throughout the whole script\n\nproperty safariWindow : missing value\n\n-- the openTabInSafari() function opens a new tab in the appropriate window\n\nto openTabInSafari(theUrl)\n\ttell application \"Safari\"\n\t\t-- test if this is the first call to openTabInSafari()\n\t\tif (my safariWindow is missing value) then\n\t\t\t-- first time through, make a new window with the given url in the only tab\n\t\t\tset newdoc to make new document at front with properties {URL:theUrl}\n\t\t\t-- because we created the doucument \"at front\", we know it is window 1\n\t\t\tset safariWindow to window 1\n\t\telse\n\t\t\t-- after the first time, make a new tab in the wndow we created the first tim\n\t\t\ttell safariWindow\n\t\t\t\tmake new tab with properties {URL:theUrl}\n\t\t\tend tell\n\t\tend if\n\tend tell\nend openTabInSafari\n\n\n-- the script starts here\n-- First, initialize safariWindow to be missing value, so that the first time through \n-- openTabInSafari() we'll make a new window to hold all our articles\n\nset safariWindow to missing value\n\n\n-- Then we loop though all the feeds of all the accounts\n-- for each feed, we find all the starred articles\n--for each one of those, open a new tab in Safari\n\ntell application \"NetNewsWire\"\n\tset allAccounts to every account\n\trepeat with nthAccount in allAccounts\n\t\tset userFeeds to allFeeds of nthAccount\n\t\trepeat with nthFeed in userFeeds\n\t\t\tset starredArticles to (get every article of nthFeed where starred is true)\n\t\t\trepeat with nthArticle in starredArticles\n\t\t\t\tmy openTabInSafari(url of nthArticle)\n\t\t\tend repeat\n\t\tend repeat\n\tend repeat\nend tell\n","subject":"Align indentation in AppleScript example file","message":"Align indentation in AppleScript example file\n","lang":"AppleScript","license":"mit","repos":"brentsimmons\/Evergreen,brentsimmons\/Evergreen,brentsimmons\/Evergreen,brentsimmons\/Evergreen"}
{"commit":"fdf465938f7776bb95d2a33e54032dd7a80c4bbb","old_file":"contrib\/mac_developer_scripts.app\/Contents\/Resources\/Scripts\/main.scpt","new_file":"contrib\/mac_developer_scripts.app\/Contents\/Resources\/Scripts\/main.scpt","old_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\b\u0000\u0007\r\u0000\u0007\u0000\u0002r\u0000\u0000\u0000\u0000\u0000\b\u0000\b\u0000\t\r\u0000\b\u0000\u0001J\u0000\u0000\u0000\u0000\u0000\u0006\u0000\n\u0002\u0000\n\u0000\u0002\u0000\u000b\u0000\f\r\u0000\u000b\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0000\r\u000e\u0000\r\u0000\u0001\u0000\u000e\u0011\u0000\u000e\u0000\u0018\u0000p\u0000u\u0000m\u0000a\u0000 \u0000-\u0000p\u0000 \u00003\u00000\u00000\u00000\u0002\u0000\f\u0000\u0002\u0000\u000f\u0000\u0010\r\u0000\u000f\u0000\u0001m\u0000\u0000\u0000\u0001\u0000\u0002\u0000\u0011\u000e\u0000\u0011\u0000\u0001\u0000\u0012\u0011\u0000\u0012\u0000J\u0000r\u0000u\u0000b\u0000y\u0000 \u0000s\u0000c\u0000r\u0000i\u0000p\u0000t\u0000\/\u0000w\u0000e\u0000b\u0000s\u0000o\u0000c\u0000k\u0000e\u0000t\u0000-\u0000s\u0000e\u0000r\u0000v\u0000e\u0000r\u0000.\u0000r\u0000b\u0000 \u0000s\u0000t\u0000a\u0000r\u0000t\u0002\u0000\u0010\u0000\u0002\u0000\u0013\u0000\u0014\r\u0000\u0013\u0000\u0001m\u0000\u0000\u0000\u0002\u0000\u0003\u0000\u0015\u000e\u0000\u0015\u0000\u0001\u0000\u0016\u0011\u0000\u0016\u0000&\u0000g\u0000u\u0000a\u0000r\u0000d\u0000 \u0000-\u0000P\u0000 \u0000l\u0000i\u0000v\u0000e\u0000r\u0000e\u0000l\u0000o\u0000a\u0000d\u0002\u0000\u0014\u0000\u0002\u0000\u0017\r\u0000\u0017\u0000\u0001m\u0000\u0000\u0000\u0003\u0000\u0004\u0000\u0018\u000e\u0000\u0018\u0000\u0001\u0000\u0019\u0011\u0000\u0019\u0000\b\u0000g\u0000u\u0000l\u0000p\u0002\u0000\u0000\r\u0000\t\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000bcommandlist\u0000\u000bcommandList\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000\u001a\u0000\u001b\r\u0000\u001a\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u001b\u0000\u0002\u0000\u001c\u0000\u001d\r\u0000\u001c\u0000\u0003l\u0000\u0002\u0000\t\u0000\u001e\u0000\u001e\r\u0000\u001e\u0000\u0002O\u0000\u0000\u0000\t\u0000\u001e\u0000\u001f\u0000 \r\u0000\u001f\u0000\u0001k\u0000\u0000\u0000\r\u0000\u001d\u0000!\u0002\u0000!\u0000\u0002\u0000\"\u0000#\r\u0000\"\u0000\u0003I\u0000\u0002\u0000\r\u0000\u0012\n\u0000\u0018.miscactvnull\u0000\u0000obj \u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000#\u0000\u0002\u0000$\r\u0000$\u0000\u0002r\u0000\u0000\u0000\u0013\u0000\u001d\u0000%\u0000&\r\u0000%\u0000\u0002c\u0000\u0000\u0000\u0013\u0000\u001b\u0000'\u0000(\r\u0000'\u0000\u0003l\u0000\u0005\u0000\u0013\u0000\u0019\u0000)\r\u0000)\u0000\u0002n\u0000\u0000\u0000\u0013\u0000\u0019\u0000*\u0000+\r\u0000*\u0000\u00011\u0000\u0000\u0000\u0017\u0000\u0019\n\u0000\u0004\nfvtg\r\u0000+\u0000\u00024\u0001\u0000\u0000\u0013\u0000\u0017\u0000,\n\u0000\u0004\nbrow\r\u0000,\u0000\u0001m\u0000\u0000\u0000\u0015\u0000\u0016\u0003\u0000\u0001\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000(\u0000\u0001m\u0000\u0000\u0000\u0019\u0000\u001a\n\u0000\u0004\nctxt\r\u0000&\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00180\u0000\ncurrentdir\u0000\ncurrentDir\u0002\u0000\u0000\r\u0000 \u0000\u0001m\u0000\u0000\u0000\t\u0000\n\u0000-\u000f\u0000-\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000MACS\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001r\u0000\u0002\u0000\u0001\u000bSolid Stone\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00003H+\u0000\u0000\u0000\u0000\u00008\nFinder.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0016(\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u00003d\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u000b\u0000\u0000\u0000\u0001\u0000\f\u0000\u0000\u00008\u0000\u0000\u00007\u0000\u0000\u00006\u0000\u0002\u00005Solid Stone:System:\u0000Library:\u0000CoreServices:\u0000Finder.app\u0000\u0000\u000e\u0000\u0016\u0000\n\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u0018\u0000\u000b\u0000S\u0000o\u0000l\u0000i\u0000d\u0000 \u0000S\u0000t\u0000o\u0000n\u0000e\u0000\u0012\u0000&System\/Library\/CoreServices\/Finder.app\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u001d\u0000\u0002\u0000.\u0000\/\r\u0000.\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\/\u0000\u0002\u00000\u00001\r\u00000\u0000\u0003l\u0000\u0002\u0000\u001f\u0000$\u00002\r\u00002\u0000\u0003I\u0000\u0002\u0000\u001f\u0000$\u00003\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\r\u00003\u0000\u0001m\u0000\u0000\u0000\u001f\u0000 \u0003\u0000\u0001\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u00001\u0000\u0002\u00004\u00005\r\u00004\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u00005\u0000\u0002\u00006\r\u00006\u0000\u0003l\u0000\u0002\u0000%\u0000\u00007\r\u00007\u0000\u0002O\u0000\u0000\u0000%\u0000\u00008\u00009\r\u00008\u0000\u0001k\u0000\u0000\u0000)\u0000\u0000:\u0002\u0000:\u0000\u0002\u0000;\u0000<\r\u0000;\u0000\u0003I\u0000\u0002\u0000)\u0000.\n\u0000\u0018.miscactvnull\u0000\u0000obj \u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000<\u0000\u0002\u0000=\u0000>\r\u0000=\u0000\u0003I\u0000\u0002\u0000\/\u0000I\u0000?\u0000@\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\r\u0000?\u0000\u0002b\u0000\u0000\u0000\/\u00008\u0000A\u0000B\r\u0000A\u0000\u0002b\u0000\u0000\u0000\/\u00004\u0000C\u0000D\r\u0000C\u0000\u0001m\u0000\u0000\u0000\/\u00000\u0000E\u000e\u0000E\u0000\u0001\u0000F\u0011\u0000F\u0000\u0006\u0000c\u0000d\u0000 \r\u0000D\u0000\u0003l\u0000\u0005\u00000\u00003\u0000G\r\u0000G\u0000\u0002n\u0000\u0000\u00000\u00003\u0000H\u0000I\r\u0000H\u0000\u00011\u0000\u0000\u00001\u00003\n\u0000\u0004\npsxp\r\u0000I\u0000\u0001o\u0000\u0000\u00000\u00001\u000b\u0000\u00180\u0000\ncurrentdir\u0000\ncurrentDir\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000B\u0000\u0001m\u0000\u0000\u00004\u00007\u0000J\u000e\u0000J\u0000\u0001\u0000K\u0011\u0000K\u0000\u0004\u0000.\u0000.\u0006\u0000@\u0000\u0003\u0000L\n\u0000\u0004\nkfil\r\u0000L\u0000\u0002n\u0000\u0000\u0000;\u0000E\u0000M\u0000N\r\u0000M\u0000\u00011\u0000\u0000\u0000A\u0000E\n\u0000\u0004\ntcnt\r\u0000N\u0000\u0003l\u0001\u0000\u0000;\u0000A\u0000O\r\u0000O\u0000\u00024\u0001\u0000\u0000;\u0000A\u0000P\n\u0000\u0004\ncwin\r\u0000P\u0000\u0001m\u0000\u0000\u0000?\u0000@\u0003\u0000\u0001\u0001\u0000\u0000\u0001\u0000\u0000\u0006\u0000\u0000\u0002\u0000>\u0000\u0002\u0000Q\u0000R\r\u0000Q\u0000\u0003l\u0000\u0002\u0000J\u0000J\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000R\u0000\u0002\u0000S\u0000T\r\u0000S\u0000\u0003I\u0000\u0002\u0000J\u0000O\u0000U\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\r\u0000U\u0000\u0001m\u0000\u0000\u0000J\u0000K\u0003\u0000\u0001\u0002\u0000\u0000\u0002\u0000T\u0000\u0002\u0000V\u0000W\r\u0000V\u0000\u0003l\u0000\u0002\u0000P\u0000P\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000W\u0000\u0002\u0000X\r\u0000X\u0000\u0005Y\u0000\u0000\u0000P\u0000\u0000Y\u0000Z\u0000[\r\u0000Y\u0000\u0001k\u0000\u0000\u0000^\u0000\u0000\\\u0002\u0000\\\u0000\u0002\u0000]\u0000^\r\u0000]\u0000\u0004Z\u0000\u0000\u0000^\u0000\u0000_\u0000`\r\u0000_\u0000\u0002?\u0000\u0001\u0000^\u0000a\u0000a\u0000b\r\u0000a\u0000\u0001o\u0000\u0000\u0000^\u0000_\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\r\u0000b\u0000\u0001m\u0000\u0000\u0000_\u0000`\u0003\u0000\u0001\r\u0000`\u0000\u0001k\u0000\u0000\u0000d\u0000\u0000c\u0002\u0000c\u0000\u0002\u0000d\u0000e\r\u0000d\u0000\u0003I\u0000\u0002\u0000d\u0000i\u0000f\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\r\u0000f\u0000\u0001m\u0000\u0000\u0000d\u0000e\u0003\u0000\u0001\u0002\u0000\u0000\u0002\u0000e\u0000\u0002\u0000g\r\u0000g\u0000\u0002O\u0000\u0000\u0000j\u0000\u0000h\u0000i\r\u0000h\u0000\u0003I\u0000\u0002\u0000p\u0000\u0000j\u0000k\n\u0000\u0018.prcskprsnull\u0000\u0000\u0000\u0000\u0000ctxt\r\u0000j\u0000\u0001m\u0000\u0000\u0000p\u0000s\u0000l\u000e\u0000l\u0000\u0001\u0000m\u0011\u0000m\u0000\u0002\u0000t\u0006\u0000k\u0000\u0003\u0000n\n\u0000\u0004\nfaal\r\u0000n\u0000\u0001J\u0000\u0000\u0000v\u0000{\u0000o\u0002\u0000o\u0000\u0002\u0000p\r\u0000p\u0000\u0001m\u0000\u0000\u0000v\u0000y\n\u0000\b\u000beMdsKcmd\u0002\u0000\u0000\u0006\u0000\u0000\r\u0000i\u0000\u0001m\u0000\u0000\u0000j\u0000m\u0000q\u000f\u0000q\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sevs\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001\u0000\u0002\u0000\u0001\u000bSolid Stone\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00003H+\u0000\u0000\u0000\u0000\u00008\u0011System Events.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0012l\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u00003d\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u0000\u0000\u0000\u0001\u0000\f\u0000\u0000\u00008\u0000\u0000\u00007\u0000\u0000\u00006\u0000\u0002\u0000<Solid Stone:System:\u0000Library:\u0000CoreServices:\u0000System Events.app\u0000\u000e\u0000$\u0000\u0011\u0000S\u0000y\u0000s\u0000t\u0000e\u0000m\u0000 \u0000E\u0000v\u0000e\u0000n\u0000t\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u0018\u0000\u000b\u0000S\u0000o\u0000l\u0000i\u0000d\u0000 \u0000S\u0000t\u0000o\u0000n\u0000e\u0000\u0012\u0000-System\/Library\/CoreServices\/System Events.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000^\u0000\u0002\u0000r\u0000s\r\u0000r\u0000\u0003I\u0000\u0002\u0000\u0000\u0000t\u0000u\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\r\u0000t\u0000\u0003l\u0000\u0005\u0000\u0000\u0000v\r\u0000v\u0000\u0002n\u0000\u0000\u0000\u0000\u0000w\u0000x\r\u0000w\u0000\u00024\u0000\u0000\u0000\u0000\u0000y\n\u0000\u0004\ncobj\r\u0000y\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\r\u0000x\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000bcommandlist\u0000\u000bcommandList\u0001\u0000\u0000\u0001\u0000\u0000\u0006\u0000u\u0000\u0003\u0000z\n\u0000\u0004\nkfil\r\u0000z\u0000\u0002n\u0000\u0000\u0000\u0000\u0000{\u0000|\r\u0000{\u0000\u00011\u0000\u0000\u0000\u0000\n\u0000\u0004\ntcnt\r\u0000|\u0000\u0003l\u0001\u0000\u0000\u0000\u0000}\r\u0000}\u0000\u00024\u0001\u0000\u0000\u0000\u0000~\n\u0000\u0004\ncwin\r\u0000~\u0000\u0001m\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0001\u0000\u0000\u0001\u0000\u0000\u0006\u0000\u0000\u0002\u0000s\u0000\u0002\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0002\u0000\u0000\u0002\u0000\u0000\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\r\u0000Z\u0000\u0001m\u0000\u0000\u0000S\u0000T\u0003\u0000\u0001\r\u0000[\u0000\u0003I\u0000\u0001\u0000T\u0000Y\u0000\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\r\u0000\u0000\u0001o\u0000\u0000\u0000T\u0000U\u000b\u0000\u001a0\u0000\u000bcommandlist\u0000\u000bcommandList\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\r\u00009\u0000\u0001m\u0000\u0000\u0000%\u0000&\u0000\u000f\u0000\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000@\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001j\u0000\u0002\u0000\u0001\u000bSolid Stone\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00003H+\u0000\u0000\u0000\u0000I\fTerminal.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000B\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tUtilities\u0000\u0000\u0010\u0000\b\u0000\u00003d\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\"\u0000\u0000\u0000\u0001\u0000\b\u0000\u0000I\u0000\u0000\u0000W\u0000\u0002\u00001Solid Stone:Applications:\u0000Utilities:\u0000Terminal.app\u0000\u0000\u000e\u0000\u001a\u0000\f\u0000T\u0000e\u0000r\u0000m\u0000i\u0000n\u0000a\u0000l\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u0018\u0000\u000b\u0000S\u0000o\u0000l\u0000i\u0000d\u0000 \u0000S\u0000t\u0000o\u0000n\u0000e\u0000\u0012\u0000#Applications\/Utilities\/Terminal.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0006\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0010\u0000\u0000\u0004\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000b\u0000\u001a0\u0000\u000bcommandlist\u0000\u000bcommandList\u000b\u0000\u00180\u0000\ncurrentdir\u0000\ncurrentDir\u0001\u0000\u0000\u000e\u0000\u0000\u0007\u0010\u0000\u0000\u0000\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0005\u0000\u0002\u0000\u0000\u0002\u0000\u001c\u0000\u0002\u0000\u0000\u0002\u00000\u0000\u0002\u0000\u0000\u0002\u00006\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000\u0000\u0001\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\u0010\u0000\u0000\u001c\u0000\r\u0000\u0011\u0000\u0015\u0000\u0018\u0000-\u0000\u0000E\u0000J\u0000q\u0000l\u0003\u0000\u0004\u000b\u0000\u001a0\u0000\u000bcommandlist\u0000\u000bcommandList\n\u0000\u0018.miscactvnull\u0000\u0000obj \n\u0000\u0004\nbrow\n\u0000\u0004\nfvtg\n\u0000\u0004\nctxt\u000b\u0000\u00180\u0000\ncurrentdir\u0000\ncurrentDir\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\n\u0000\u0004\npsxp\n\u0000\u0004\nkfil\n\u0000\u0004\ncwin\n\u0000\u0004\ntcnt\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\n\u0000\u0004\nfaal\n\u0000\b\u000beMdsKcmd\n\u0000\u0018.prcskprsnull\u0000\u0000\u0000\u0000\u0000ctxt\n\u0000\u0004\ncobj\u0011\u0000vEO\u0012\u0000\u0012*j\f\u0000\u0007O*k\/,&EUOkj\f\u0000\fO\u0012\u0000*j\f\u0000\u0007O,%a\u0000\u0010%a\u0000\u0011*a\u0000\u0012k\/a\u0000\u0013,l\f\u0000\u0014Okj\f\u0000\fO\u0017\u0000Vkj\f\u0000\u0015kh\u001c\u0000\u0000k\u0002\u001d\u0000!kj\f\u0000\fOa\u0000\u0016\u0012\u0000\u0011a\u0000\u0017a\u0000\u0018a\u0000\u0019kvl\f\u0000\u001aUY\u0000\u0003hOa\u0000\u001b\/a\u0000\u0011*a\u0000\u0012k\/a\u0000\u0013,l\f\u0000\u0014Okj\f\u0000\f[OYU\u000f\u000e\u0000\u0000\u0002\u0004\u0000\u0003\u0000\u0004\u000e\u0000\u0000\u0004\u0000\u0000\r\u0000\u0011\u0000\u0015\u0000\u0018\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000j\u0000S\u0000o\u0000l\u0000i\u0000d\u0000 \u0000S\u0000t\u0000o\u0000n\u0000e\u0000:\u0000U\u0000s\u0000e\u0000r\u0000s\u0000:\u0000m\u0000r\u0000f\u0000l\u0000i\u0000x\u0000:\u0000P\u0000r\u0000o\u0000j\u0000e\u0000c\u0000t\u0000s\u0000:\u0000g\u0000i\u0000t\u0000:\u0000z\u0000a\u0000m\u0000m\u0000a\u0000d\u0000:\u0000c\u0000o\u0000n\u0000t\u0000r\u0000i\u0000b\u0000:\u0001\u0000\u0000\u0000ascr\u0000\u0001\u0000\r\u07ad","new_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\b\u0000\u0007\r\u0000\u0007\u0000\u0002r\u0000\u0000\u0000\u0000\u0000\b\u0000\b\u0000\t\r\u0000\b\u0000\u0001J\u0000\u0000\u0000\u0000\u0000\u0006\u0000\n\u0002\u0000\n\u0000\u0002\u0000\u000b\u0000\f\r\u0000\u000b\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0000\r\u000e\u0000\r\u0000\u0001\u0000\u000e\u0011\u0000\u000e\u0000\u0018\u0000p\u0000u\u0000m\u0000a\u0000 \u0000-\u0000p\u0000 \u00003\u00000\u00000\u00000\u0002\u0000\f\u0000\u0002\u0000\u000f\u0000\u0010\r\u0000\u000f\u0000\u0001m\u0000\u0000\u0000\u0001\u0000\u0002\u0000\u0011\u000e\u0000\u0011\u0000\u0001\u0000\u0012\u0011\u0000\u0012\u0000J\u0000r\u0000u\u0000b\u0000y\u0000 \u0000s\u0000c\u0000r\u0000i\u0000p\u0000t\u0000\/\u0000w\u0000e\u0000b\u0000s\u0000o\u0000c\u0000k\u0000e\u0000t\u0000-\u0000s\u0000e\u0000r\u0000v\u0000e\u0000r\u0000.\u0000r\u0000b\u0000 \u0000s\u0000t\u0000a\u0000r\u0000t\u0002\u0000\u0010\u0000\u0002\u0000\u0013\u0000\u0014\r\u0000\u0013\u0000\u0001m\u0000\u0000\u0000\u0002\u0000\u0003\u0000\u0015\u000e\u0000\u0015\u0000\u0001\u0000\u0016\u0011\u0000\u0016\u0000&\u0000g\u0000u\u0000a\u0000r\u0000d\u0000 \u0000-\u0000P\u0000 \u0000l\u0000i\u0000v\u0000e\u0000r\u0000e\u0000l\u0000o\u0000a\u0000d\u0002\u0000\u0014\u0000\u0002\u0000\u0017\r\u0000\u0017\u0000\u0001m\u0000\u0000\u0000\u0003\u0000\u0004\u0000\u0018\u000e\u0000\u0018\u0000\u0001\u0000\u0019\u0011\u0000\u0019\u0000\b\u0000g\u0000u\u0000l\u0000p\u0002\u0000\u0000\r\u0000\t\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000bcommandlist\u0000\u000bcommandList\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000\u001a\u0000\u001b\r\u0000\u001a\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u001b\u0000\u0002\u0000\u001c\u0000\u001d\r\u0000\u001c\u0000\u0003l\u0000\u0002\u0000\t\u0000\u001e\u0000\u001e\r\u0000\u001e\u0000\u0002O\u0000\u0000\u0000\t\u0000\u001e\u0000\u001f\u0000 \r\u0000\u001f\u0000\u0001k\u0000\u0000\u0000\r\u0000\u001d\u0000!\u0002\u0000!\u0000\u0002\u0000\"\u0000#\r\u0000\"\u0000\u0003I\u0000\u0002\u0000\r\u0000\u0012\n\u0000\u0018.miscactvnull\u0000\u0000obj \u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000#\u0000\u0002\u0000$\r\u0000$\u0000\u0002r\u0000\u0000\u0000\u0013\u0000\u001d\u0000%\u0000&\r\u0000%\u0000\u0002c\u0000\u0000\u0000\u0013\u0000\u001b\u0000'\u0000(\r\u0000'\u0000\u0003l\u0000\u0005\u0000\u0013\u0000\u0019\u0000)\r\u0000)\u0000\u0002n\u0000\u0000\u0000\u0013\u0000\u0019\u0000*\u0000+\r\u0000*\u0000\u00011\u0000\u0000\u0000\u0017\u0000\u0019\n\u0000\u0004\nfvtg\r\u0000+\u0000\u00024\u0001\u0000\u0000\u0013\u0000\u0017\u0000,\n\u0000\u0004\nbrow\r\u0000,\u0000\u0001m\u0000\u0000\u0000\u0015\u0000\u0016\u0003\u0000\u0001\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000(\u0000\u0001m\u0000\u0000\u0000\u0019\u0000\u001a\n\u0000\u0004\nctxt\r\u0000&\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00180\u0000\ncurrentdir\u0000\ncurrentDir\u0002\u0000\u0000\r\u0000 \u0000\u0001m\u0000\u0000\u0000\t\u0000\n\u0000-\u000f\u0000-\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000MACS\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001r\u0000\u0002\u0000\u0001\u000bSolid Stone\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00003H+\u0000\u0000\u0000k\nFinder.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000J\u000f\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u00003d\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u000er\u0000\u0000\u0000\u0001\u0000\f\u0000k\u0000j\u0000i\u0000\u0002\u00005Solid Stone:System:\u0000Library:\u0000CoreServices:\u0000Finder.app\u0000\u0000\u000e\u0000\u0016\u0000\n\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u0018\u0000\u000b\u0000S\u0000o\u0000l\u0000i\u0000d\u0000 \u0000S\u0000t\u0000o\u0000n\u0000e\u0000\u0012\u0000&System\/Library\/CoreServices\/Finder.app\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u001d\u0000\u0002\u0000.\u0000\/\r\u0000.\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\/\u0000\u0002\u00000\u00001\r\u00000\u0000\u0003l\u0000\u0002\u0000\u001f\u0000$\u00002\r\u00002\u0000\u0003I\u0000\u0002\u0000\u001f\u0000$\u00003\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\r\u00003\u0000\u0001m\u0000\u0000\u0000\u001f\u0000 \u0003\u0000\u0001\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u00001\u0000\u0002\u00004\u00005\r\u00004\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u00005\u0000\u0002\u00006\r\u00006\u0000\u0003l\u0000\u0002\u0000%\u0000\u00007\r\u00007\u0000\u0002O\u0000\u0000\u0000%\u0000\u00008\u00009\r\u00008\u0000\u0001k\u0000\u0000\u0000)\u0000\u0000:\u0002\u0000:\u0000\u0002\u0000;\u0000<\r\u0000;\u0000\u0003I\u0000\u0002\u0000)\u0000.\n\u0000\u0018.miscactvnull\u0000\u0000obj \u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000<\u0000\u0002\u0000=\u0000>\r\u0000=\u0000\u0003I\u0000\u0002\u0000\/\u0000I\u0000?\u0000@\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\r\u0000?\u0000\u0002b\u0000\u0000\u0000\/\u00008\u0000A\u0000B\r\u0000A\u0000\u0002b\u0000\u0000\u0000\/\u00004\u0000C\u0000D\r\u0000C\u0000\u0001m\u0000\u0000\u0000\/\u00000\u0000E\u000e\u0000E\u0000\u0001\u0000F\u0011\u0000F\u0000\u0006\u0000c\u0000d\u0000 \r\u0000D\u0000\u0003l\u0000\u0005\u00000\u00003\u0000G\r\u0000G\u0000\u0002n\u0000\u0000\u00000\u00003\u0000H\u0000I\r\u0000H\u0000\u00011\u0000\u0000\u00001\u00003\n\u0000\u0004\npsxp\r\u0000I\u0000\u0001o\u0000\u0000\u00000\u00001\u000b\u0000\u00180\u0000\ncurrentdir\u0000\ncurrentDir\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000B\u0000\u0001m\u0000\u0000\u00004\u00007\u0000J\u000e\u0000J\u0000\u0001\u0000K\u0011\u0000K\u0000\u0004\u0000.\u0000.\u0006\u0000@\u0000\u0003\u0000L\n\u0000\u0004\nkfil\r\u0000L\u0000\u0002n\u0000\u0000\u0000;\u0000E\u0000M\u0000N\r\u0000M\u0000\u00011\u0000\u0000\u0000A\u0000E\n\u0000\u0004\ntcnt\r\u0000N\u0000\u0003l\u0001\u0000\u0000;\u0000A\u0000O\r\u0000O\u0000\u00024\u0001\u0000\u0000;\u0000A\u0000P\n\u0000\u0004\ncwin\r\u0000P\u0000\u0001m\u0000\u0000\u0000?\u0000@\u0003\u0000\u0001\u0001\u0000\u0000\u0001\u0000\u0000\u0006\u0000\u0000\u0002\u0000>\u0000\u0002\u0000Q\u0000R\r\u0000Q\u0000\u0003l\u0000\u0002\u0000J\u0000J\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000R\u0000\u0002\u0000S\u0000T\r\u0000S\u0000\u0003I\u0000\u0002\u0000J\u0000O\u0000U\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\r\u0000U\u0000\u0001m\u0000\u0000\u0000J\u0000K\u0003\u0000\u0001\u0002\u0000\u0000\u0002\u0000T\u0000\u0002\u0000V\u0000W\r\u0000V\u0000\u0003l\u0000\u0002\u0000P\u0000P\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000W\u0000\u0002\u0000X\r\u0000X\u0000\u0005Y\u0000\u0000\u0000P\u0000\u0000Y\u0000Z\u0000[\r\u0000Y\u0000\u0001k\u0000\u0000\u0000^\u0000\u0000\\\u0002\u0000\\\u0000\u0002\u0000]\u0000^\r\u0000]\u0000\u0004Z\u0000\u0000\u0000^\u0000\u0000_\u0000`\r\u0000_\u0000\u0002?\u0000\u0001\u0000^\u0000a\u0000a\u0000b\r\u0000a\u0000\u0001o\u0000\u0000\u0000^\u0000_\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\r\u0000b\u0000\u0001m\u0000\u0000\u0000_\u0000`\u0003\u0000\u0001\r\u0000`\u0000\u0001k\u0000\u0000\u0000d\u0000\u0000c\u0002\u0000c\u0000\u0002\u0000d\u0000e\r\u0000d\u0000\u0003I\u0000\u0002\u0000d\u0000i\u0000f\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\r\u0000f\u0000\u0001m\u0000\u0000\u0000d\u0000e\u0003\u0000\u0001\u0002\u0000\u0000\u0002\u0000e\u0000\u0002\u0000g\r\u0000g\u0000\u0002O\u0000\u0000\u0000j\u0000\u0000h\u0000i\r\u0000h\u0000\u0003I\u0000\u0002\u0000p\u0000\u0000j\u0000k\n\u0000\u0018.prcskprsnull\u0000\u0000\u0000\u0000\u0000ctxt\r\u0000j\u0000\u0001m\u0000\u0000\u0000p\u0000s\u0000l\u000e\u0000l\u0000\u0001\u0000m\u0011\u0000m\u0000\u0002\u0000t\u0006\u0000k\u0000\u0003\u0000n\n\u0000\u0004\nfaal\r\u0000n\u0000\u0001J\u0000\u0000\u0000v\u0000{\u0000o\u0002\u0000o\u0000\u0002\u0000p\r\u0000p\u0000\u0001m\u0000\u0000\u0000v\u0000y\n\u0000\b\u000beMdsKcmd\u0002\u0000\u0000\u0006\u0000\u0000\r\u0000i\u0000\u0001m\u0000\u0000\u0000j\u0000m\u0000q\u000f\u0000q\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sevs\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001\u0000\u0002\u0000\u0001\u000bSolid Stone\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00003H+\u0000\u0000\u0000k\u0011System Events.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u00003d\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u0000\u0000\u0000\u0001\u0000\f\u0000k\u0000j\u0000i\u0000\u0002\u0000<Solid Stone:System:\u0000Library:\u0000CoreServices:\u0000System Events.app\u0000\u000e\u0000$\u0000\u0011\u0000S\u0000y\u0000s\u0000t\u0000e\u0000m\u0000 \u0000E\u0000v\u0000e\u0000n\u0000t\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u0018\u0000\u000b\u0000S\u0000o\u0000l\u0000i\u0000d\u0000 \u0000S\u0000t\u0000o\u0000n\u0000e\u0000\u0012\u0000-System\/Library\/CoreServices\/System Events.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000^\u0000\u0002\u0000r\u0000s\r\u0000r\u0000\u0003I\u0000\u0002\u0000\u0000\u0000t\u0000u\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\r\u0000t\u0000\u0003l\u0000\u0005\u0000\u0000\u0000v\r\u0000v\u0000\u0002n\u0000\u0000\u0000\u0000\u0000w\u0000x\r\u0000w\u0000\u00024\u0000\u0000\u0000\u0000\u0000y\n\u0000\u0004\ncobj\r\u0000y\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\r\u0000x\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000bcommandlist\u0000\u000bcommandList\u0001\u0000\u0000\u0001\u0000\u0000\u0006\u0000u\u0000\u0003\u0000z\n\u0000\u0004\nkfil\r\u0000z\u0000\u0002n\u0000\u0000\u0000\u0000\u0000{\u0000|\r\u0000{\u0000\u00011\u0000\u0000\u0000\u0000\n\u0000\u0004\ntcnt\r\u0000|\u0000\u0003l\u0001\u0000\u0000\u0000\u0000}\r\u0000}\u0000\u00024\u0001\u0000\u0000\u0000\u0000~\n\u0000\u0004\ncwin\r\u0000~\u0000\u0001m\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0001\u0000\u0000\u0001\u0000\u0000\u0006\u0000\u0000\u0002\u0000s\u0000\u0002\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0000\u0003\u0000\u0001\u0002\u0000\u0000\u0002\u0000\u0000\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\r\u0000Z\u0000\u0001m\u0000\u0000\u0000S\u0000T\u0003\u0000\u0001\r\u0000[\u0000\u0003I\u0000\u0001\u0000T\u0000Y\u0000\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\r\u0000\u0000\u0001o\u0000\u0000\u0000T\u0000U\u000b\u0000\u001a0\u0000\u000bcommandlist\u0000\u000bcommandList\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\r\u00009\u0000\u0001m\u0000\u0000\u0000%\u0000&\u0000\u000f\u0000\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000@\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001j\u0000\u0002\u0000\u0001\u000bSolid Stone\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00003H+\u0000\u0000\u0000\fTerminal.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000B\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\tUtilities\u0000\u0000\u0010\u0000\b\u0000\u00003d\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\"\u0000\u0000\u0000\u0001\u0000\b\u0000\u0000\u0000\u0002\u00001Solid Stone:Applications:\u0000Utilities:\u0000Terminal.app\u0000\u0000\u000e\u0000\u001a\u0000\f\u0000T\u0000e\u0000r\u0000m\u0000i\u0000n\u0000a\u0000l\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u0018\u0000\u000b\u0000S\u0000o\u0000l\u0000i\u0000d\u0000 \u0000S\u0000t\u0000o\u0000n\u0000e\u0000\u0012\u0000#Applications\/Utilities\/Terminal.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0006\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0010\u0000\u0000\u0004\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000b\u0000\u001a0\u0000\u000bcommandlist\u0000\u000bcommandList\u000b\u0000\u00180\u0000\ncurrentdir\u0000\ncurrentDir\u0001\u0000\u0000\u000e\u0000\u0000\u0007\u0010\u0000\u0000\u0000\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0005\u0000\u0002\u0000\u0000\u0002\u0000\u001c\u0000\u0002\u0000\u0000\u0002\u00000\u0000\u0002\u0000\u0000\u0002\u00006\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000\u0000\u0001\u000b\u0000\u00050\u0000\u0001n\u0000\u0000\u0010\u0000\u0000\u001c\u0000\r\u0000\u0011\u0000\u0015\u0000\u0018\u0000-\u0000\u0000E\u0000J\u0000q\u0000l\u0003\u0000\u0004\u000b\u0000\u001a0\u0000\u000bcommandlist\u0000\u000bcommandList\n\u0000\u0018.miscactvnull\u0000\u0000obj \n\u0000\u0004\nbrow\n\u0000\u0004\nfvtg\n\u0000\u0004\nctxt\u000b\u0000\u00180\u0000\ncurrentdir\u0000\ncurrentDir\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\n\u0000\u0004\npsxp\n\u0000\u0004\nkfil\n\u0000\u0004\ncwin\n\u0000\u0004\ntcnt\n\u0000\u0018.coredoscnull\u0000\u0000ctxt\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\n\u0000\u0004\nfaal\n\u0000\b\u000beMdsKcmd\n\u0000\u0018.prcskprsnull\u0000\u0000\u0000\u0000\u0000ctxt\n\u0000\u0004\ncobj\u0011\u0000vEO\u0012\u0000\u0012*j\f\u0000\u0007O*k\/,&EUOkj\f\u0000\fO\u0012\u0000*j\f\u0000\u0007O,%a\u0000\u0010%a\u0000\u0011*a\u0000\u0012k\/a\u0000\u0013,l\f\u0000\u0014Okj\f\u0000\fO\u0017\u0000Vkj\f\u0000\u0015kh\u001c\u0000\u0000k\u0002\u001d\u0000!kj\f\u0000\fOa\u0000\u0016\u0012\u0000\u0011a\u0000\u0017a\u0000\u0018a\u0000\u0019kvl\f\u0000\u001aUY\u0000\u0003hOa\u0000\u001b\/a\u0000\u0011*a\u0000\u0012k\/a\u0000\u0013,l\f\u0000\u0014Okj\f\u0000\f[OYU\u000f\u000e\u0000\u0000\u0002\u0004\u0000\u0003\u0000\u0004\u000e\u0000\u0000\u0004\u0000\u0000\r\u0000\u0011\u0000\u0015\u0000\u0018\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000j\u0000S\u0000o\u0000l\u0000i\u0000d\u0000 \u0000S\u0000t\u0000o\u0000n\u0000e\u0000:\u0000U\u0000s\u0000e\u0000r\u0000s\u0000:\u0000m\u0000r\u0000f\u0000l\u0000i\u0000x\u0000:\u0000P\u0000r\u0000o\u0000j\u0000e\u0000c\u0000t\u0000s\u0000:\u0000g\u0000i\u0000t\u0000:\u0000z\u0000a\u0000m\u0000m\u0000a\u0000d\u0000:\u0000c\u0000o\u0000n\u0000t\u0000r\u0000i\u0000b\u0000:\u0001\u0000\u0000\u0000ascr\u0000\u0001\u0000\r\u07ad","subject":"update dev autostart script","message":"update dev autostart script\n","lang":"AppleScript","license":"agpl-3.0","repos":"monotek\/zammad,zammad\/zammad,monotek\/zammad,zammad\/zammad,monotek\/zammad,monotek\/zammad,zammad\/zammad,zammad\/zammad,zammad\/zammad,zammad\/zammad,monotek\/zammad,monotek\/zammad"}
{"commit":"67b1c923355fd63b39b8b1d5ed2e4938a925a544","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\n-- brings queue into view in iTunes window\non focusQueue()\n\n\ttell application \"iTunes\"\n\n\t\treveal user playlist workflowPlaylistName\n\n\tend tell\n\nend focusQueue\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to first user playlist whose id is playlistId\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif disc number of theSong is discIndex and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset searchSongs to {}\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset searchSongs to (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset searchSongs to (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\t\trepeat with searchSong in searchSongs\n\n\t\t\t\t\t\tset duplicateSong to false\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif theSong is searchSong then\n\n\t\t\t\t\t\t\t\tset duplicateSong to true\n\t\t\t\t\t\t\t\texit repeat\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\t\tif duplicateSong is false then\n\n\t\t\t\t\t\t\tcopy searchSong to end of theSongs\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\n\tfocusQueue()\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tfocusQueue()\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\n-- brings queue into view in iTunes window\non focusQueue()\n\n\ttell application \"iTunes\"\n\n\t\treveal user playlist workflowPlaylistName\n\n\tend tell\n\nend focusQueue\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to first user playlist whose id is playlistId\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif disc number of theSong is discIndex and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset searchSongs to {}\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset searchSongs to (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset searchSongs to (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\t\trepeat with searchSong in searchSongs\n\n\t\t\t\t\t\tset duplicateSong to false\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif (database ID of theSong) is (database ID of searchSong) then\n\n\t\t\t\t\t\t\t\tset duplicateSong to true\n\t\t\t\t\t\t\t\texit repeat\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\t\tif duplicateSong is false then\n\n\t\t\t\t\t\t\tcopy searchSong to end of theSongs\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\n\tfocusQueue()\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tfocusQueue()\n\tplayQueue()\n\nend play\n","subject":"Fix bug with previous fix; duplicates are now gone","message":"Fix bug with previous fix; duplicates are now gone\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"d0d5e39820d731938e60766c80c1233abf211bf7","old_file":"Scripts\/select-simulator-device.applescript","new_file":"Scripts\/select-simulator-device.applescript","old_contents":"set simulatedDevice to (item 1 of argv)\n\ntell application \"iPhone Simulator\"\n\tactivate\nend tell\n\ntell application \"System Events\"\n\ttell process \"iPhone Simulator\"\n\t\ttell menu bar 1\n\t\t\ttell menu bar item \"Hardware\"\n\t\t\t\ttell menu \"Hardware\"\n\t\t\t\t\ttell menu item \"Device\"\n\t\t\t\t\t\ttell menu \"Device\"\n\t\t\t\t\t\t\tclick menu item simulatedDevice\n\t\t\t\t\t\tend tell\n\t\t\t\t\tend tell\n\t\t\t\tend tell\n\t\t\tend tell\n\t\tend tell\n\tend tell\nend tell\n","new_contents":"on run argv\n\tset simulatedDevice to (item 1 of argv)\n\ttell application \"iPhone Simulator\"\n\t\tactivate\n\tend tell\n\t\n\ttell application \"System Events\"\n\t\ttell process \"iPhone Simulator\"\n\t\t\ttell menu bar 1\n\t\t\t\ttell menu bar item \"Hardware\"\n\t\t\t\t\ttell menu \"Hardware\"\n\t\t\t\t\t\ttell menu item \"Device\"\n\t\t\t\t\t\t\ttell menu \"Device\"\n\t\t\t\t\t\t\t\tclick menu item simulatedDevice\n\t\t\t\t\t\t\tend tell\n\t\t\t\t\t\tend tell\n\t\t\t\t\tend tell\n\t\t\t\tend tell\n\t\t\tend tell\n\t\tend tell\n\tend tell\nend run\n\n","subject":"fix apple script to select device","message":"fix apple script to select device\n","lang":"AppleScript","license":"mit","repos":"blazingcloud\/sealant,blazingcloud\/sealant,blazingcloud\/sealant,blazingcloud\/sealant"}
{"commit":"a8d7790d2f24e3e9463a2305c3ebbb6ea3f8a68d","old_file":"org.hidetake.osx-go-to-bed.applescript","new_file":"org.hidetake.osx-go-to-bed.applescript","old_contents":"#!\/usr\/bin\/osascript\n\nset awakeTime to date \"8:00:00\"\n\nset {hours: remainHours, minutes: remainMinutes} to (date \"0:0\") + (awakeTime - (current date))\nset messageTitle to \"Remaining \" & remainHours & \" hours \" & remainMinutes & \" minutes\"\nset messageDescription to \"now \" & time string of (current date)\n\ndisplay notification messageDescription with title messageTitle\n","new_contents":"#!\/usr\/bin\/osascript\n\n-- awake time in next morning\nset awakeTime to date \"8:00:00\"\n\n-- calculate and notify remaining time\nset {hours: remainHours, minutes: remainMinutes} to (date \"0:0\") + (awakeTime - (current date))\n\nset messageTitle to \"Remaining \" & remainHours & \" hours \" & remainMinutes & \" minutes\"\nset messageDescription to \"now \" & time string of (current date)\n\ndisplay notification messageDescription with title messageTitle\n","subject":"Add comment","message":"Add comment\n","lang":"AppleScript","license":"apache-2.0","repos":"int128\/osx-go-to-bed"}
{"commit":"8456f6877d17a8b146b5bd3f5b14f8edb695208a","old_file":"QuickStats\/QuickStats.applescript","new_file":"QuickStats\/QuickStats.applescript","old_contents":"property pTitle : \"OmniFocus: Quick Stats\"\nproperty pVersion : \"2.07\"\n\nproperty pstrDBPath : \"$HOME\/Library\/Caches\/com.omnigroup.OmniFocus\/OmniFocusDatabase2\"\nproperty pstrMinOSX : \"10.6\"\n\nproperty pTimeOut : 20\n\n-- Ver 0.8 adds clipboard option to dialogue\n-- Ver 0.9 gives an error message if the cache schema has changed, leading to an SQL error in the script\n-- Ver 1.0 slight simplification of the code\n-- Ver 1.1 added count of Pending projects\n-- Ver 1.2 added a count of available actions\n-- Ver 1.3 added a break-down of unavailable actions\n-- Ver 1.4 added count of Current projects to complement Pending projects\n-- ver 1.5 replaced Applescript time function with SQL time expression\n-- Ver 1.7 Reorganizes menu, and attempts to enable access for .macappstore installations of OF\n--Ver 1.8 Adjusts handling of variant bundle identifiers generally\n-- Ver 2.00 Redraft of task breakdown, with progressive narrowing of criteria ...\n\nproperty pToClipboard : \"Copy list to clipboard\"\n\nif not FileExists(pstrDBPath) then set pstrDBPath to GetCachePath()\n\ntell application \"Finder\"\n\tif (version < pstrMinOSX) then\n\t\tdisplay dialog \"This script requires OSX \" & pstrMinOSX & \" or higher\" buttons {\"OK\"} default button 1 with title pTitle & \"Ver. \" & pVersion\n\t\treturn\n\tend if\nend tell\n\nif pstrDBPath  \"\" then\n\tset strCmd to \"sqlite3 -separator ': ' \\\"\" & pstrDBPath & \"\\\" \" & quoted form of (\"\n\tselect \\\"INBOX GROUPS & ACTIONS\\\", count(*) from task where (inInbox=1);\n\tselect \\\"    Inbox action groups\\\", count(*) from task where (inInbox=1) and (childrenCount>0);\n\tselect \\\"    Inbox actions\\\", count(*) from task where (inInbox=1) and (childrenCount=0);\n\tselect null;\n\tselect \\\"FOLDERS\\\"\t, count(*) from folder;\n\tselect \\\"    Active folders\\\", count(*) from folder where effectiveActive=1;\n\tselect \\\"    Dropped folders\\\", count(*) from folder where effectiveActive=0;\n\tselect null;\n\tselect \\\"PROJECTS\\\", count(*) from projectInfo where containsSingletonActions=0;\n\tselect \\\"    Active projects\\\", count(*) from projectInfo where (containsSingletonActions=0) and (status=\\\"active\\\");\n\tselect \\\"            Current projects\\\", count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status=\\\"active\\\") and (t.dateToStart is null or t.dateToStart < (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect \\\"            Pending projects\\\", count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status=\\\"active\\\") and (t.dateToStart > (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect \\\"    On-hold projects\\\", count(*) from projectInfo where (containsSingletonActions=0) and (status=\\\"inactive\\\");\n\tselect \\\"    Completed projects\\\", count(*) from projectInfo where (containsSingletonActions=0) and (status=\\\"done\\\");\n\tselect \\\"    Dropped projects\\\", count(*) from projectInfo where (containsSingletonActions=0) and (( status=\\\"dropped\\\") or (folderEffectiveActive=0));\n\tselect null;\t\n\tselect \\\"SINGLE ACTION LISTS\\\", count(*) from projectInfo where containsSingletonActions=1;\n\tselect \\\"    Active single action lists\\\", count(*) from projectInfo where (containsSingletonActions=1) and (status=\\\"active\\\");\n\tselect \\\"    On-hold single action lists\\\", count(*) from projectInfo where (containsSingletonActions=1) and (status=\\\"inactive\\\");\n\tselect \\\"    Completed single action lists\\\", count(*) from projectInfo where (containsSingletonActions=1) and (status=\\\"done\\\");\n\tselect \\\"    Dropped single action lists\\\", count(*) from projectInfo where (containsSingletonActions=1) and (( status=\\\"dropped\\\") or (folderEffectiveActive=0));\n\tselect null;\n\tselect \\\"CONTEXTS\\\", count(*) from context;\n\tselect \\\"    Active contexts\\\", count(*) from context where (effectiveActive=1) and (allowsNextAction=1);\n\tselect \\\"    On-hold contexts\\\", count(*) from context where (effectiveActive=1) and allowsNextAction=0;\n\tselect \\\"    Dropped contexts\\\", count(*) from context where effectiveActive=0;\n\tselect null;\n\tselect \\\"ACTION GROUPS\\\", count(*) from task where (projectinfo is null) and (childrenCount>0);\n\tselect \\\"    Remaining action groups\\\", count(*) from task where (projectinfo is null) and (dateCompleted is null) and (childrenCount>0);\n\tselect \\\"    Completed action groups\\\", count(dateCompleted) from task where (projectinfo is null) and (childrenCount>0);\n\tselect null;\n\tselect \\\"ACTIONS\\\", count(*) from task where (projectinfo is null) and (childrenCount=0);\n\tselect \\\"    Completed actions\\\", count(dateCompleted) from task where (projectinfo is null) and (childrenCount=0);\n\tselect \\\"    Dropped project actions\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp where (projectinfo is null) and (childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is not null and (tp.status=\\\"dropped\\\" or tp.folderEffectiveActive=0));\n\tselect \\\"    Dropped context actions\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand c.effectiveActive= 0;\n\tselect \\\"    Remaining actions\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1);\n\tselect \\\"        Actions in Projects on hold\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is not null and tp.status=\\\"inactive\\\");\n\tselect \\\"        Actions in Contexts on hold\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!=\\\"inactive\\\")\n\t\t\t\tand (tp.context is not null and c.allowsNextAction=0);\n\tselect \\\"        Blocked actions\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!=\\\"inactive\\\")\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1;\n\tselect \\\"        \tBlocked by future start date\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!=\\\"inactive\\\")\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=1;\n\tselect \\\"        \tSequentially blocked\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!=\\\"inactive\\\")\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=0;\n\tselect \\\"        Available actions\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!=\\\"inactive\\\")\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=0;\n\t\t\t\t\n\t\")\n\t\n\t-- \t\ttry\n\tset strList to do shell script strCmd\n\t-- \t\ton error\n\t-- \t\t\tdisplay dialog \"The SQL schema for the OmniFocus cache may have changed in a recent update of OF.\" & return & return & \n\t-- \t\t\t\t\"Look on the OmniFocus user forums for an updated version of this script.\" buttons {\"OK\"} with title pTitle & \"Ver. \" & pVersion\n\t-- \t\t\treturn\n\t-- \t\tend try\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tif button returned of (display dialog strList buttons {pToClipboard, \"OK\"} default button \"OK\" giving up after pTimeOut with title pTitle & \" Ver. \" & pVersion) \n\t\t\tis pToClipboard then tell application id \"com.apple.finder\" to set the clipboard to strList\n\tend tell\nelse\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tdisplay dialog \"OmniFocus cache not found ...\" buttons {\"OK\"} default button 1 with title pTitle & \" Ver. \" & pVersion\n\tend tell\nend if\n\n\non FileExists(strPath)\n\t(do shell script \"test -e \" & strPath & \" ; echo $?\") = \"0\"\nend FileExists\n\non GetCachePath()\n\ttry\n\t\ttell application \"Finder\" to tell (application file id \"OFOC\") to \"$HOME\/Library\/Caches\/\" & its id & \"\/OmniFocusDatabase2\"\n\ton error\n\t\terror \"OmniFocus not installed ...\"\n\tend try\nend GetCachePath\n\n","new_contents":"property pTitle : \"OmniFocus: Quick Stats\"\nproperty pVersion : \"2.07\"\n\nproperty pstrDBPath : \"$HOME\/Library\/Caches\/com.omnigroup.OmniFocus\/OmniFocusDatabase2\"\nproperty pstrMinOSX : \"10.6\"\n\nproperty pTimeOut : 20\n\n-- Original version: https:\/\/github.com\/RobTrew\/tree-tools\/blob\/master\/OmniFocus%20scripts\/Statistics\/QuickStats.applescript\n\n-- Copyright  2012, 2013, 2014 Robin Trew\n-- \n-- Permission is hereby granted, free of charge, \n-- to any person obtaining a copy of this software \n-- and associated documentation files (the \"Software\"), \n-- to deal in the Software without restriction, \n-- including without limitation the rights to use, copy, \n-- modify, merge, publish, distribute, sublicense, \n-- and\/or sell copies of the Software, and to permit persons \n-- to whom the Software is furnished to do so, \n-- subject to the following conditions:\n-- \n-- *******\n-- The above copyright notice and this permission notice \n-- shall be included in ALL copies \n-- or substantial portions of the Software.\n-- *******\n-- \n-- THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, \n-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES \n-- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \n-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \n-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, \n-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE \n-- OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n-- Ver 0.8 adds clipboard option to dialogue\n-- Ver 0.9 gives an error message if the cache schema has changed, leading to an SQL error in the script\n-- Ver 1.0 slight simplification of the code\n-- Ver 1.1 added count of Pending projects\n-- Ver 1.2 added a count of available actions\n-- Ver 1.3 added a break-down of unavailable actions\n-- Ver 1.4 added count of Current projects to complement Pending projects\n-- ver 1.5 replaced Applescript time function with SQL time expression\n-- Ver 1.7 Reorganizes menu, and attempts to enable access for .macappstore installations of OF\n--Ver 1.8 Adjusts handling of variant bundle identifiers generally\n-- Ver 2.00 Redraft of task breakdown, with progressive narrowing of criteria ...\n\nproperty pToClipboard : \"Copy list to clipboard\"\n\nif not FileExists(pstrDBPath) then set pstrDBPath to GetCachePath()\n\ntell application \"Finder\"\n\tif (version < pstrMinOSX) then\n\t\tdisplay dialog \"This script requires OSX \" & pstrMinOSX & \" or higher\" buttons {\"OK\"} default button 1 with title pTitle & \"Ver. \" & pVersion\n\t\treturn\n\tend if\nend tell\n\nif pstrDBPath  \"\" then\n\tset strCmd to \"sqlite3 -separator ': ' \\\"\" & pstrDBPath & \"\\\" \" & quoted form of (\"\n\tselect \\\"INBOX GROUPS & ACTIONS\\\", count(*) from task where (inInbox=1);\n\tselect \\\"    Inbox action groups\\\", count(*) from task where (inInbox=1) and (childrenCount>0);\n\tselect \\\"    Inbox actions\\\", count(*) from task where (inInbox=1) and (childrenCount=0);\n\tselect null;\n\tselect \\\"FOLDERS\\\"\t, count(*) from folder;\n\tselect \\\"    Active folders\\\", count(*) from folder where effectiveActive=1;\n\tselect \\\"    Dropped folders\\\", count(*) from folder where effectiveActive=0;\n\tselect null;\n\tselect \\\"PROJECTS\\\", count(*) from projectInfo where containsSingletonActions=0;\n\tselect \\\"    Active projects\\\", count(*) from projectInfo where (containsSingletonActions=0) and (status=\\\"active\\\");\n\tselect \\\"            Current projects\\\", count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status=\\\"active\\\") and (t.dateToStart is null or t.dateToStart < (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect \\\"            Pending projects\\\", count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status=\\\"active\\\") and (t.dateToStart > (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect \\\"    On-hold projects\\\", count(*) from projectInfo where (containsSingletonActions=0) and (status=\\\"inactive\\\");\n\tselect \\\"    Completed projects\\\", count(*) from projectInfo where (containsSingletonActions=0) and (status=\\\"done\\\");\n\tselect \\\"    Dropped projects\\\", count(*) from projectInfo where (containsSingletonActions=0) and (( status=\\\"dropped\\\") or (folderEffectiveActive=0));\n\tselect null;\t\n\tselect \\\"SINGLE ACTION LISTS\\\", count(*) from projectInfo where containsSingletonActions=1;\n\tselect \\\"    Active single action lists\\\", count(*) from projectInfo where (containsSingletonActions=1) and (status=\\\"active\\\");\n\tselect \\\"    On-hold single action lists\\\", count(*) from projectInfo where (containsSingletonActions=1) and (status=\\\"inactive\\\");\n\tselect \\\"    Completed single action lists\\\", count(*) from projectInfo where (containsSingletonActions=1) and (status=\\\"done\\\");\n\tselect \\\"    Dropped single action lists\\\", count(*) from projectInfo where (containsSingletonActions=1) and (( status=\\\"dropped\\\") or (folderEffectiveActive=0));\n\tselect null;\n\tselect \\\"CONTEXTS\\\", count(*) from context;\n\tselect \\\"    Active contexts\\\", count(*) from context where (effectiveActive=1) and (allowsNextAction=1);\n\tselect \\\"    On-hold contexts\\\", count(*) from context where (effectiveActive=1) and allowsNextAction=0;\n\tselect \\\"    Dropped contexts\\\", count(*) from context where effectiveActive=0;\n\tselect null;\n\tselect \\\"ACTION GROUPS\\\", count(*) from task where (projectinfo is null) and (childrenCount>0);\n\tselect \\\"    Remaining action groups\\\", count(*) from task where (projectinfo is null) and (dateCompleted is null) and (childrenCount>0);\n\tselect \\\"    Completed action groups\\\", count(dateCompleted) from task where (projectinfo is null) and (childrenCount>0);\n\tselect null;\n\tselect \\\"ACTIONS\\\", count(*) from task where (projectinfo is null) and (childrenCount=0);\n\tselect \\\"    Completed actions\\\", count(dateCompleted) from task where (projectinfo is null) and (childrenCount=0);\n\tselect \\\"    Dropped project actions\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp where (projectinfo is null) and (childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is not null and (tp.status=\\\"dropped\\\" or tp.folderEffectiveActive=0));\n\tselect \\\"    Dropped context actions\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand c.effectiveActive= 0;\n\tselect \\\"    Remaining actions\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1);\n\tselect \\\"        Actions in Projects on hold\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is not null and tp.status=\\\"inactive\\\");\n\tselect \\\"        Actions in Contexts on hold\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!=\\\"inactive\\\")\n\t\t\t\tand (tp.context is not null and c.allowsNextAction=0);\n\tselect \\\"        Blocked actions\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!=\\\"inactive\\\")\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1;\n\tselect \\\"        \tBlocked by future start date\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!=\\\"inactive\\\")\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=1;\n\tselect \\\"        \tSequentially blocked\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!=\\\"inactive\\\")\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=0;\n\tselect \\\"        Available actions\\\", count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !=\\\"dropped\\\" and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!=\\\"inactive\\\")\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=0;\n\t\t\t\t\n\t\")\n\t\n\t-- \t\ttry\n\tset strList to do shell script strCmd\n\t-- \t\ton error\n\t-- \t\t\tdisplay dialog \"The SQL schema for the OmniFocus cache may have changed in a recent update of OF.\" & return & return & \n\t-- \t\t\t\t\"Look on the OmniFocus user forums for an updated version of this script.\" buttons {\"OK\"} with title pTitle & \"Ver. \" & pVersion\n\t-- \t\t\treturn\n\t-- \t\tend try\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tif button returned of (display dialog strList buttons {pToClipboard, \"OK\"} default button \"OK\" giving up after pTimeOut with title pTitle & \" Ver. \" & pVersion) \n\t\t\tis pToClipboard then tell application id \"com.apple.finder\" to set the clipboard to strList\n\tend tell\nelse\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tdisplay dialog \"OmniFocus cache not found ...\" buttons {\"OK\"} default button 1 with title pTitle & \" Ver. \" & pVersion\n\tend tell\nend if\n\n\non FileExists(strPath)\n\t(do shell script \"test -e \" & strPath & \" ; echo $?\") = \"0\"\nend FileExists\n\non GetCachePath()\n\ttry\n\t\ttell application \"Finder\" to tell (application file id \"OFOC\") to \"$HOME\/Library\/Caches\/\" & its id & \"\/OmniFocusDatabase2\"\n\ton error\n\t\terror \"OmniFocus not installed ...\"\n\tend try\nend GetCachePath\n\n","subject":"paste in license","message":"paste in license\n","lang":"AppleScript","license":"apache-2.0","repos":"brettporter\/omnifocus-tools"}
{"commit":"e183496288fe064a8113987f3140fb0fac57c1c5","old_file":"itunes-concatenator\/itunes-concatenator\/DASAppDelegate.applescript","new_file":"itunes-concatenator\/itunes-concatenator\/DASAppDelegate.applescript","old_contents":"--\n--  DASAppDelegate.applescript\n--  itunes-concatenator\n--\n--  Created by David Schlachter on 2014-08-26.\n--  Copyright (c) 2014 Red Eft Software. All rights reserved.\n--\n\n-- via http:\/\/macscripter.net\/viewtopic.php?pid=173787 ; apparently needed for using arrays\n\nscript DASAppDelegate\n\tproperty parent : class \"NSObject\"\n\t\n    global these_files, these_times, these_titles, the_index, the_pipes, theCounter, cmdPrefix\n    \n\t-- IBOutlets\n\tproperty window : missing value\n    property trackTable : missing value\n    property catName : missing value\n    property catArtist : missing value\n    property catAlbum : missing value\n    property catComposer : missing value\n    property catGenre : missing value\n    property catTrack : missing value\n    property catTracks : missing value\n    property catDisc : missing value\n    property catDiscs : missing value\n    \n    -- Again, per macscripter, we'll set up bindings for the options\n    property pcatName : \"\"\n    property pcatArtist : \"\"\n    property pcatAlbum : \"\"\n    property pcatComposer : \"\"\n    property pcatGenre : \"\"\n    property pcatTrack : \"\"\n    property pcatTracks : \"\"\n    property pcatDisc : \"\"\n    property pcatDiscs : \"\"\n    \n    -- Empty strings for each file name and location\n    property pEachName : \"\"\n    property pEachLocation : \"\"\n    \n    property these_titles : {}\n    property these_files : {}\n    property these_times: {}\n    property the_index: {}\n    property the_pipes: {}\n    \n    property theCounter : \"\"\n    property cmdPrefix : \"if [[ -r \/etc\/profile ]];then . \/etc\/profile;fi;if [[ -r ~\/.bashrc ]];then . ~\/.bashrc;fi;if [[ -r ~\/.bash_profile ]];then . ~\/.bash_profile;fi;\"\n    \n    on awakeFromNib()\n        --\n        -- Check for FFMPEG and MP4v2\n        --\n        -- (This works, but it's ugly!)\n        --\n        --\n        try\n            do shell script cmdPrefix & \" if [ -x \\\"`\/usr\/bin\/which ffmpeg`\\\" ];then exit 0;else exit 1;fi\"\n        on error number error_number\n            display dialog \"You must install FFMPEG and MP4v2 to continue. \\n\\nYou may have to install Xcode Command Line Tools and Homebrew first. If you continue, we'll attempt to install them for you if they are not already present. \\n\\nIf you have already installed FFMPEG and MP4v2, ensure that they are in your bash path.\" buttons {\"Quit\",\"Install\"} default button 2\n            If button returned of result is \"Install\" then\n                try\n                    tell application \"Terminal\"\n                        -- TODO: This should be cleaner -- Terminal in front, only one window, focus back to the cat'er afterwards\n                        set newTab to do script cmdPrefix & \"if [[ -x `which brew` ]];then brew install ffmpeg;else \/usr\/bin\/ruby -e \\\"$(\/usr\/bin\/curl -fsSL https:\/\/raw.github.com\/Homebrew\/homebrew\/go\/install)\\\";brew install ffmpeg mp4v2;fi\"\n                        delay 4\n                        repeat\n                            delay 0.1\n                            if not busy of newTab then exit repeat\n                        end repeat\n                    end tell\n                     -- TODO: This needs a better test, i.e., check if ffmpeg is actually accessible on the path\n                    display dialog \"FFMPEG was successfully installed\"\n                    -- TODO: This should actually work! (Bring us back to the foreground)\n                    activate current application\n                on error number error_number\n                    display dialog \"FFMPEG did not successfully install\"\n                end try\n            end If\n            If button returned of result is \"Quit\" then\n                -- Fix!\n                current application's NSApp's terminate()\n            end If\n        end try\n    end awakeFromNib\n\n\n    on btnGetTracks_(sender)\n        -- Code to add iTunes tracks to our list\n        -- via http:\/\/dougscripts.com\/itunes\/itinfo\/info02.php and http:\/\/www.randomsequence.com\/articles\/applescript-to-send-selected-itunes-tracks-using-mail\/\n        tell application \"iTunes\"\n            set these_titles to {}\n            set these_times to {}\n            set these_files to {}\n            set the_index to {}\n            if selection is not {} then -- there ARE tracks selected...\n                set mySelection to selection\n                set i to 1\n                repeat with aTrack in mySelection\n                    if class of aTrack is file track then\n                        set end of these_titles to ((name of aTrack) as string)\n                        set end of these_times to ((time of aTrack) as string)\n                        set end of these_files to (posix path of (get location of aTrack))\n                        set end of the_index to (count of these_titles)\n                        -- Get metadata from the first track\n                        if i is 1 then\n                            set pcatArtist to ((artist of aTrack) as string)\n                            set pcatAlbum to ((album of aTrack) as string)\n                            set pcatComposer to ((composer of aTrack) as string)\n                            set pcatGenre to ((genre of aTrack) as string)\n                            set pcatDisc to ((disc number of aTrack) as string)\n                            set pcatDiscs to ((disc count of aTrack) as string)\n                        end if\n                        set i to (i + 1)\n                    end if\n                end repeat\n            end if\n        end tell\n        -- via http:\/\/stackoverflow.com\/questions\/25537750\/setstringvalue-with-applescript-list\n        set olddelimeters to AppleScript's text item delimiters\n        set AppleScript's text item delimiters to \"\\n\"\n        set disp_titles to these_titles as string\n        trackTable's setStringValue_(disp_titles)\n        set AppleScript's text item delimiters to olddelimeters\n    end btnGetTracks_\n\n    on btnConcatenate_(sender)\n        set the_pipes to {}\n        repeat with theIndex in the_index\n            -- TODO: Needs error checking!\n            -- TODO: We need to check what kind of audio files we have, then adjust accordingly\n            do shell script (cmdPrefix & \"ffmpeg -i \\\"\" & (item theIndex of these_files as text) & \"\\\" -c copy -bsf:v h264_mp4toannexb -f mpegts \/private\/tmp\/concat\" & theIndex & \".ts 2> \/dev\/null\" as text)\n            log (\"Processed file number\" & theIndex) as text\n            set end of the_pipes to (\"\/private\/tmp\/concat\" & theIndex & \".ts\" as text)\n        end repeat\n        -- Run the actual concatenation command in ffmpeg (for mp4\/AAC files only!)\n        -- via https:\/\/trac.ffmpeg.org\/wiki\/How%20to%20concatenate%20(join,%20merge)%20media%20files\n        set olddelimeters to AppleScript's text item delimiters\n        set AppleScript's text item delimiters to \"|\"\n        set disp_thepipes to the_pipes as string\n        do shell script (cmdPrefix & \"ffmpeg -f mpegts -i \\\"concat:\" & (disp_thepipes as text) & \"\\\" -c copy -bsf:a aac_adtstoasc \/private\/tmp\/cat.mp4\")\n        set AppleScript's text item delimiters to olddelimeters\n        -- Log some debugging information\n        log (pcatArtist as string)\n        log (pcatAlbum as string)\n        log (pcatComposer as string)\n        log (pcatGenre as string)\n        log (pcatDisc as string)\n        log (pcatDiscs as string)\n        -- Now let's create the chapter file\n        repeat with theIndex in the_index\n            if theIndex < 2 then\n                do shell script (\"\/bin\/echo \\\"00:00:00.000 \" & (item theIndex of these_titles as text) & \"\\\" > \/private\/tmp\/cat.chapters.txt\" as text)\n                set theCounter to (do shell script (cmdPrefix & \"ffprobe -loglevel panic -show_streams \/private\/tmp\/concat\" & (theIndex as text) & \".ts | egrep -m 1 'duration=[0-9]+\\\\.' | sed 's\/duration=\\\\([0-9]*[0-9]\\\\)\\\\.[0-9]*\/\\\\1\/'\" as text) as string)\n            else\n                set theDateStamp to do shell script (cmdPrefix & \"t=\"& (theCounter as text) & \";((sec=t%60, t\/=60, min=t%60, hrs=t\/60));timestamp=$(printf \\\"%02d:%02d:%02d\\\" $hrs $min $sec);\/bin\/echo $timestamp\" as text)\n                do shell script (\"\/bin\/echo \\\"\" & (theDateStamp as text) & \".000 \" & (item theIndex of these_titles as text) & \"\\\" >> \/private\/tmp\/cat.chapters.txt\" as text)\n                log (\"Before the addition, theCounter is \" & theCounter) as text\n                set theCounter to do shell script (cmdPrefix & \"t=\" & theCounter & \";t=`echo $t\\\"+\\\\`ffprobe -loglevel panic -show_streams \/private\/tmp\/concat\" & (theIndex as text) & \".ts | egrep -m 1 'duration=[0-9]+\\\\.' | sed 's\/duration=\\\\([0-9]*[0-9]\\\\)\\\\.[0-9]*\/\\\\1\/'\\\\`\\\" | bc`;echo $t\" as text)\n                log (\"After the addition, theCounter is \" & theCounter) as text\n            end if\n        end repeat\n        -- Chapterize cat.mp4\n        do shell script (cmdPrefix & \"mp4chaps -i \/private\/tmp\/cat.mp4\" as text)\n        -- Clean up\n        do shell script \"\/bin\/rm \/private\/tmp\/concat* \/private\/tmp\/cat.chapters.txt \/private\/tmp\/cat.mp4\"\n        set theCounter to \"\"\n    end btnConcatenate_\n\n\n\ton applicationWillFinishLaunching_(aNotification)\n\t\t-- Insert code here to initialize your application before any files are opened\n\tend applicationWillFinishLaunching_\n\n\ton applicationShouldTerminate_(sender)\n\t\t-- Insert code here to do any housekeeping before your application quits\n\t\treturn current application's NSTerminateNow\n\tend applicationShouldTerminate_\n\nend script","new_contents":"--\n--  DASAppDelegate.applescript\n--  itunes-concatenator\n--\n--  Created by David Schlachter on 2014-08-26.\n--  Copyright (c) 2014 Red Eft Software. All rights reserved.\n--\n\n-- via http:\/\/macscripter.net\/viewtopic.php?pid=173787 ; apparently needed for using arrays\n\nscript DASAppDelegate\n\tproperty parent : class \"NSObject\"\n\t\n    global these_files, these_times, these_titles, the_index, the_pipes, theCounter, cmdPrefix\n    \n\t-- IBOutlets\n\tproperty window : missing value\n    property trackTable : missing value\n    property catName : missing value\n    property catArtist : missing value\n    property catAlbum : missing value\n    property catComposer : missing value\n    property catGenre : missing value\n    property catTrack : missing value\n    property catTracks : missing value\n    property catDisc : missing value\n    property catDiscs : missing value\n    \n    -- Again, per macscripter, we'll set up bindings for the options\n    property pcatName : \"\"\n    property pcatArtist : \"\"\n    property pcatAlbum : \"\"\n    property pcatComposer : \"\"\n    property pcatGenre : \"\"\n    property pcatTrack : \"\"\n    property pcatTracks : \"\"\n    property pcatDisc : \"\"\n    property pcatDiscs : \"\"\n    \n    -- Empty strings for each file name and location\n    property pEachName : \"\"\n    property pEachLocation : \"\"\n    \n    property these_titles : {}\n    property these_files : {}\n    property these_times: {}\n    property the_index: {}\n    property the_pipes: {}\n    \n    property theCounter : \"\"\n    property cmdPrefix : \"if [[ -r \/etc\/profile ]];then . \/etc\/profile;fi;if [[ -r ~\/.bashrc ]];then . ~\/.bashrc;fi;if [[ -r ~\/.bash_profile ]];then . ~\/.bash_profile;fi;\"\n    \n    on awakeFromNib()\n        --\n        -- Check for FFMPEG and MP4v2\n        --\n        -- (This works, but it's ugly!)\n        --\n        --\n        try\n            do shell script cmdPrefix & \" if [ -x \\\"`\/usr\/bin\/which ffmpeg`\\\" ];then exit 0;else exit 1;fi\"\n        on error number error_number\n            display dialog \"You must install FFMPEG and MP4v2 to continue. \\n\\nYou may have to install Xcode Command Line Tools and Homebrew first. If you continue, we'll attempt to install them for you if they are not already present. \\n\\nIf you have already installed FFMPEG and MP4v2, ensure that they are in your bash path.\" buttons {\"Quit\",\"Install\"} default button 2\n            If button returned of result is \"Install\" then\n                try\n                    tell application \"Terminal\"\n                        -- TODO: This should be cleaner -- Terminal in front, only one window, focus back to the cat'er afterwards\n                        set newTab to do script cmdPrefix & \"if [[ -x `which brew` ]];then brew install ffmpeg;else \/usr\/bin\/ruby -e \\\"$(\/usr\/bin\/curl -fsSL https:\/\/raw.github.com\/Homebrew\/homebrew\/go\/install)\\\";brew install ffmpeg mp4v2;fi\"\n                        delay 4\n                        repeat\n                            delay 0.1\n                            if not busy of newTab then exit repeat\n                        end repeat\n                    end tell\n                     -- TODO: This needs a better test, i.e., check if ffmpeg is actually accessible on the path\n                    display dialog \"FFMPEG was successfully installed\"\n                    -- TODO: This should actually work! (Bring us back to the foreground)\n                    activate current application\n                on error number error_number\n                    display dialog \"FFMPEG did not successfully install\"\n                end try\n            end If\n            If button returned of result is \"Quit\" then\n                -- Fix!\n                current application's NSApp's terminate()\n            end If\n        end try\n    end awakeFromNib\n\n\n    on btnGetTracks_(sender)\n        -- Code to add iTunes tracks to our list\n        -- via http:\/\/dougscripts.com\/itunes\/itinfo\/info02.php and http:\/\/www.randomsequence.com\/articles\/applescript-to-send-selected-itunes-tracks-using-mail\/\n        tell application \"iTunes\"\n            set these_titles to {}\n            set these_times to {}\n            set these_files to {}\n            set the_index to {}\n            if selection is not {} then -- there ARE tracks selected...\n                set mySelection to selection\n                set i to 1\n                repeat with aTrack in mySelection\n                    if class of aTrack is file track then\n                        set end of these_titles to ((name of aTrack) as string)\n                        set end of these_times to ((time of aTrack) as string)\n                        set end of these_files to (posix path of (get location of aTrack))\n                        set end of the_index to (count of these_titles)\n                        -- Get metadata from the first track\n                        if i is 1 then\n                            set pcatArtist to ((artist of aTrack) as string)\n                            set pcatAlbum to ((album of aTrack) as string)\n                            set pcatComposer to ((composer of aTrack) as string)\n                            set pcatGenre to ((genre of aTrack) as string)\n                            set pcatDisc to ((disc number of aTrack) as string)\n                            set pcatDiscs to ((disc count of aTrack) as string)\n                        end if\n                        set i to (i + 1)\n                    end if\n                end repeat\n            end if\n        end tell\n        -- Display the songs to be concatenated\n        -- via http:\/\/stackoverflow.com\/questions\/25537750\/setstringvalue-with-applescript-list\n        set olddelimeters to AppleScript's text item delimiters\n        set AppleScript's text item delimiters to \"\\n\"\n        set disp_titles to these_titles as string\n        trackTable's setStringValue_(disp_titles)\n        set AppleScript's text item delimiters to olddelimeters\n        -- Update the default metadata\n        catArtist's setStringValue_(pcatArtist)\n        catAlbum's setStringValue_(pcatAlbum)\n        catComposer's setStringValue_(pcatComposer)\n        catGenre's setStringValue_(pcatGenre)\n        catDisc's setStringValue_(pcatDisc)\n        catDiscs's setStringValue_(pcatDiscs)\n    end btnGetTracks_\n\n    on btnConcatenate_(sender)\n        set the_pipes to {}\n        repeat with theIndex in the_index\n            -- TODO: Needs error checking!\n            -- TODO: We need to check what kind of audio files we have, then adjust accordingly\n            do shell script (cmdPrefix & \"ffmpeg -i \\\"\" & (item theIndex of these_files as text) & \"\\\" -c copy -bsf:v h264_mp4toannexb -f mpegts \/private\/tmp\/concat\" & theIndex & \".ts 2> \/dev\/null\" as text)\n            log (\"Processed file number\" & theIndex) as text\n            set end of the_pipes to (\"\/private\/tmp\/concat\" & theIndex & \".ts\" as text)\n        end repeat\n        -- Run the actual concatenation command in ffmpeg (for mp4\/AAC files only!)\n        -- via https:\/\/trac.ffmpeg.org\/wiki\/How%20to%20concatenate%20(join,%20merge)%20media%20files\n        set olddelimeters to AppleScript's text item delimiters\n        set AppleScript's text item delimiters to \"|\"\n        set disp_thepipes to the_pipes as string\n        do shell script (cmdPrefix & \"ffmpeg -f mpegts -i \\\"concat:\" & (disp_thepipes as text) & \"\\\" -c copy -bsf:a aac_adtstoasc \/private\/tmp\/cat.mp4\")\n        set AppleScript's text item delimiters to olddelimeters\n        -- Log some debugging information\n        log (pcatArtist as string)\n        log (pcatAlbum as string)\n        log (pcatComposer as string)\n        log (pcatGenre as string)\n        log (pcatDisc as string)\n        log (pcatDiscs as string)\n        -- Now let's create the chapter file\n        repeat with theIndex in the_index\n            if theIndex < 2 then\n                do shell script (\"\/bin\/echo \\\"00:00:00.000 \" & (item theIndex of these_titles as text) & \"\\\" > \/private\/tmp\/cat.chapters.txt\" as text)\n                set theCounter to (do shell script (cmdPrefix & \"ffprobe -loglevel panic -show_streams \/private\/tmp\/concat\" & (theIndex as text) & \".ts | egrep -m 1 'duration=[0-9]+\\\\.' | sed 's\/duration=\\\\([0-9]*[0-9]\\\\)\\\\.[0-9]*\/\\\\1\/'\" as text) as string)\n            else\n                set theDateStamp to do shell script (cmdPrefix & \"t=\"& (theCounter as text) & \";((sec=t%60, t\/=60, min=t%60, hrs=t\/60));timestamp=$(printf \\\"%02d:%02d:%02d\\\" $hrs $min $sec);\/bin\/echo $timestamp\" as text)\n                do shell script (\"\/bin\/echo \\\"\" & (theDateStamp as text) & \".000 \" & (item theIndex of these_titles as text) & \"\\\" >> \/private\/tmp\/cat.chapters.txt\" as text)\n                log (\"Before the addition, theCounter is \" & theCounter) as text\n                set theCounter to do shell script (cmdPrefix & \"t=\" & theCounter & \";t=`echo $t\\\"+\\\\`ffprobe -loglevel panic -show_streams \/private\/tmp\/concat\" & (theIndex as text) & \".ts | egrep -m 1 'duration=[0-9]+\\\\.' | sed 's\/duration=\\\\([0-9]*[0-9]\\\\)\\\\.[0-9]*\/\\\\1\/'\\\\`\\\" | bc`;echo $t\" as text)\n                log (\"After the addition, theCounter is \" & theCounter) as text\n            end if\n        end repeat\n        -- Chapterize cat.mp4\n        do shell script (cmdPrefix & \"mp4chaps -i \/private\/tmp\/cat.mp4\" as text)\n        -- Clean up\n        do shell script \"\/bin\/rm \/private\/tmp\/concat* \/private\/tmp\/cat.chapters.txt \/private\/tmp\/cat.mp4\"\n        set theCounter to \"\"\n    end btnConcatenate_\n\n\n\ton applicationWillFinishLaunching_(aNotification)\n\t\t-- Insert code here to initialize your application before any files are opened\n\tend applicationWillFinishLaunching_\n\n\ton applicationShouldTerminate_(sender)\n\t\t-- Insert code here to do any housekeeping before your application quits\n\t\treturn current application's NSTerminateNow\n\tend applicationShouldTerminate_\n\nend script","subject":"Update the text fields when tracks are loaded","message":"Update the text fields when tracks are loaded\n","lang":"AppleScript","license":"bsd-2-clause","repos":"davidschlachter\/itunes-concatenator,davidschlachter\/itunes-concatenator"}
{"commit":"8ddc6261bdb01edc697bf745d38d434e3bbd921d","old_file":"scripts\/reset_simulator.applescript","new_file":"scripts\/reset_simulator.applescript","old_contents":"(* commented out printer section for now\ntell application \"iPhone Simulator\" to activate\n\ntell application \"System Events\"\n    tell process \"iPhone Simulator\"\n        tell menu bar 1\n            tell menu bar item \"File\"\n                tell menu \"File\"\n                    click menu item \"Open Printer Simulator\"\n                end tell\n            end tell\n        end tell\n    end tell\nend tell\n*)\n\ntell application \"iPhone Simulator\" to launch\n\nset inTime to current date\nrepeat\n    tell application \"System Events\"\n        if \"iPhone Simulator\" is in (get name of processes) then exit repeat\n    end tell\n    if (current date) - inTime is greater than 10 then exit repeat\n    delay 0.2\nend repeat\n\ntell application \"iPhone Simulator\" to activate\n\nset inTime to current date\nrepeat\n    tell application \"System Events\"\n        if visible of process \"iPhone Simulator\" is true then exit repeat\n    end tell\n    if (current date) - inTime is greater than 10 then exit repeat\n    delay 0.2\nend repeat\n\ntell application \"System Events\"\n    tell process \"iPhone Simulator\"\n        tell menu bar 1\n            tell menu bar item \"iOS Simulator\"\n                tell menu \"iOS Simulator\"\n                    click menu item \"Reset Content and Settings\u2026\"\n                end tell\n            end tell\n        end tell\n\n        tell window 1\n            click button \"Reset\"\n        end tell\n    end tell\nend tell\n\ntell application \"iPhone Simulator\" to quit\n\nset inTime to current date\nrepeat\n    tell application \"System Events\"\n        if \"iPhone Simulator\" is not in (get name of processes) then exit repeat\n    end tell\n    if (current date) - inTime is greater than 10 then exit repeat\n    delay 0.2\nend repeat\n\n\n-- tell application \"System Events\" to tell process \"Printer Simulator\" to set visible to false\n","new_contents":"(* commented out printer section for now\ntell application \"iPhone Simulator\" to activate\n\ntell application \"System Events\"\n    tell process \"iPhone Simulator\"\n        tell menu bar 1\n            tell menu bar item \"File\"\n                tell menu \"File\"\n                    click menu item \"Open Printer Simulator\"\n                end tell\n            end tell\n        end tell\n    end tell\nend tell\n*)\n\ntell application \"iOS Simulator\" to launch\n\nset inTime to current date\nrepeat\n    tell application \"System Events\"\n        if \"iOS Simulator\" is in (get name of processes) then exit repeat\n    end tell\n    if (current date) - inTime is greater than 10 then exit repeat\n    delay 0.2\nend repeat\n\ntell application \"iOS Simulator\" to activate\n\nset inTime to current date\nrepeat\n    tell application \"System Events\"\n        if visible of process \"iOS Simulator\" is true then exit repeat\n    end tell\n    if (current date) - inTime is greater than 10 then exit repeat\n    delay 0.2\nend repeat\n\ntell application \"System Events\"\n    tell process \"iOS Simulator\"\n        tell menu bar 1\n            tell menu bar item \"iOS Simulator\"\n                tell menu \"iOS Simulator\"\n                    click menu item \"Reset Content and Settings\u2026\"\n                end tell\n            end tell\n        end tell\n\n        tell window 1\n            click button \"Reset\"\n        end tell\n    end tell\nend tell\n\ntell application \"iOS Simulator\" to quit\n\nset inTime to current date\nrepeat\n    tell application \"System Events\"\n        if \"iOS Simulator\" is not in (get name of processes) then exit repeat\n    end tell\n    if (current date) - inTime is greater than 10 then exit repeat\n    delay 0.2\nend repeat\n\n\n-- tell application \"System Events\" to tell process \"Printer Simulator\" to set visible to false\n","subject":"fix apple script","message":"fix apple script\n","lang":"AppleScript","license":"apache-2.0","repos":"ifreecarve\/Illuminator,ifreecarve\/Illuminator,ifreecarve\/Illuminator,drptbl\/Illuminator,drptbl\/Illuminator,drptbl\/Illuminator,ifreecarve\/Illuminator,paypal\/Illuminator,drptbl\/Illuminator,paypal\/Illuminator"}
{"commit":"acc8f3bba9d56463f8409c498fedf0bd403bc212","old_file":"applescripts\/open_chrome_tabs.applescript","new_file":"applescripts\/open_chrome_tabs.applescript","old_contents":"set myTabs to {\"http:\/\/app.getsentry.com\/\", \"http:\/\/github.com\/uberVU\/thehole\/issues\/assigned\/palcu?direction=desc&labels=&milestone=&page=1&sort=updated&state=open\/\", \"https:\/\/mail.google.com\/mail\/u\/1\/?shva=1#inbox\", \"https:\/\/drive.google.com\/a\/hootsuite.com\/#folders\/0BwuFsHJDxJWPYmxXQ1VQVlN6T2M\"}\ntell application \"Google Chrome\"\n\tactivate\n\trepeat with i in myTabs\n\t\topen location i\n\tend repeat\nend tell\n","new_contents":"set myTabs to {\"https:\/\/github.com\/search?utf8=%E2%9C%93&q=assignee%3Apalcu+state%3Aopen&type=Issues&ref=searchresults\", \"https:\/\/mail.google.com\/mail\/u\/1\/?shva=1#inbox\", \"https:\/\/drive.google.com\/a\/hootsuite.com\/#folders\/0BwuFsHJDxJWPYmxXQ1VQVlN6T2M\"}\ntell application \"Google Chrome\"\n\tactivate\n\trepeat with i in myTabs\n\t\topen location i\n\tend repeat\nend tell\n","subject":"Update URLs that open at the office","message":"Update URLs that open at the office\n","lang":"AppleScript","license":"mit","repos":"smathson\/dotfiles"}
{"commit":"96de2530f5a16698e08b5e9708ac0f2effe7d514","old_file":"applescripts\/quit_after_work.applescript","new_file":"applescripts\/quit_after_work.applescript","old_contents":"set current_path to POSIX path of ((path to me as text) & \"::\")\n\n-- get work apps\nset appList to {}\nset myApps to paragraphs of (read current_path & \"apps.txt\")\nrepeat with nextLine in myApps\n\tif length of nextLine is greater than 0 then\n\t\tcopy (nextLine as string) to the end of appList\n\tend if\nend repeat\n\n-- close work apps\nrepeat with i in appList\n\ttell application i\n\t\tquit\n\tend tell\nend repeat\n\n-- run other scripts from folder\nset scriptList to {\"clean_repos\", \"halt_vagrant\"}\nrepeat with i in scriptList\n\trun script current_path & i & \".applescript\"\nend repeat\n","new_contents":"set current_path to POSIX path of ((path to me as text) & \"::\")\n\n-- get work apps\nset appList to {}\nset myApps to paragraphs of (read current_path & \"apps.txt\")\nrepeat with nextLine in myApps\n\tif length of nextLine is greater than 0 then\n\t\tcopy (nextLine as string) to the end of appList\n\tend if\nend repeat\n\n-- close work apps\nrepeat with i in appList\n\ttell application i\n\t\tquit\n\tend tell\nend repeat\n\n-- run other scripts from folder\nset scriptList to {\"halt_vagrant\"}\nrepeat with i in scriptList\n\trun script current_path & i & \".applescript\"\nend repeat\n","subject":"Remove clean_repos","message":"Remove clean_repos\n","lang":"AppleScript","license":"mit","repos":"smathson\/dotfiles"}
{"commit":"cf8622b0f042801ab8692e2eb43371dff3ebdb60","old_file":"status.applescript","new_file":"status.applescript","old_contents":"tell application \"Finder\"\n\tset json_path to file \"json.scpt\" of folder of (path to me)\nend tell\nset json to load script (json_path as alias)\n\non is_running(appName)\n\ttell application \"System Events\" to (name of processes) contains appName\nend is_running\n\nset reply to json's createDict()\nif is_running(\"Hermes\") then\n\treply's setkv(\"running\", true)\n\tset hermesInfo to json's createDict()\n--\tset hermesStations to json's createDict()\n\ttell application \"Hermes\"\n\t\thermesInfo's setkv(\"state\", playback state as string)\n\t\thermesInfo's setkv(\"volume\", playback volume)\n\n-- XXX: execution error: Hermes got an error: every station doesn\u2019t understand the \u201ccount\u201d message. (-1708)\n--\t\trepeat with theStation in stations\n--\t\t\thermesStations's setkv(\"name\", theStation's name)\n--\t\t\thermesStations's setkv(\"id\", theStation's station ID)\n--\t\tend repeat\n\n\t\thermesInfo's setkv(\"title\", current song's title)\n\t\thermesInfo's setkv(\"artist\", current song's artist)\n\t\thermesInfo's setkv(\"album\", current song's album)\n\t\thermesInfo's setkv(\"artwork\", current song's artwork URL)\n\t\thermesInfo's setkv(\"rating\", current song's rating)\n\t\thermesInfo's setkv(\"position\", playback position as integer)\n\t\thermesInfo's setkv(\"duration\", current song duration as integer)\n\t\thermesInfo's setkv(\"station_name\", current station's name)\n\t\thermesInfo's setkv(\"station_id\", current station's station ID)\n\tend tell\n--\thermesInfo's setkv(\"stations\", hermesStations)\n\treply's setkv(\"info\", hermesInfo)\nelse\n\treply's setkv(\"running\", false)\nend if\nreply's setkv(\"time\", (do shell script \"date -u +%s\"))\nreturn reply's toJson()\n","new_contents":"tell application \"Finder\"\n\tset json_path to file \"json.scpt\" of folder of (path to me)\nend tell\nset json to load script (json_path as alias)\n\non is_running(appName)\n\ttell application \"System Events\" to (name of processes) contains appName\nend is_running\n\non hermes_status()\n\tglobal json\n\tset reply to json's createDict()\n\tif is_running(\"Hermes\") then\n\t\treply's setkv(\"running\", true)\n\t\tset hermesInfo to json's createDict()\n--\t\tset hermesStations to json's createDict()\n\t\ttell application \"Hermes\"\n\t\t\thermesInfo's setkv(\"state\", playback state as string)\n\t\t\thermesInfo's setkv(\"volume\", playback volume)\n\n--\t\t\tXXX: execution error: Hermes got an error: every station doesn\u2019t understand the \u201ccount\u201d message. (-1708)\n--\t\t\trepeat with theStation in stations\n--\t\t\t\thermesStations's setkv(\"name\", theStation's name)\n--\t\t\t\thermesStations's setkv(\"id\", theStation's station ID)\n--\t\t\tend repeat\n\n\t\t\thermesInfo's setkv(\"title\", current song's title)\n\t\t\thermesInfo's setkv(\"artist\", current song's artist)\n\t\t\thermesInfo's setkv(\"album\", current song's album)\n\t\t\thermesInfo's setkv(\"artwork\", current song's artwork URL)\n\t\t\thermesInfo's setkv(\"rating\", current song's rating)\n\t\t\thermesInfo's setkv(\"position\", playback position as integer)\n\t\t\thermesInfo's setkv(\"duration\", current song duration as integer)\n\t\t\thermesInfo's setkv(\"station_name\", current station's name)\n\t\t\thermesInfo's setkv(\"station_id\", current station's station ID)\n\t\tend tell\n--\t\thermesInfo's setkv(\"stations\", hermesStations)\n\t\treply's setkv(\"info\", hermesInfo)\n\telse\n\t\treply's setkv(\"running\", false)\n\tend if\n\treply's setkv(\"time\", (do shell script \"date -u +%s\"))\n\treturn reply's toJson()\nend hermes_status\n\nreturn hermes_status()\n","subject":"Move script logic into hermes_status()","message":"Move script logic into hermes_status()\n","lang":"AppleScript","license":"mit","repos":"winny-\/HermesRemote,winny-\/HermesRemote"}
{"commit":"d0fc04949107552ad4ea8a8f4f296317b46bb12f","old_file":"etc\/pdf.scpt","new_file":"etc\/pdf.scpt","old_contents":"############################\n# How to generate the PDFs #\n############################\n# 1. Generate Cover.pdf with latest version date\n#    a. Create \"ebook\" folder in ~\/Downloads\n#    b. update date in cover.html\n#    c. open in safari file:\/\/\/Users\/frank\/Sites\/ServerlessStackCom\/etc\/cover.html\n#    d. \"Export to PDF\u2026\"\n#    e. Place Cover.pdf in ~\/ebook folder\n# 2. Ensure \"ebook\" folder is an option when \"Export to PDF\u2026\" in Safari\n# 3. In terminal, run \"osascript pdf.scpt\"\n\n\nset theChaptersStr to \"who-is-this-guide-for\nwhat-does-this-guide-cover\nhow-to-get-help\nwhat-is-serverless\nwhat-is-aws-lambda\nwhy-create-serverless-apps\ncreate-an-aws-account\ncreate-an-iam-user\nwhat-is-iam\nwhat-is-an-arn\nconfigure-the-aws-cli\ncreate-a-dynamodb-table\ncreate-an-s3-bucket-for-file-uploads\ncreate-a-cognito-user-pool\ncreate-a-cognito-test-user\nsetup-the-serverless-framework\nadd-support-for-es6-es7-javascript\ninitialize-the-backend-repo\nadd-a-create-note-api\nadd-a-get-note-api\nadd-a-list-all-the-notes-api\nadd-an-update-note-api\nadd-a-delete-note-api\nworking-with-3rd-party-apis\nsetup-a-stripe-account\nadd-a-billing-api\nload-secrets-from-env\ntest-the-billing-api\nunit-tests-in-serverless\nhandle-api-gateway-cors-errors\ndeploy-the-apis\ncreate-a-cognito-identity-pool\ncognito-user-pool-vs-identity-pool\ntest-the-apis\ncreate-a-new-reactjs-app\ninitialize-the-frontend-repo\nadd-app-favicons\nsetup-custom-fonts\nsetup-bootstrap\nhandle-routes-with-react-router\ncreate-containers\nadding-links-in-the-navbar\nhandle-404s\nconfigure-aws-amplify\ncreate-a-login-page\nlogin-with-aws-cognito\nadd-the-session-to-the-state\nload-the-state-from-the-session\nclear-the-session-on-logout\nredirect-on-login-and-logout\ngive-feedback-while-logging-in\ncreate-a-custom-react-hook-to-handle-form-fields\ncreate-a-signup-page\ncreate-the-signup-form\nsignup-with-aws-cognito\nadd-the-create-note-page\ncall-the-create-api\nupload-a-file-to-s3\nlist-all-the-notes\ncall-the-list-api\ndisplay-a-note\nrender-the-note-form\nsave-changes-to-a-note\ndelete-a-note\ncreate-a-settings-page\nadd-stripe-keys-to-config\ncreate-a-billing-form\nconnect-the-billing-form\nsetup-secure-pages\ncreate-a-route-that-redirects\nuse-the-redirect-routes\nredirect-on-login\ngetting-production-ready\nwhat-is-infrastructure-as-code\nconfigure-dynamodb-in-serverless\nconfigure-s3-in-serverless\nconfigure-cognito-user-pool-in-serverless\nconfigure-cognito-identity-pool-in-serverless\ndeploy-your-serverless-infrastructure\nautomating-serverless-deployments\nsetting-up-your-project-on-seed\nconfigure-secrets-in-seed\ndeploying-through-seed\nset-custom-domains-through-seed\ntest-the-configured-apis\nautomating-react-deployments\nmanage-environments-in-create-react-app\ncreate-a-build-script\nsetting-up-your-project-on-netlify\ncustom-domain-in-netlify\nfrontend-workflow\ndebugging-full-stack-serverless-apps\nsetup-error-reporting-in-react\nreport-api-errors-in-react\nsetup-an-error-boundary-in-react\nsetup-error-logging-in-serverless\nlogic-errors-in-lambda-functions\nunexpected-errors-in-lambda-functions\nerrors-outside-lambda-functions\nerrors-in-api-gateway\nwrapping-up\nfurther-reading\ntranslations\ngiving-back\nchangelog\nstaying-up-to-date\nbest-practices-for-building-serverless-apps\norganizing-serverless-projects\ncross-stack-references-in-serverless\ndynamodb-as-a-serverless-service\ns3-as-a-serverless-service\ncognito-as-a-serverless-service\nshare-code-between-services\nshare-an-api-endpoint-between-services\ndeploy-a-serverless-app-with-dependencies\nenvironments-in-serverless-apps\nstructure-environments-across-aws-accounts\nmanage-aws-accounts-using-aws-organizations\nparameterize-serverless-resources-names\ndeploying-to-multiple-aws-accounts\ndeploy-the-resources-repo\ndeploy-the-api-services-repo\nmanage-environment-related-config\nstoring-secrets-in-serverless-apps\nshare-route-53-domains-across-aws-accounts\nmonitor-usage-for-environments\nworking-on-serverless-apps\ninvoke-lambda-functions-locally\ninvoke-api-gateway-endpoints-locally\ncreating-feature-environments\ncreating-pull-request-environments\npromoting-to-production\nrollback-changes\ndeploying-only-updated-services\ntracing-serverless-apps-with-x-ray\nwrapping-up-the-best-practices\napi-gateway-and-lambda-logs\ndebugging-serverless-api-issues\nserverless-environment-variables\nstages-in-serverless-framework\nbackups-in-dynamodb\nconfigure-multiple-aws-profiles\ncustomize-the-serverless-iam-policy\nmapping-cognito-identity-id-and-user-pool-id\nconnect-to-api-gateway-with-iam-auth\nserverless-nodejs-starter\npackage-lambdas-with-serverless-bundle\nunderstanding-react-hooks\ncode-splitting-in-create-react-app\nenvironments-in-create-react-app\ndeploying-a-react-app-to-aws\ncreate-an-s3-bucket\ndeploy-to-s3\ncreate-a-cloudfront-distribution\nsetup-your-domain-with-cloudfront\nsetup-www-domain-redirect\nsetup-ssl\ndeploy-updates\nmanage-user-accounts-in-aws-amplify\nhandle-forgot-and-reset-password\nallow-users-to-change-passwords\nallow-users-to-change-their-email\nfacebook-login-with-cognito-using-aws-amplify\"\n\nset text item delimiters to \"\n\"\n\nset theChapters to text items of theChaptersStr\n\n\n########\n# Main #\n########\ndownloadPdfs(theChapters)\nmergePdfs(theChapters)\n\n##############\n# Merge PDFs #\n##############\non mergePdfs(theChapters)\n  set outputFile to \"~\/Downloads\/ebook\/ServerlessStack.pdf\"\n\n  set pdfFiles to \"~\/Downloads\/ebook\/Cover.pdf\"\n  repeat with theCurrentChapter in theChapters\n    set pdfFiles to pdfFiles & \" ~\/Downloads\/ebook\/\" & theCurrentChapter & \".pdf\"\n  end repeat\n\n  do shell script \"\/System\/Library\/Automator\/Combine\\\\ PDF\\\\ Pages.action\/Contents\/Resources\/join.py \" & \"-o \" & outputFile & \" \" & pdfFiles\nend mergePdfs\n\n#################\n# Download PDFs #\n#################\non downloadPdfs(theChapters)\n  repeat with theCurrentChapter in theChapters\n    if not(checkFileExist(theCurrentChapter)) then\n      downloadPdf(theCurrentChapter)\n    end if\n  end repeat\nend downloadPdfs\n\non checkFileExist(theChapterName)\n  set basePath to POSIX path of (path to home folder) & \"Downloads\/ebook\/\"\n\n  tell application \"Finder\"\n    return exists basePath & theChapterName & \".pdf\" as POSIX file\n  end tell\nend checkFileExist\n\non downloadPdf(theChapterName)\n  tell application \"System Events\"\n\n    tell process \"Safari\"\n      set frontmost to true\n\n      if ((theChapterName as string) is equal to \"index\") then\n        set urlPath to theChapterName\n      else\n        set urlPath to \"chapters\/\" & theChapterName\n      end if\n      open location \"https:\/\/serverless-stack.com\/\" & urlPath & \".html\"\n\n      delay 1\n\n      repeat until menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 exists\n        delay 0.2\n      end repeat\n      repeat\n        if ((value of menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 is enabled) = true)\n          exit repeat\n        end if\n        delay 0.2\n      end repeat\n      click menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1\n\n      tell window 1\n        repeat until sheet 1 exists\n        end repeat\n\n        tell sheet 1\n          keystroke theChapterName\n          click pop up button \"Where:\"\n\n          repeat until menu 1 of pop up button \"Where:\" exists\n          end repeat\n          click menu item \"ebook\" of menu 1 of pop up button \"Where:\"\n          click button \"Save\"\n        end tell\n\n      end tell\n\n      click menu item \"Close Tab\" of menu \"File\" of menu bar 1\n\n    end tell\n\n  end tell\nend downloadPdf\n","new_contents":"############################\n# How to generate the PDFs #\n############################\n# 1. Generate Cover.pdf with latest version date\n#    a. Create \"ebook\" folder in ~\/Downloads\n#    b. update date in cover.html\n#    c. open in safari file:\/\/\/Users\/frank\/Sites\/ServerlessStackCom\/etc\/cover.html\n#    d. \"Export to PDF\u2026\"\n#    e. Place Cover.pdf in ~\/ebook folder\n# 2. Ensure \"ebook\" folder is an option when \"Export to PDF\u2026\" in Safari\n# 3. In terminal, run \"osascript pdf.scpt\"\n\n\nset theChaptersStr to \"who-is-this-guide-for\nwhat-does-this-guide-cover\nhow-to-get-help\nwhat-is-serverless\nwhat-is-aws-lambda\nwhy-create-serverless-apps\ncreate-an-aws-account\ncreate-an-iam-user\nwhat-is-iam\nwhat-is-an-arn\nconfigure-the-aws-cli\ncreate-a-dynamodb-table\ncreate-an-s3-bucket-for-file-uploads\ncreate-a-cognito-user-pool\ncreate-a-cognito-test-user\nsetup-the-serverless-framework\nadd-support-for-es6-es7-javascript\ninitialize-the-backend-repo\nadd-a-create-note-api\nadd-a-get-note-api\nadd-a-list-all-the-notes-api\nadd-an-update-note-api\nadd-a-delete-note-api\nworking-with-3rd-party-apis\nsetup-a-stripe-account\nadd-a-billing-api\nload-secrets-from-env\ntest-the-billing-api\nunit-tests-in-serverless\nhandle-api-gateway-cors-errors\ndeploy-the-apis\ncreate-a-cognito-identity-pool\ncognito-user-pool-vs-identity-pool\ntest-the-apis\ncreate-a-new-reactjs-app\ninitialize-the-frontend-repo\nadd-app-favicons\nsetup-custom-fonts\nsetup-bootstrap\nhandle-routes-with-react-router\ncreate-containers\nadding-links-in-the-navbar\nhandle-404s\nconfigure-aws-amplify\ncreate-a-login-page\nlogin-with-aws-cognito\nadd-the-session-to-the-state\nload-the-state-from-the-session\nclear-the-session-on-logout\nredirect-on-login-and-logout\ngive-feedback-while-logging-in\ncreate-a-custom-react-hook-to-handle-form-fields\ncreate-a-signup-page\ncreate-the-signup-form\nsignup-with-aws-cognito\nadd-the-create-note-page\ncall-the-create-api\nupload-a-file-to-s3\nlist-all-the-notes\ncall-the-list-api\ndisplay-a-note\nrender-the-note-form\nsave-changes-to-a-note\ndelete-a-note\ncreate-a-settings-page\nadd-stripe-keys-to-config\ncreate-a-billing-form\nconnect-the-billing-form\nsetup-secure-pages\ncreate-a-route-that-redirects\nuse-the-redirect-routes\nredirect-on-login\ngetting-production-ready\nwhat-is-infrastructure-as-code\nconfigure-dynamodb-in-serverless\nconfigure-s3-in-serverless\nconfigure-cognito-user-pool-in-serverless\nconfigure-cognito-identity-pool-in-serverless\ndeploy-your-serverless-infrastructure\nautomating-serverless-deployments\nsetting-up-your-project-on-seed\nconfigure-secrets-in-seed\ndeploying-through-seed\nset-custom-domains-through-seed\ntest-the-configured-apis\nautomating-react-deployments\nmanage-environments-in-create-react-app\ncreate-a-build-script\nsetting-up-your-project-on-netlify\ncustom-domain-in-netlify\nfrontend-workflow\ndebugging-full-stack-serverless-apps\nsetup-error-reporting-in-react\nreport-api-errors-in-react\nsetup-an-error-boundary-in-react\nsetup-error-logging-in-serverless\nlogic-errors-in-lambda-functions\nunexpected-errors-in-lambda-functions\nerrors-outside-lambda-functions\nerrors-in-api-gateway\nwrapping-up\nfurther-reading\ntranslations\ngiving-back\nchangelog\nstaying-up-to-date\nbest-practices-for-building-serverless-apps\norganizing-serverless-projects\ncross-stack-references-in-serverless\ndynamodb-as-a-serverless-service\ns3-as-a-serverless-service\ncognito-as-a-serverless-service\nshare-code-between-services\nshare-an-api-endpoint-between-services\ndeploy-a-serverless-app-with-dependencies\nenvironments-in-serverless-apps\nstructure-environments-across-aws-accounts\nmanage-aws-accounts-using-aws-organizations\nparameterize-serverless-resources-names\ndeploying-to-multiple-aws-accounts\ndeploy-the-resources-repo\ndeploy-the-api-services-repo\nmanage-environment-related-config\nstoring-secrets-in-serverless-apps\nshare-route-53-domains-across-aws-accounts\nmonitor-usage-for-environments\nworking-on-serverless-apps\ninvoke-lambda-functions-locally\ninvoke-api-gateway-endpoints-locally\ncreating-feature-environments\ncreating-pull-request-environments\npromoting-to-production\nrollback-changes\ndeploying-only-updated-services\ntracing-serverless-apps-with-x-ray\nwrapping-up-the-best-practices\napi-gateway-and-lambda-logs\ndebugging-serverless-api-issues\nserverless-environment-variables\nstages-in-serverless-framework\nbackups-in-dynamodb\nconfigure-multiple-aws-profiles\ncustomize-the-serverless-iam-policy\nmapping-cognito-identity-id-and-user-pool-id\nconnect-to-api-gateway-with-iam-auth\nserverless-nodejs-starter\npackage-lambdas-with-serverless-bundle\nunderstanding-react-hooks\ncode-splitting-in-create-react-app\nenvironments-in-create-react-app\ndeploying-a-react-app-to-aws\ncreate-an-s3-bucket\ndeploy-to-s3\ncreate-a-cloudfront-distribution\nsetup-your-domain-with-cloudfront\nsetup-www-domain-redirect\nsetup-ssl\ndeploy-updates\nmanage-user-accounts-in-aws-amplify\nhandle-forgot-and-reset-password\nallow-users-to-change-passwords\nallow-users-to-change-their-email\nfacebook-login-with-cognito-using-aws-amplify\"\n\nset text item delimiters to \"\n\"\n\nset theChapters to text items of theChaptersStr\n\n\n########\n# Main #\n########\ndownloadPdfs(theChapters)\nmergePdfs(theChapters)\n\n##############\n# Merge PDFs #\n##############\non mergePdfs(theChapters)\n  set outputFile to \"~\/Downloads\/ebook\/ServerlessStack.pdf\"\n\n  set pdfFiles to \"~\/Downloads\/ebook\/Cover.pdf\"\n  repeat with theCurrentChapter in theChapters\n    set pdfFiles to pdfFiles & \" ~\/Downloads\/ebook\/\" & theCurrentChapter & \".pdf\"\n  end repeat\n\n  do shell script \"\/System\/Library\/Automator\/Combine\\\\ PDF\\\\ Pages.action\/Contents\/Resources\/join.py \" & \"-o \" & outputFile & \" \" & pdfFiles\nend mergePdfs\n\n#################\n# Download PDFs #\n#################\non downloadPdfs(theChapters)\n  repeat with theCurrentChapter in theChapters\n    if not(checkFileExist(theCurrentChapter)) then\n      downloadPdf(theCurrentChapter)\n    end if\n  end repeat\nend downloadPdfs\n\non checkFileExist(theChapterName)\n  set basePath to POSIX path of (path to home folder) & \"Downloads\/ebook\/\"\n\n  tell application \"Finder\"\n    return exists basePath & theChapterName & \".pdf\" as POSIX file\n  end tell\nend checkFileExist\n\non downloadPdf(theChapterName)\n  tell application \"System Events\"\n\n    tell process \"Safari\"\n      set frontmost to true\n\n      if ((theChapterName as string) is equal to \"index\") then\n        set urlPath to theChapterName\n      else\n        set urlPath to \"chapters\/\" & theChapterName\n      end if\n      open location \"https:\/\/serverless-stack.com\/\" & urlPath & \".html\"\n\n      delay 1\n\n      repeat until menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 exists\n        delay 0.2\n      end repeat\n      repeat\n        if ((value of menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 is enabled) = true)\n          exit repeat\n        end if\n        delay 0.2\n      end repeat\n      click menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1\n\n      tell window 1\n        repeat until sheet 1 exists\n        end repeat\n\n        tell sheet 1\n          keystroke theChapterName\n          click pop up button \"Where:\"\n\n          repeat until menu 1 of pop up button \"Where:\" exists\n          end repeat\n          click menu item \"ebook\" of menu 1 of pop up button \"Where:\"\n          click button \"Save\"\n        end tell\n\n      end tell\n\n      delay 2\n\n      click menu item \"Close Tab\" of menu \"File\" of menu bar 1\n\n    end tell\n\n  end tell\nend downloadPdf\n","subject":"Fix pdf script","message":"Fix pdf script\n","lang":"AppleScript","license":"mit","repos":"AnomalyInnovations\/serverless-stack-com,AnomalyInnovations\/serverless-stack-com"}
{"commit":"4418fa31b3b45dde2bd5edca45c1a257b8dac412","old_file":"thumbscrew.scpt","new_file":"thumbscrew.scpt","old_contents":"-- thumbscrew.scpt\n-- usage: thumbscript.scpt <path_to_git_root_dir> <path_to_keynotePresentation>\n--\n-- Will create scaled thumbnails of length `thumbSize` in the directory\n-- <path_to_presentation>\nproperty thumbSize : 480\n\non getImages(f)\n  tell application \"Finder\" to return (files of folder f) as alias list\nend getImages\n\non run argv\n  set savePath to item 1 of argv\n  set keynoteName to item 2 of argv\n  set thumbnailDir to keynoteName\n  if thumbnailDir ends with \".key\" then set thumbnailDir to text 1 thru -5 of thumbnailDir\n\n  set keynoteFile to (POSIX file keynoteName) as alias\n  set keynoteFullName to savePath & \"\/\" & keynoteName\n  set documentPath to posix file (POSIX path of (do shell script \"dirname \" & quoted form of keynoteFullName)) as alias\n\n  tell application \"Finder\"\n    if not (exists folder thumbnailDir of folder documentPath)\n      make new folder at folder documentPath with properties {name:thumbnailDir}\n    end if\n    set the targetFolder to folder thumbnailDir of folder documentPath\n    set the targetFolderHFSPath to targetFolder as string\n  end tell\n\n  tell application \"Keynote\" to run\n  tell application \"Keynote\"\n    open keynoteFile\n\n    if playing is true then stop the front document\n\n    export front document as slide images to file targetFolderHFSPath with properties {image format: JPEG}\n    set jpegs to my getImages(targetFolderHFSPath)\n    repeat with thisJPEG in jpegs\n      try\n        tell application \"Image Events\"\n          launch\n          set this_image to open thisJPEG\n          scale this_image to size thumbSize\n          save this_image with icon\n          close this_image\n        end tell\n        on error error_message\n          display dialog error_message\n      end try\n    end repeat\n\n--    close front document without saving\n  end tell\nend run\n","new_contents":"-- thumbscrew.scpt\n-- usage: thumbscript.scpt <path_to_git_root_dir> <path_to_keynotePresentation>\n--\n-- Will create scaled thumbnails of length `thumbSize` in the directory\n-- <path_to_presentation>\nproperty thumbSize : 480\n\non getImages(f)\n  tell application \"Finder\" to return (files of folder f) as alias list\nend getImages\n\non run argv\n  set savePath to item 1 of argv\n  set keynoteName to item 2 of argv\n  set thumbnailDir to keynoteName\n  if thumbnailDir ends with \".key\" then set thumbnailDir to text 1 thru -5 of thumbnailDir\n\n  set keynoteFile to (POSIX file keynoteName) as alias\n  set keynoteFullName to savePath & \"\/\" & keynoteName\n  set savePath to posix file savePath\n\n  tell application \"Finder\"\n    if not (exists folder thumbnailDir of folder savePath)\n      make new folder at folder savePath with properties {name:thumbnailDir}\n    end if\n    set the targetFolder to folder thumbnailDir of folder savePath\n    set the targetFolderHFSPath to targetFolder as string\n  end tell\n\n  tell application \"Keynote\" to run\n  tell application \"Keynote\"\n    open keynoteFile\n\n    if playing is true then stop the front document\n\n    export front document as slide images to file targetFolderHFSPath with properties {image format: JPEG}\n    set jpegs to my getImages(targetFolderHFSPath)\n    repeat with thisJPEG in jpegs\n      try\n        tell application \"Image Events\"\n          launch\n          set this_image to open thisJPEG\n          scale this_image to size thumbSize\n          save this_image with icon\n          close this_image\n        end tell\n        on error error_message\n          display dialog error_message\n      end try\n    end repeat\n\n    close front document without saving\n  end tell\nend run\n","subject":"make it work again","message":"make it work again\n","lang":"AppleScript","license":"mit","repos":"azizshamim\/thumbscrew"}
{"commit":"5c02b150da5ab6e7b1f51a8e60c02359c47c8a57","old_file":"etc\/pdf.scpt","new_file":"etc\/pdf.scpt","old_contents":"############################\n# How to generate the PDFs #\n############################\n# 1. Generate Cover.pdf with latest version date\n#    a. Create \"ebook\" folder in ~\/Downloads\n#    b. update date in cover.html\n#    c. open in safari file:\/\/\/Users\/frank\/Sites\/ServerlessStackCom\/etc\/cover.html\n#    d. \"Export to PDF\u2026\"\n#    e. Place Cover.pdf in ~\/ebook folder\n# 2. Ensure \"ebook\" folder is an option when \"Export to PDF\u2026\" in Safari\n# 3. In terminal, run \"osascript pdf.scpt\"\n\n\nset theChaptersStr to \"who-is-this-guide-for\nwhat-does-this-guide-cover\nhow-to-get-help\nwhat-is-serverless\nwhat-is-aws-lambda\nwhy-create-serverless-apps\ncreate-an-aws-account\ncreate-an-iam-user\nwhat-is-iam\nwhat-is-an-arn\nconfigure-the-aws-cli\ncreate-a-dynamodb-table\ncreate-an-s3-bucket-for-file-uploads\ncreate-a-cognito-user-pool\ncreate-a-cognito-test-user\nsetup-the-serverless-framework\nadd-support-for-es6-es7-javascript\ninitialize-the-backend-repo\nadd-a-create-note-api\nadd-a-get-note-api\nadd-a-list-all-the-notes-api\nadd-an-update-note-api\nadd-a-delete-note-api\nworking-with-3rd-party-apis\nsetup-a-stripe-account\nadd-a-billing-api\nload-secrets-from-env\ntest-the-billing-api\nunit-tests-in-serverless\nhandle-api-gateway-cors-errors\ndeploy-the-apis\ncreate-a-cognito-identity-pool\ncognito-user-pool-vs-identity-pool\ntest-the-apis\ncreate-a-new-reactjs-app\ninitialize-the-frontend-repo\nadd-app-favicons\nsetup-custom-fonts\nsetup-bootstrap\nhandle-routes-with-react-router\ncreate-containers\nadding-links-in-the-navbar\nhandle-404s\nconfigure-aws-amplify\ncreate-a-login-page\nlogin-with-aws-cognito\nadd-the-session-to-the-state\nload-the-state-from-the-session\nclear-the-session-on-logout\nredirect-on-login-and-logout\ngive-feedback-while-logging-in\ncreate-a-custom-react-hook-to-handle-form-fields\ncreate-a-signup-page\ncreate-the-signup-form\nsignup-with-aws-cognito\nadd-the-create-note-page\ncall-the-create-api\nupload-a-file-to-s3\nlist-all-the-notes\ncall-the-list-api\ndisplay-a-note\nrender-the-note-form\nsave-changes-to-a-note\ndelete-a-note\ncreate-a-settings-page\nadd-stripe-keys-to-config\ncreate-a-billing-form\nconnect-the-billing-form\nsetup-secure-pages\ncreate-a-route-that-redirects\nuse-the-redirect-routes\nredirect-on-login\ngetting-production-ready\nwhat-is-infrastructure-as-code\nconfigure-dynamodb-in-serverless\nconfigure-s3-in-serverless\nconfigure-cognito-user-pool-in-serverless\nconfigure-cognito-identity-pool-in-serverless\ndeploy-your-serverless-infrastructure\nautomating-serverless-deployments\nsetting-up-your-project-on-seed\nconfigure-secrets-in-seed\ndeploying-through-seed\nset-custom-domains-through-seed\ntest-the-configured-apis\nautomating-react-deployments\nmanage-environments-in-create-react-app\ncreate-a-build-script\nsetting-up-your-project-on-netlify\ncustom-domain-in-netlify\nfrontend-workflow\ndebugging-full-stack-serverless-apps\nsetup-error-reporting-in-react\nreport-api-errors-in-react\nsetup-an-error-boundary-in-react\nsetup-error-logging-in-serverless\nlogic-errors-in-lambda-functions\nunexpected-errors-in-lambda-functions\nerrors-outside-lambda-functions\nerrors-in-api-gateway\nwrapping-up\nfurther-reading\ntranslations\ngiving-back\nchangelog\nstaying-up-to-date\nbest-practices-for-building-serverless-apps\norganizing-serverless-projects\ncross-stack-references-in-serverless\ndynamodb-as-a-serverless-service\ns3-as-a-serverless-service\ncognito-as-a-serverless-service\nshare-code-between-services\nshare-an-api-endpoint-between-services\ndeploy-a-serverless-app-with-dependencies\nenvironments-in-serverless-apps\nstructure-environments-across-aws-accounts\nmanage-aws-accounts-using-aws-organizations\nparameterize-serverless-resources-names\ndeploying-to-multiple-aws-accounts\ndeploy-the-resources-repo\ndeploy-the-api-services-repo\nmanage-environment-related-config\nstoring-secrets-in-serverless-apps\nshare-route-53-domains-across-aws-accounts\nmonitor-usage-for-environments\nworking-on-serverless-apps\ninvoke-lambda-functions-locally\ninvoke-api-gateway-endpoints-locally\ncreating-feature-environments\ncreating-pull-request-environments\npromoting-to-production\nrollback-changes\ndeploying-only-updated-services\ntracing-serverless-apps-with-x-ray\nwrapping-up-the-best-practices\napi-gateway-and-lambda-logs\ndebugging-serverless-api-issues\nserverless-environment-variables\nstages-in-serverless-framework\nbackups-in-dynamodb\nconfigure-multiple-aws-profiles\ncustomize-the-serverless-iam-policy\nmapping-cognito-identity-id-and-user-pool-id\nconnect-to-api-gateway-with-iam-auth\nserverless-nodejs-starter\npackage-lambdas-with-serverless-bundle\nunderstanding-react-hooks\ncode-splitting-in-create-react-app\nenvironments-in-create-react-app\ndeploying-a-react-app-to-aws\ncreate-an-s3-bucket\ndeploy-to-s3\ncreate-a-cloudfront-distribution\nsetup-your-domain-with-cloudfront\nsetup-www-domain-redirect\nsetup-ssl\ndeploy-updates\nmanage-user-accounts-in-aws-amplify\nhandle-forgot-and-reset-password\nallow-users-to-change-passwords\nallow-users-to-change-their-email\nfacebook-login-with-cognito-using-aws-amplify\"\n\nset text item delimiters to \"\n\"\n\nset theChapters to text items of theChaptersStr\n\n\n########\n# Main #\n########\ndownloadPdfs(theChapters)\nmergePdfs(theChapters)\n\n##############\n# Merge PDFs #\n##############\non mergePdfs(theChapters)\n  set outputFile to \"~\/Downloads\/ebook\/ServerlessStack.pdf\"\n\n  set pdfFiles to \"~\/Downloads\/ebook\/Cover.pdf\"\n  repeat with theCurrentChapter in theChapters\n    set pdfFiles to pdfFiles & \" ~\/Downloads\/ebook\/\" & theCurrentChapter & \".pdf\"\n  end repeat\n\n  do shell script \"\/System\/Library\/Automator\/Combine\\\\ PDF\\\\ Pages.action\/Contents\/Resources\/join.py \" & \"-o \" & outputFile & \" \" & pdfFiles\nend mergePdfs\n\n#################\n# Download PDFs #\n#################\non downloadPdfs(theChapters)\n  repeat with theCurrentChapter in theChapters\n    if not(checkFileExist(theCurrentChapter)) then\n      downloadPdf(theCurrentChapter)\n    end if\n  end repeat\nend downloadPdfs\n\non checkFileExist(theChapterName)\n  set basePath to POSIX path of (path to home folder) & \"Downloads\/ebook\/\"\n\n  tell application \"Finder\"\n    return exists basePath & theChapterName & \".pdf\" as POSIX file\n  end tell\nend checkFileExist\n\non downloadPdf(theChapterName)\n  tell application \"System Events\"\n\n    tell process \"Safari\"\n      set frontmost to true\n\n      if ((theChapterName as string) is equal to \"index\") then\n        set urlPath to theChapterName\n      else\n        set urlPath to \"chapters\/\" & theChapterName\n      end if\n      open location \"https:\/\/serverless-stack.com\/\" & urlPath & \".html\"\n\n      delay 1\n\n      repeat until menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 exists\n        delay 0.2\n      end repeat\n      repeat until menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 is enabled\n        delay 0.2\n      end repeat\n      click menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1\n\n      tell window 1\n        repeat until sheet 1 exists\n        end repeat\n\n        tell sheet 1\n          keystroke theChapterName\n          click pop up button \"Where:\"\n\n          repeat until menu 1 of pop up button \"Where:\" exists\n          end repeat\n          click menu item \"ebook\" of menu 1 of pop up button \"Where:\"\n          click button \"Save\"\n        end tell\n\n      end tell\n\n      click menu item \"Close Tab\" of menu \"File\" of menu bar 1\n\n    end tell\n\n  end tell\nend downloadPdf\n","new_contents":"############################\n# How to generate the PDFs #\n############################\n# 1. Generate Cover.pdf with latest version date\n#    a. Create \"ebook\" folder in ~\/Downloads\n#    b. update date in cover.html\n#    c. open in safari file:\/\/\/Users\/frank\/Sites\/ServerlessStackCom\/etc\/cover.html\n#    d. \"Export to PDF\u2026\"\n#    e. Place Cover.pdf in ~\/ebook folder\n# 2. Ensure \"ebook\" folder is an option when \"Export to PDF\u2026\" in Safari\n# 3. In terminal, run \"osascript pdf.scpt\"\n\n\nset theChaptersStr to \"who-is-this-guide-for\nwhat-does-this-guide-cover\nhow-to-get-help\nwhat-is-serverless\nwhat-is-aws-lambda\nwhy-create-serverless-apps\ncreate-an-aws-account\ncreate-an-iam-user\nwhat-is-iam\nwhat-is-an-arn\nconfigure-the-aws-cli\ncreate-a-dynamodb-table\ncreate-an-s3-bucket-for-file-uploads\ncreate-a-cognito-user-pool\ncreate-a-cognito-test-user\nsetup-the-serverless-framework\nadd-support-for-es6-es7-javascript\ninitialize-the-backend-repo\nadd-a-create-note-api\nadd-a-get-note-api\nadd-a-list-all-the-notes-api\nadd-an-update-note-api\nadd-a-delete-note-api\nworking-with-3rd-party-apis\nsetup-a-stripe-account\nadd-a-billing-api\nload-secrets-from-env\ntest-the-billing-api\nunit-tests-in-serverless\nhandle-api-gateway-cors-errors\ndeploy-the-apis\ncreate-a-cognito-identity-pool\ncognito-user-pool-vs-identity-pool\ntest-the-apis\ncreate-a-new-reactjs-app\ninitialize-the-frontend-repo\nadd-app-favicons\nsetup-custom-fonts\nsetup-bootstrap\nhandle-routes-with-react-router\ncreate-containers\nadding-links-in-the-navbar\nhandle-404s\nconfigure-aws-amplify\ncreate-a-login-page\nlogin-with-aws-cognito\nadd-the-session-to-the-state\nload-the-state-from-the-session\nclear-the-session-on-logout\nredirect-on-login-and-logout\ngive-feedback-while-logging-in\ncreate-a-custom-react-hook-to-handle-form-fields\ncreate-a-signup-page\ncreate-the-signup-form\nsignup-with-aws-cognito\nadd-the-create-note-page\ncall-the-create-api\nupload-a-file-to-s3\nlist-all-the-notes\ncall-the-list-api\ndisplay-a-note\nrender-the-note-form\nsave-changes-to-a-note\ndelete-a-note\ncreate-a-settings-page\nadd-stripe-keys-to-config\ncreate-a-billing-form\nconnect-the-billing-form\nsetup-secure-pages\ncreate-a-route-that-redirects\nuse-the-redirect-routes\nredirect-on-login\ngetting-production-ready\nwhat-is-infrastructure-as-code\nconfigure-dynamodb-in-serverless\nconfigure-s3-in-serverless\nconfigure-cognito-user-pool-in-serverless\nconfigure-cognito-identity-pool-in-serverless\ndeploy-your-serverless-infrastructure\nautomating-serverless-deployments\nsetting-up-your-project-on-seed\nconfigure-secrets-in-seed\ndeploying-through-seed\nset-custom-domains-through-seed\ntest-the-configured-apis\nautomating-react-deployments\nmanage-environments-in-create-react-app\ncreate-a-build-script\nsetting-up-your-project-on-netlify\ncustom-domain-in-netlify\nfrontend-workflow\ndebugging-full-stack-serverless-apps\nsetup-error-reporting-in-react\nreport-api-errors-in-react\nsetup-an-error-boundary-in-react\nsetup-error-logging-in-serverless\nlogic-errors-in-lambda-functions\nunexpected-errors-in-lambda-functions\nerrors-outside-lambda-functions\nerrors-in-api-gateway\nwrapping-up\nfurther-reading\ntranslations\ngiving-back\nchangelog\nstaying-up-to-date\nbest-practices-for-building-serverless-apps\norganizing-serverless-projects\ncross-stack-references-in-serverless\ndynamodb-as-a-serverless-service\ns3-as-a-serverless-service\ncognito-as-a-serverless-service\nshare-code-between-services\nshare-an-api-endpoint-between-services\ndeploy-a-serverless-app-with-dependencies\nenvironments-in-serverless-apps\nstructure-environments-across-aws-accounts\nmanage-aws-accounts-using-aws-organizations\nparameterize-serverless-resources-names\ndeploying-to-multiple-aws-accounts\ndeploy-the-resources-repo\ndeploy-the-api-services-repo\nmanage-environment-related-config\nstoring-secrets-in-serverless-apps\nshare-route-53-domains-across-aws-accounts\nmonitor-usage-for-environments\nworking-on-serverless-apps\ninvoke-lambda-functions-locally\ninvoke-api-gateway-endpoints-locally\ncreating-feature-environments\ncreating-pull-request-environments\npromoting-to-production\nrollback-changes\ndeploying-only-updated-services\ntracing-serverless-apps-with-x-ray\nwrapping-up-the-best-practices\napi-gateway-and-lambda-logs\ndebugging-serverless-api-issues\nserverless-environment-variables\nstages-in-serverless-framework\nbackups-in-dynamodb\nconfigure-multiple-aws-profiles\ncustomize-the-serverless-iam-policy\nmapping-cognito-identity-id-and-user-pool-id\nconnect-to-api-gateway-with-iam-auth\nserverless-nodejs-starter\npackage-lambdas-with-serverless-bundle\nunderstanding-react-hooks\ncode-splitting-in-create-react-app\nenvironments-in-create-react-app\ndeploying-a-react-app-to-aws\ncreate-an-s3-bucket\ndeploy-to-s3\ncreate-a-cloudfront-distribution\nsetup-your-domain-with-cloudfront\nsetup-www-domain-redirect\nsetup-ssl\ndeploy-updates\nmanage-user-accounts-in-aws-amplify\nhandle-forgot-and-reset-password\nallow-users-to-change-passwords\nallow-users-to-change-their-email\nfacebook-login-with-cognito-using-aws-amplify\"\n\nset text item delimiters to \"\n\"\n\nset theChapters to text items of theChaptersStr\n\n\n########\n# Main #\n########\ndownloadPdfs(theChapters)\nmergePdfs(theChapters)\n\n##############\n# Merge PDFs #\n##############\non mergePdfs(theChapters)\n  set outputFile to \"~\/Downloads\/ebook\/ServerlessStack.pdf\"\n\n  set pdfFiles to \"~\/Downloads\/ebook\/Cover.pdf\"\n  repeat with theCurrentChapter in theChapters\n    set pdfFiles to pdfFiles & \" ~\/Downloads\/ebook\/\" & theCurrentChapter & \".pdf\"\n  end repeat\n\n  do shell script \"\/System\/Library\/Automator\/Combine\\\\ PDF\\\\ Pages.action\/Contents\/Resources\/join.py \" & \"-o \" & outputFile & \" \" & pdfFiles\nend mergePdfs\n\n#################\n# Download PDFs #\n#################\non downloadPdfs(theChapters)\n  repeat with theCurrentChapter in theChapters\n    if not(checkFileExist(theCurrentChapter)) then\n      downloadPdf(theCurrentChapter)\n    end if\n  end repeat\nend downloadPdfs\n\non checkFileExist(theChapterName)\n  set basePath to POSIX path of (path to home folder) & \"Downloads\/ebook\/\"\n\n  tell application \"Finder\"\n    return exists basePath & theChapterName & \".pdf\" as POSIX file\n  end tell\nend checkFileExist\n\non downloadPdf(theChapterName)\n  tell application \"System Events\"\n\n    tell process \"Safari\"\n      set frontmost to true\n\n      if ((theChapterName as string) is equal to \"index\") then\n        set urlPath to theChapterName\n      else\n        set urlPath to \"chapters\/\" & theChapterName\n      end if\n      open location \"https:\/\/serverless-stack.com\/\" & urlPath & \".html\"\n\n      delay 1\n\n      repeat until menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 exists\n        delay 0.2\n      end repeat\n      repeat\n        if ((value of menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1 is enabled) = true)\n          exit repeat\n        end if\n        delay 0.2\n      end repeat\n      click menu item \"Export as PDF\u2026\" of menu \"File\" of menu bar 1\n\n      tell window 1\n        repeat until sheet 1 exists\n        end repeat\n\n        tell sheet 1\n          keystroke theChapterName\n          click pop up button \"Where:\"\n\n          repeat until menu 1 of pop up button \"Where:\" exists\n          end repeat\n          click menu item \"ebook\" of menu 1 of pop up button \"Where:\"\n          click button \"Save\"\n        end tell\n\n      end tell\n\n      click menu item \"Close Tab\" of menu \"File\" of menu bar 1\n\n    end tell\n\n  end tell\nend downloadPdf\n","subject":"Fix pdf script","message":"Fix pdf script\n","lang":"AppleScript","license":"mit","repos":"AnomalyInnovations\/serverless-stack-com,AnomalyInnovations\/serverless-stack-com"}
{"commit":"19668c09836a017b1c6d30494bd5ef7329197002","old_file":"Release\/dmg_growl.applescript","new_file":"Release\/dmg_growl.applescript","old_contents":"tell application \"Finder\"\n\ttell disk \"Growl\"\n\t\topen\n\t\ttell container window\n\t\t\tset current view to icon view\n\t\t\tset toolbar visible to false\n\t\t\tset statusbar visible to false\n\t\t\t--set the bounds to {30, 50, 579, 600}\n\t\tend tell\n\t\tclose\n\t\tset opts to the icon view options of container window\n\t\ttell opts\n\t\t\tset icon size to 64\n\t\t\tset arrangement to not arranged\n\t\tend tell\n\t\tset background picture of opts to file \".background:growlDMGBackground.png\"\n\t\tset position of item \"Growl.prefPane\" to {147, 75}\n\t\tset position of item \"Extras\" to {80, 315}\n\t\t--set position of item \"Scripts\" to {36, 153}\n\t\tset position of item \"Growl Documentation.webloc\" to {100, 215}\n\t\tset position of item \"Growl version history.webloc\" to {275, 215}\n\t\tset position of item \"Get more styles.webloc\" to {415, 215}\n\t\tset position of item \"Uninstall Growl.app\" to {415, 315}\n\t\tupdate without registering applications\n\t\tset the_window_id to id of container window\n\t\tupdate without registering applications\n\tend tell\n\tset bounds of window id the_window_id to {30, 50, 579, 900}\n\t--give the finder some time to write the .DS_Store file\n\tdelay 5\nend tell\n","new_contents":"tell application \"Finder\"\n\ttell disk \"Growl\"\n\t\topen\n\t\ttell container window\n\t\t\tset current view to icon view\n\t\t\tset toolbar visible to false\n\t\t\tset statusbar visible to false\n\t\t\t--set the bounds to {30, 50, 579, 600}\n\t\tend tell\n\t\tclose\n\t\tset opts to the icon view options of container window\n\t\ttell opts\n\t\t\tset icon size to 64\n\t\t\tset arrangement to not arranged\n\t\tend tell\n\t\tset background picture of opts to file \".background:growlDMGBackground.png\"\n\t\tset position of item \"Growl.prefPane\" to {147, 75}\n\t\tset position of item \"Extras\" to {80, 315}\n\t\t--set position of item \"Scripts\" to {36, 153}\n\t\tset position of item \"Growl Documentation.webloc\" to {100, 215}\n\t\tset position of item \"Growl version history.webloc\" to {275, 215}\n\t\tset position of item \"Get more styles.webloc\" to {415, 215}\n\t\tset position of item \"Uninstall Growl.app\" to {415, 315}\n\t\tupdate without registering applications\n\t\ttell container window\n\t\t\topen\n\t\t\tset the_window_id to id\n\t\tend tell\n\t\tupdate without registering applications\n\tend tell\n\tset bounds of window id the_window_id to {30, 50, 579, 462}\n\t--give the finder some time to write the .DS_Store file\n\tdelay 5\nend tell\n","subject":"Save before committing!","message":"Save before committing!\n","lang":"AppleScript","license":"bsd-3-clause","repos":"tectronics\/growl,CarlosCD\/growl,tectronics\/growl,nochkin\/growl,Shalaco\/shalzers-growl,nochkin\/growl,nagyistoce\/growl,coltonfisher\/coltonfisher-growl,nkhorman\/archive-growl,an0nym0u5\/growl,nagyistoce\/growl,xhruso00\/growl,CarlosCD\/growl,xhruso00\/growl,CarlosCD\/growl,CarlosCD\/growl,Shalaco\/shalzers-growl,Shalaco\/shalzers-growl,xhruso00\/growl,Shalaco\/shalzers-growl,timbck2\/growl,doshinirav\/doshinirav-myversion,ylian\/growl,Shalaco\/shalzers-growl,coltonfisher\/coltonfisher-growl,doshinirav\/doshinirav-myversion,ylian\/growl,timbck2\/growl,doshinirav\/doshinirav-myversion,Shalaco\/shalzers-growl,xhruso00\/growl,SalrJupiter\/growl,ylian\/growl,nochkin\/growl,doshinirav\/doshinirav-myversion,an0nym0u5\/growl,chashion\/growl,an0nym0u5\/growl,morganestes\/morganestes-growl,SalrJupiter\/growl,timbck2\/growl,nochkin\/growl,nagyistoce\/growl,chashion\/growl,morganestes\/morganestes-growl,coltonfisher\/coltonfisher-growl,Shalaco\/shalzers-growl,doshinirav\/doshinirav-myversion,coltonfisher\/coltonfisher-growl,chashion\/growl,nkhorman\/archive-growl,nagyistoce\/growl,CarlosCD\/growl,SalrJupiter\/growl,Shalaco\/shalzers-growl,SalrJupiter\/growl,nkhorman\/archive-growl,tectronics\/growl,xhruso00\/growl,chashion\/growl,nagyistoce\/growl,morganestes\/morganestes-growl,timbck2\/growl,an0nym0u5\/growl,tectronics\/growl,CarlosCD\/growl,nkhorman\/archive-growl,tectronics\/growl,nkhorman\/archive-growl,Shalaco\/shalzers-growl,xhruso00\/growl,tectronics\/growl,timbck2\/growl,ylian\/growl,morganestes\/morganestes-growl,coltonfisher\/coltonfisher-growl,doshinirav\/doshinirav-myversion,CarlosCD\/growl,SalrJupiter\/growl,chashion\/growl,an0nym0u5\/growl,ylian\/growl,SalrJupiter\/growl,an0nym0u5\/growl,Shalaco\/shalzers-growl,coltonfisher\/coltonfisher-growl,chashion\/growl,timbck2\/growl,doshinirav\/doshinirav-myversion,ylian\/growl,nkhorman\/archive-growl,morganestes\/morganestes-growl,morganestes\/morganestes-growl,nochkin\/growl,Shalaco\/shalzers-growl,coltonfisher\/coltonfisher-growl,nagyistoce\/growl,nochkin\/growl"}
{"commit":"c374b0aa9f23e03575bbf91446b1027e0ba73fac","old_file":"windowSizeAll.applescript","new_file":"windowSizeAll.applescript","old_contents":"-- app to be excepted\nset expApp to {\"thunderbird-bin\", \"XRG\", \"Skype\"}\n\n-- app to be half size, in left monitor (0.7 times full)\nset halfSizeApp_L to {}\n\n-- app to be half size, in right monitor\nset halfSizeApp_R to {\"AdobeReader\"}\n\n-- app only to be moved, in left monitor\nset noResizeApp_L to {}\n\n-- app only to be moved, in right monitor\nset noResizeApp_R to {\"Finder\", \"Skype\", \"Microsoft Word\", \"Microsoft Excel\", \"Microsoft PowerPoint\"}\n\n-- app to be moved left\nset app_L to {\"firefox\", \"Evernote\", \"thunderbird\", \"thunderbird-bin\", \"Mail\"}\n\n-- app to be moved right\nset app_R to {\"iTerm\"}\n\n-- get screen size\ntell application \"Finder\"\n\tset scriptPath to (path to me)'s folder as text\nend tell\nset windowSizeScpt to scriptPath & \"windowSize.scpt\"\nset windowSize to load script file windowSizeScpt\n\n-- main screen\nset svs to windowSize's getVisibleFrame(100, 100)\nset dPosX to item 1 of svs\nset dPosY to item 2 of svs\nset dWidth to item 3 of svs\nset dHeight to item 4 of svs\n\n-- try to get left screen\nset dPosX_L to dPosX\nset dPosY_L to dPosY\ntry\n\tset svsL to windowSize's getVisibleFrame(-100, 100)\n\tset dPosX_L to item 1 of svsL\n\tset dPosY_L to item 2 of svsL\nend try\n\n-- try to get right screen\nset dPosX_R to dPosX\nset dPosY_R to dPosY\ntry\n\tset svsR to windowSize's getVisibleFrame(dPosX + dWidth + 100, 100)\n\tset dPosX_R to item 1 of svsR\n\tset dPosY_R to item 2 of svsR\nend try\n\n\n-- get application name\ntell application \"System Events\"\n\tset appList to (get name of every application process whose visible is true)\nend tell\n\n-- repeat for all app\nrepeat with appName in appList\n\tif appName is not in expApp then\n\t\ttell application \"System Events\"\n\t\t\ttry\n\t\t\t\ttell process appName\n\t\t\t\t\tset nW to number of windows\n\t\t\t\t\trepeat with i from 1 to nW\n\t\t\t\t\t\tlog appName & i\n\t\t\t\t\t\tif appName is in halfSizeApp_L then\n\t\t\t\t\t\t\twindowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_L, monPosY:dPosY_L, xsize:0.7, ysize:0.7})\n\t\t\t\t\t\telse if appName is in halfSizeApp_R then\n\t\t\t\t\t\t\twindowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_R, monPosY:dPosY_R, xsize:0.7, ysize:0.7})\n\t\t\t\t\t\telse if appName is in noResizeApp_L then\n\t\t\t\t\t\t\twindowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_L, monPosY:dPosY_L, resize:0})\n\t\t\t\t\t\telse if appName is in noResizeApp_R then\n\t\t\t\t\t\t\twindowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_R, monPosY:dPosY_R, resize:0})\n\t\t\t\t\t\telse if appName is in app_L then\n\t\t\t\t\t\t\tlog \"app_L\" & appName\n\t\t\t\t\t\t\twindowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_L, monPosY:dPosY_L})\n\t\t\t\t\t\telse if appName is in app_R then\n\t\t\t\t\t\t\tlog \"app_R\" & appName\n\t\t\t\t\t\t\twindowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_R, monPosY:dPosY_R})\n\t\t\t\t\t\tend if\n\t\t\t\t\tend repeat\n\t\t\t\tend tell\n\t\t\tend try\n\t\tend tell\n\tend if\nend repeat\n","new_contents":"-- app to be excepted\nset expApp to {\"thunderbird-bin\", \"XRG\", \"Skype\"}\n\n-- app to be half size, in left monitor (0.7 times full)\nset halfSizeApp_L to {}\n\n-- app to be half size, in right monitor\nset halfSizeApp_R to {\"AdobeReader\"}\n\n-- app only to be moved, in left monitor\nset noResizeApp_L to {}\n\n-- app only to be moved, in right monitor\nset noResizeApp_R to {\"Finder\", \"Skype\", \"Microsoft Word\", \"Microsoft Excel\", \"Microsoft PowerPoint\"}\n\n-- app to be moved left\nset app_L to {\"firefox\", \"Evernote\", \"thunderbird\", \"thunderbird-bin\", \"Mail\"}\n\n-- app to be moved right\nset app_R to {\"iTerm\"}\n\n-- get screen size\ntell application \"Finder\"\n\tset scriptPath to (path to me)'s folder as text\nend tell\nset windowSizeScpt to scriptPath & \"windowSize.scpt\"\nset windowSize to load script file windowSizeScpt\n\n-- main screen\nset svs to windowSize's getVisibleFrame(100, 100)\nset dPosX to item 1 of svs\nset dPosY to item 2 of svs\nset dWidth to item 3 of svs\nset dHeight to item 4 of svs\n\n-- try to get left screen\nset dPosX_L to dPosX\nset dPosY_L to dPosY\ntry\n\tset svsL to windowSize's getVisibleFrame(-100, 100)\n\tset dPosX_L to item 1 of svsL\n\tset dPosY_L to item 2 of svsL\nend try\n\n-- try to get right screen\nset dPosX_R to dPosX\nset dPosY_R to dPosY\ntry\n\tset svsR to windowSize's getVisibleFrame(dPosX + dWidth + 100, 100)\n\tset dPosX_R to item 1 of svsR\n\tset dPosY_R to item 2 of svsR\nend try\n\n\n-- get application name\ntell application \"System Events\"\n\tset appList to (get name of every application process whose visible is true)\nend tell\n\n-- repeat for all app\nrepeat with appName in appList\n\tif appName is not in expApp then\n\t\ttell application \"System Events\"\n\t\t\ttry\n\t\t\t\ttell process appName\n\t\t\t\t\tset nW to number of windows\n\t\t\t\t\tdisplay dialog appName & \" \" & nW\n\t\t\t\t\t\n\t\t\t\t\trepeat with i from 1 to nW\n\t\t\t\t\t\tlog appName & i\n\t\t\t\t\t\tif appName is in halfSizeApp_L then\n\t\t\t\t\t\t\twindowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_L, monPosY:dPosY_L, xsize:0.7, ysize:0.7})\n\t\t\t\t\t\telse if appName is in halfSizeApp_R then\n\t\t\t\t\t\t\twindowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_R, monPosY:dPosY_R, xsize:0.7, ysize:0.7})\n\t\t\t\t\t\telse if appName is in noResizeApp_L then\n\t\t\t\t\t\t\twindowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_L, monPosY:dPosY_L, resize:0})\n\t\t\t\t\t\telse if appName is in noResizeApp_R then\n\t\t\t\t\t\t\twindowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_R, monPosY:dPosY_R, resize:0})\n\t\t\t\t\t\telse if appName is in app_L then\n\t\t\t\t\t\t\tlog \"app_L\" & appName\n\t\t\t\t\t\t\twindowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_L, monPosY:dPosY_L})\n\t\t\t\t\t\telse if appName is in app_R then\n\t\t\t\t\t\t\tlog \"app_R\" & appName\n\t\t\t\t\t\t\twindowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_R, monPosY:dPosY_R})\n\t\t\t\t\t\tend if\n\t\t\t\t\tend repeat\n\t\t\t\tend tell\n\t\t\tend try\n\t\tend tell\n\tend if\nend repeat\n","subject":"update from darwin11","message":"update from darwin11\n","lang":"AppleScript","license":"mit","repos":"rcmdnk\/AppleScript"}
{"commit":"0a1bd353fcccc1551f34d13ae8eb8b6e2d015937","old_file":"script\/click_install.scpt","new_file":"script\/click_install.scpt","old_contents":"#!\/usr\/bin\/env osascript\n\n-- Fist: Click Install Button\ndelay 2.0\n\nset timeoutSeconds to 2.0\nset uiScript to \"click UI Element 4 of window 1 of application process \\\"Install Command Line Developer Tools\\\"\"\nmy doWithTimeout(uiScript, timeoutSeconds)\n\non doWithTimeout(uiScript, timeoutSeconds)\n  set endDate to (current date) + timeoutSeconds\n  repeat\n    try\n      run script \"tell application \\\"System Events\\\"\n\" & uiScript & \"\nend tell\"\n      exit repeat\n    on error errorMessage\n      if ((current date) > endDate) then\n        error \"Can not \" & uiScript\n      end if\n    end try\n  end repeat\nend doWithTimeout\n","new_contents":"#!\/usr\/bin\/env osascript\n\n-- Fist: Click Install Button\nset timeoutSeconds to 2.0\nset uiScript to \"click UI Element 4 of window 1 of application process \\\"Install Command Line Developer Tools\\\"\"\nmy doWithTimeout(uiScript, timeoutSeconds)\n\non doWithTimeout(uiScript, timeoutSeconds)\n  set endDate to (current date) + timeoutSeconds\n  repeat\n    try\n      run script \"tell application \\\"System Events\\\"\n\" & uiScript & \"\nend tell\"\n      exit repeat\n    on error errorMessage\n      if ((current date) > endDate) then\n        error \"Can not \" & uiScript\n      end if\n    end try\n  end repeat\nend doWithTimeout\n","subject":"Remove delay","message":"Remove delay\n","lang":"AppleScript","license":"mit","repos":"k0kubun\/rebuild,k0kubun\/rebuild"}
{"commit":"24bae373e3eff663311b87f39ecaf2270add0bee","old_file":"library\/fmGUI_ObjManipulation\/fmGUI_Popup_SelectByCommand.applescript","new_file":"library\/fmGUI_ObjManipulation\/fmGUI_Popup_SelectByCommand.applescript","old_contents":"-- fmGUI_Popup_SelectByCommand({objRef:\"\", objValue:\"\", calcValue:null, selectCommand:\"\", clickIfAlreadySet:\"\"})\n-- Daniel A. Shockley, NYHTC\n-- Selects a choice from a popup menu\n\n\n(*\nREQUIRES:\n\tclickObjectByCoords\n\tfmGUI_SpecifyCalcWindowSet\n\t\n\t \nHISTORY:\n\t2020-05-21 ( dshockley ): Try a 2nd time to click-and-wait for the menu to appear. \n\t1.4.1 - 2018-04-30 ( eshagdar ): tell FM to click on the value since it might not be visible ( and unclickable by CLI ).\n\t1.4 - 2017-09-22 ( eshagdar ): set calc using handler.\n\t1.3 - 2017-09-06 ( eshagdar ): added calcValue param that sets a calc in the 'Specify Calculation' that comes up.\n\t1.2 - 2017-09-05 ( eshagdar ): clicking done by handler\n\t1.1 - 2017-06-29 ( eshagdar ): prefs must be a record. incoming param may be a string, so ensure that it's an object reference.\n\t1.0 - created\n*)\n\n\non run\n\ttell application \"System Events\"\n\t\ttell application process \"FileMaker Pro Advanced\"\n\t\t\tset frontmost to true\n\t\t\tdelay 1\n\t\t\t--set popUpButtonRef to pop up button \"Available menu commands:\" of window 1\n\t\t\tset popUpButtonRef to pop up button \"View\" of window 1\n\t\tend tell\n\tend tell\n\t\n\tfmGUI_Popup_SelectByCommand({objRef:popUpButtonRef, objValue:\"limited...\", calcValue:\"If ( True; True; GetAsNumber ( \\\"1\\\" ) )\", clickIfAlreadySet:true})\n\t\nend run\n\n--------------------\n-- START OF CODE\n--------------------\n\non fmGUI_Popup_SelectByCommand(prefs)\n\t-- version 2020-05-21-1231\n\t\n\tset defaultPrefs to {objRef:null, objValue:null, calcValue:null, selectCommand:\"is\", clickIfAlreadySet:false}\n\tset prefs to prefs & defaultPrefs\n\t\n\tset objRef to ensureObjectRef(objRef of prefs)\n\tset selectCommand to selectCommand of prefs\n\tset objValue to objValue of prefs\n\tset clickIfAlreadySet to clickIfAlreadySet of prefs -- re-select even if popup is the requested value.\n\t\n\t\n\ttry\n\t\ttell application \"System Events\"\n\t\t\tif not (exists objRef) then error \"The specified objRef does not exist.\" number 1024\n\t\t\t\n\t\t\t\n\t\t\t-- the objRef DOES exist\n\t\t\tset mustPick to false\n\t\t\tif not (exists value of objRef) then\n\t\t\t\t-- first check if the value of the objRef exists - if it doesn't, then we can't test it directly\n\t\t\t\tset mustPick to true\n\t\t\t\t\n\t\t\telse -- we can see the value without 'picking' the menu, so test it:\n\t\t\t\t-- note that our selection might be one of several 'matching' commands:\n\t\t\t\tif clickIfAlreadySet then\n\t\t\t\t\t-- RE-SELECT even if popup already is the requested value.\n\t\t\t\t\tset mustPick to true\n\t\t\t\t\t\n\t\t\t\telse if selectCommand is equal to \"is\" then\n\t\t\t\t\tif value of objRef is not objValue then\n\t\t\t\t\t\tset mustPick to true\n\t\t\t\t\tend if\n\t\t\t\t\t\n\t\t\t\telse if selectCommand is equal to \"contains\" then\n\t\t\t\t\tif value of objRef does not contain objValue then\n\t\t\t\t\t\tset mustPick to true\n\t\t\t\t\tend if\n\t\t\t\t\t\n\t\t\t\telse if selectCommand is equal to \"startsWith\" then\n\t\t\t\t\tif value of objRef does not start with objValue then\n\t\t\t\t\t\tset mustPick to true\n\t\t\t\t\tend if\n\t\t\t\t\t\n\t\t\t\telse if selectCommand is equal to \"beginsWith\" then\n\t\t\t\t\tif value of objRef does not start with objValue then\n\t\t\t\t\t\tset mustPick to true\n\t\t\t\t\tend if\n\t\t\t\t\t\n\t\t\t\telse if selectCommand is equal to \"endsWith\" then\n\t\t\t\t\tif value of objRef does not end with objValue then\n\t\t\t\t\t\tset mustPick to true\n\t\t\t\t\tend if\n\t\t\t\t\t\n\t\t\t\tend if\n\t\t\tend if\n\t\tend tell\n\t\t\n\t\t\n\t\t\n\t\tif mustPick then\n\t\t\tif objValue is not null then\n\t\t\t\t-- click pop up button so the menu becomes available\n\t\t\t\tdelay 0.3 -- short delay to make sure click can happen:\n\t\t\t\tclickObjectByCoords(objRef)\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t-- wait to see if menu becomes available\n\t\t\t\trepeat 100 times\n\t\t\t\t\ttry\n\t\t\t\t\t\ttell application \"System Events\"\n\t\t\t\t\t\t\ttell application process \"FileMaker Pro Advanced\"\n\t\t\t\t\t\t\t\tif exists (menu 1 of objRef) then exit repeat\n\t\t\t\t\t\t\tend tell\n\t\t\t\t\t\tend tell\n\t\t\t\t\ton error\n\t\t\t\t\t\tdelay 0.5\n\t\t\t\t\tend try\n\t\t\t\tend repeat\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif not (exists (menu 1 of objRef)) then\n\t\t\t\t\t-- SECOND attempt to click-then-wait for menu to be available, but give up sooner:\n\t\t\t\t\t\n\t\t\t\t\t-- click pop up button so the menu becomes available\n\t\t\t\t\tclickObjectByCoords(objRef)\n\t\t\t\t\t\n\t\t\t\t\t--wait until menu is available\n\t\t\t\t\trepeat 20 times\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t\ttell application \"System Events\"\n\t\t\t\t\t\t\t\ttell application process \"FileMaker Pro Advanced\"\n\t\t\t\t\t\t\t\t\tif exists (menu 1 of objRef) then exit repeat\n\t\t\t\t\t\t\t\tend tell\n\t\t\t\t\t\t\tend tell\n\t\t\t\t\t\ton error\n\t\t\t\t\t\t\tdelay 0.5\n\t\t\t\t\t\tend try\n\t\t\t\t\tend repeat\n\t\t\t\tend if\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t-- now pick an item from the pop up\n\t\t\t\ttell application \"System Events\"\n\t\t\t\t\tobjRef\n\t\t\t\t\tif selectCommand is equal to \"is\" then\n\t\t\t\t\t\tset objValue to first menu item of menu 1 of objRef whose name is objValue\n\t\t\t\t\telse if selectCommand is equal to \"contains\" then\n\t\t\t\t\t\tset objValue to first menu item of menu 1 of objRef whose name contains objValue\n\t\t\t\t\telse if selectCommand is equal to \"beginsWith\" then\n\t\t\t\t\t\tset objValue to first menu item of menu 1 of objRef whose name starts with objValue\n\t\t\t\t\telse if selectCommand is equal to \"endsWith\" then\n\t\t\t\t\t\tset objValue to first menu item of menu 1 of objRef whose name ends with objValue\n\t\t\t\t\telse\n\t\t\t\t\t\terror \"unable to pick objValue because select command is failed\" number -1024\n\t\t\t\t\tend if\n\t\t\t\t\t\n\t\t\t\t\ttell process \"FileMaker Pro Advanced\"\n\t\t\t\t\t\tclick objValue\n\t\t\t\t\tend tell\n\t\t\t\tend tell\n\t\t\t\t\n\t\t\t\t-- must tell FM to click since the value might now be available ( need to scroll )\n\t\t\t\t--clickObjectByCoords(objValue)\n\t\t\tend if\n\t\t\t\n\t\t\t\n\t\t\t-- set calc if there is one\n\t\t\tif calcValue of prefs is not null then fmGUI_SpecifyCalcWindowSet({calcValue:calcValue of prefs})\n\t\tend if\n\t\t\n\t\t\n\t\treturn true\n\ton error errMsg number errNum\n\t\terror \"unable to fmGUI_Popup_SelectByCommand ( value _\" & selectCommand & \"_ '\" & objValue & \"' in popup ) - \" & errMsg number errNum\n\tend try\nend fmGUI_Popup_SelectByCommand\n\n--------------------\n-- END OF CODE\n--------------------\n\non clickObjectByCoords(objRef)\n\ttell application \"htcLib\" to clickObjectByCoords(my coerceToString(objRef))\nend clickObjectByCoords\n\non fmGUI_SpecifyCalcWindowSet(prefs)\n\ttell application \"htcLib\" to fmGUI_SpecifyCalcWindowSet(prefs)\nend fmGUI_SpecifyCalcWindowSet\n\n\non coerceToString(incomingObject)\n\t-- 2017-07-12 ( eshagdar ): bootstrap code to bring a coerceToString into this file for the sample to run ( instead of having a copy of the handler locally ).\n\t\n\ttell application \"Finder\" to set coercePath to (container of (container of (path to me)) as text) & \"text parsing:coerceToString.applescript\"\n\tset codeCoerce to read file coercePath as text\n\ttell application \"htcLib\" to set codeCoerce to \"script codeCoerce \" & return & getTextBetween({sourceText:codeCoerce, beforeText:\"-- START OF CODE\", afterText:\"-- END OF CODE\"}) & return & \"end script\" & return & \"return codeCoerce\"\n\tset codeCoerce to run script codeCoerce\n\ttell codeCoerce to coerceToString(incomingObject)\nend coerceToString\n\n\n\non ensureObjectRef(someObjectRef)\n\t-- 2017-07-12 ( eshagdar ): bootstrap code to bring a ensureObjectRef into this file for the sample to run ( instead of having a copy of the handler locally ).\n\t\n\ttell application \"Finder\" to set ensureObjPath to (container of (container of (path to me)) as text) & \"text parsing:ensureObjectRef.applescript\"\n\tset codeEnsureObj to read file ensureObjPath as text\n\ttell application \"htcLib\" to set codeEnsureObj to \"script codeEnsureObj \" & return & getTextBetween({sourceText:codeEnsureObj, beforeText:\"-- START OF CODE\", afterText:\"-- END OF CODE\"}) & return & \"end script\" & return & \"return codeEnsureObj\"\n\tset codeEnsureObj to run script codeEnsureObj\n\ttell codeEnsureObj to ensureObjectRef(someObjectRef)\nend ensureObjectRef\n","new_contents":"-- fmGUI_Popup_SelectByCommand({objRef:\"\", objValue:\"\", calcValue:null, selectCommand:\"\", clickIfAlreadySet:\"\"})\n-- Daniel A. Shockley, NYHTC\n-- Selects a choice from a popup menu\n\n\n(*\nREQUIRES:\n\tclickObjectByCoords\n\tfmGUI_SpecifyCalcWindowSet\n\t\n\t \nHISTORY:\n\t2020-05-21 ( dshockley ): Try a 2nd time to click-and-wait for the menu to appear. And, don't try a 2nd \"exists\" command, since that seems to fail. Instead, save the result of that in a variable \"isMenuOpen\". \n\t1.4.1 - 2018-04-30 ( eshagdar ): tell FM to click on the value since it might not be visible ( and unclickable by CLI ).\n\t1.4 - 2017-09-22 ( eshagdar ): set calc using handler.\n\t1.3 - 2017-09-06 ( eshagdar ): added calcValue param that sets a calc in the 'Specify Calculation' that comes up.\n\t1.2 - 2017-09-05 ( eshagdar ): clicking done by handler\n\t1.1 - 2017-06-29 ( eshagdar ): prefs must be a record. incoming param may be a string, so ensure that it's an object reference.\n\t1.0 - created\n*)\n\n\non run\n\ttell application \"System Events\"\n\t\ttell application process \"FileMaker Pro Advanced\"\n\t\t\tset frontmost to true\n\t\t\tdelay 1\n\t\t\t--set popUpButtonRef to pop up button \"Available menu commands:\" of window 1\n\t\t\tset popUpButtonRef to pop up button \"View\" of window 1\n\t\tend tell\n\tend tell\n\t\n\tfmGUI_Popup_SelectByCommand({objRef:popUpButtonRef, objValue:\"limited...\", calcValue:\"If ( True; True; GetAsNumber ( \\\"1\\\" ) )\", clickIfAlreadySet:true})\n\t\nend run\n\n--------------------\n-- START OF CODE\n--------------------\n\non fmGUI_Popup_SelectByCommand(prefs)\n\t-- version 2020-05-21-1321\n\t\n\tset defaultPrefs to {objRef:null, objValue:null, calcValue:null, selectCommand:\"is\", clickIfAlreadySet:false}\n\tset prefs to prefs & defaultPrefs\n\t\n\tset objRef to ensureObjectRef(objRef of prefs)\n\tset selectCommand to selectCommand of prefs\n\tset objValue to objValue of prefs\n\tset clickIfAlreadySet to clickIfAlreadySet of prefs -- re-select even if popup is the requested value.\n\t\n\t\n\ttry\n\t\ttell application \"System Events\"\n\t\t\tif not (exists objRef) then error \"The specified objRef does not exist.\" number 1024\n\t\t\t\n\t\t\t\n\t\t\t-- the objRef DOES exist\n\t\t\tset mustPick to false\n\t\t\tif not (exists value of objRef) then\n\t\t\t\t-- first check if the value of the objRef exists - if it doesn't, then we can't test it directly\n\t\t\t\tset mustPick to true\n\t\t\t\t\n\t\t\telse -- we can see the value without 'picking' the menu, so test it:\n\t\t\t\t-- note that our selection might be one of several 'matching' commands:\n\t\t\t\tif clickIfAlreadySet then\n\t\t\t\t\t-- RE-SELECT even if popup already is the requested value.\n\t\t\t\t\tset mustPick to true\n\t\t\t\t\t\n\t\t\t\telse if selectCommand is equal to \"is\" then\n\t\t\t\t\tif value of objRef is not objValue then\n\t\t\t\t\t\tset mustPick to true\n\t\t\t\t\tend if\n\t\t\t\t\t\n\t\t\t\telse if selectCommand is equal to \"contains\" then\n\t\t\t\t\tif value of objRef does not contain objValue then\n\t\t\t\t\t\tset mustPick to true\n\t\t\t\t\tend if\n\t\t\t\t\t\n\t\t\t\telse if selectCommand is equal to \"startsWith\" then\n\t\t\t\t\tif value of objRef does not start with objValue then\n\t\t\t\t\t\tset mustPick to true\n\t\t\t\t\tend if\n\t\t\t\t\t\n\t\t\t\telse if selectCommand is equal to \"beginsWith\" then\n\t\t\t\t\tif value of objRef does not start with objValue then\n\t\t\t\t\t\tset mustPick to true\n\t\t\t\t\tend if\n\t\t\t\t\t\n\t\t\t\telse if selectCommand is equal to \"endsWith\" then\n\t\t\t\t\tif value of objRef does not end with objValue then\n\t\t\t\t\t\tset mustPick to true\n\t\t\t\t\tend if\n\t\t\t\t\t\n\t\t\t\tend if\n\t\t\tend if\n\t\tend tell\n\t\t\n\t\t\n\t\t\n\t\tif mustPick then\n\t\t\tif objValue is not null then\n\t\t\t\t\n\t\t\t\tset isMenuOpen to false (* INITIALIZE *)\n\t\t\t\t\n\t\t\t\t-- click pop up button so the menu becomes available\n\t\t\t\tdelay 0.3 -- short delay to make sure click can happen:\n\t\t\t\tclickObjectByCoords(objRef)\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t-- wait to see if menu becomes available\n\t\t\t\trepeat 100 times\n\t\t\t\t\ttry\n\t\t\t\t\t\ttell application \"System Events\"\n\t\t\t\t\t\t\ttell application process \"FileMaker Pro Advanced\"\n\t\t\t\t\t\t\t\tif exists (menu 1 of objRef) then\n\t\t\t\t\t\t\t\t\tset isMenuOpen to true\n\t\t\t\t\t\t\t\t\texit repeat\n\t\t\t\t\t\t\t\tend if\n\t\t\t\t\t\t\tend tell\n\t\t\t\t\t\tend tell\n\t\t\t\t\ton error\n\t\t\t\t\t\tdelay 0.5\n\t\t\t\t\tend try\n\t\t\t\tend repeat\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif not isMenuOpen then\n\t\t\t\t\t-- SECOND attempt to click-then-wait for menu to be available, but give up sooner:\n\t\t\t\t\t\n\t\t\t\t\t-- click pop up button so the menu becomes available\n\t\t\t\t\tclickObjectByCoords(objRef)\n\t\t\t\t\t\n\t\t\t\t\t--wait until menu is available\n\t\t\t\t\trepeat 20 times\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t\ttell application \"System Events\"\n\t\t\t\t\t\t\t\ttell application process \"FileMaker Pro Advanced\"\n\t\t\t\t\t\t\t\t\tif exists (menu 1 of objRef) then\n\t\t\t\t\t\t\t\t\t\tset isMenuOpen to true\n\t\t\t\t\t\t\t\t\t\texit repeat\n\t\t\t\t\t\t\t\t\tend if\n\t\t\t\t\t\t\t\tend tell\n\t\t\t\t\t\t\tend tell\n\t\t\t\t\t\ton error\n\t\t\t\t\t\t\tdelay 0.5\n\t\t\t\t\t\tend try\n\t\t\t\t\tend repeat\n\t\t\t\tend if\n\t\t\t\t\n\t\t\t\tif not isMenuOpen then\n\t\t\t\t\terror \"Was not able to get the popup _menu_ to appear (by clicking base object) so an item could be chosen.\" number 1024\n\t\t\t\tend if\n\t\t\t\t\n\t\t\t\t-- now pick an item from the pop up\n\t\t\t\ttell application \"System Events\"\n\t\t\t\t\tobjRef\n\t\t\t\t\tif selectCommand is equal to \"is\" then\n\t\t\t\t\t\tset objValue to first menu item of menu 1 of objRef whose name is objValue\n\t\t\t\t\telse if selectCommand is equal to \"contains\" then\n\t\t\t\t\t\tset objValue to first menu item of menu 1 of objRef whose name contains objValue\n\t\t\t\t\telse if selectCommand is equal to \"beginsWith\" then\n\t\t\t\t\t\tset objValue to first menu item of menu 1 of objRef whose name starts with objValue\n\t\t\t\t\telse if selectCommand is equal to \"endsWith\" then\n\t\t\t\t\t\tset objValue to first menu item of menu 1 of objRef whose name ends with objValue\n\t\t\t\t\telse\n\t\t\t\t\t\terror \"unable to pick objValue because select command is failed\" number -1024\n\t\t\t\t\tend if\n\t\t\t\t\t\n\t\t\t\t\ttell process \"FileMaker Pro Advanced\"\n\t\t\t\t\t\tclick objValue\n\t\t\t\t\tend tell\n\t\t\t\tend tell\n\t\t\t\t\n\t\t\t\t-- must tell FM to click since the value might now be available ( need to scroll )\n\t\t\t\t--clickObjectByCoords(objValue)\n\t\t\tend if\n\t\t\t\n\t\t\t\n\t\t\t-- set calc if there is one\n\t\t\tif calcValue of prefs is not null then fmGUI_SpecifyCalcWindowSet({calcValue:calcValue of prefs})\n\t\tend if\n\t\t\n\t\t\n\t\treturn true\n\ton error errMsg number errNum\n\t\terror \"unable to fmGUI_Popup_SelectByCommand ( value _\" & selectCommand & \"_ '\" & objValue & \"' in popup ) - \" & errMsg number errNum\n\tend try\nend fmGUI_Popup_SelectByCommand\n\n--------------------\n-- END OF CODE\n--------------------\n\non clickObjectByCoords(objRef)\n\ttell application \"htcLib\" to clickObjectByCoords(my coerceToString(objRef))\nend clickObjectByCoords\n\non fmGUI_SpecifyCalcWindowSet(prefs)\n\ttell application \"htcLib\" to fmGUI_SpecifyCalcWindowSet(prefs)\nend fmGUI_SpecifyCalcWindowSet\n\n\non coerceToString(incomingObject)\n\t-- 2017-07-12 ( eshagdar ): bootstrap code to bring a coerceToString into this file for the sample to run ( instead of having a copy of the handler locally ).\n\t\n\ttell application \"Finder\" to set coercePath to (container of (container of (path to me)) as text) & \"text parsing:coerceToString.applescript\"\n\tset codeCoerce to read file coercePath as text\n\ttell application \"htcLib\" to set codeCoerce to \"script codeCoerce \" & return & getTextBetween({sourceText:codeCoerce, beforeText:\"-- START OF CODE\", afterText:\"-- END OF CODE\"}) & return & \"end script\" & return & \"return codeCoerce\"\n\tset codeCoerce to run script codeCoerce\n\ttell codeCoerce to coerceToString(incomingObject)\nend coerceToString\n\n\n\non ensureObjectRef(someObjectRef)\n\t-- 2017-07-12 ( eshagdar ): bootstrap code to bring a ensureObjectRef into this file for the sample to run ( instead of having a copy of the handler locally ).\n\t\n\ttell application \"Finder\" to set ensureObjPath to (container of (container of (path to me)) as text) & \"text parsing:ensureObjectRef.applescript\"\n\tset codeEnsureObj to read file ensureObjPath as text\n\ttell application \"htcLib\" to set codeEnsureObj to \"script codeEnsureObj \" & return & getTextBetween({sourceText:codeEnsureObj, beforeText:\"-- START OF CODE\", afterText:\"-- END OF CODE\"}) & return & \"end script\" & return & \"return codeEnsureObj\"\n\tset codeEnsureObj to run script codeEnsureObj\n\ttell codeEnsureObj to ensureObjectRef(someObjectRef)\nend ensureObjectRef\n","subject":"make popup menu selecting work","message":"make popup menu selecting work\n","lang":"AppleScript","license":"mit","repos":"NYHTC\/applescript-fm-helper"}
{"commit":"f7e13b186448f0b101236405df90d7e5bbfc16c1","old_file":"connector-osx-kn6.scpt","new_file":"connector-osx-kn6.scpt","old_contents":"--\n--  slideshow -- Observe and Control Slideshow Applications\n--  Copyright (c) 2014-2015 Ralf S. Engelschall <http:\/\/engelschall.com>\n--\n--  This Source Code Form is subject to the terms of the Mozilla Public\n--  License (MPL), version 2.0. If a copy of the MPL was not distributed\n--  with this file, You can obtain one at http:\/\/mozilla.org\/MPL\/2.0\/.\n--\n--  File:     connector-osx-kn6.js\n--  Purpose:  connector engine for Apple Keynote 6 under Mac OS X\n--  Language: AppleScript\n--\n\n--  utility function\non filterText(this_text, allowed_chars)\n   set new_text to \"\"\n   repeat with this_char in this_text\n       set x to the offset of this_char in allowed_chars\n       if x is not 0 then\n           set new_text to (new_text & this_char) as string\n       end if\n   end repeat\n   return new_text\nend filterText\n\n--  utility function\non replaceText(this_text, search_string, replacement_string)\n   set AppleScript's text item delimiters to the search_string\n   set the item_list to every text item of this_text\n   set AppleScript's text item delimiters to the replacement_string\n   set this_text to the item_list as string\n   set AppleScript's text item delimiters to \"\"\n   return this_text\nend replace_chars\n\n--  utility function\non asciiCharset()\n    set charset to \" \\\"'!#$%()*+,-.\/:;<=>?@[\\\\]^_{|}~\"\n    set charset to (charset & \"0123456789\")\n    set charset to (charset & \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\")\n    set charset to (charset & \"abcdefghijklmnopqrstuvwxyz\")\n    return charset\nend asciiCharset\n\n--  get application state\non knGetState()\n    set state to \"closed\"\n    tell application \"System Events\"\n        set is_running to (exists (some process whose name is \"Keynote\"))\n    end tell\n    if is_running then\n       try\n            set state to \"running\"\n            tell application \"Keynote\"\n                if false then -- FIXME: how to detect play mode?\n                    set state to \"viewing\"\n                else if (get count of slides of front document) > 0 then\n                    set state to \"editing\"\n                end if\n            end tell\n        on error errMsg\n        end try\n    end if\n    return state\nend knGetState\n\n--  get Apple Keynote current slide\non knGetCurSlide()\n    try\n        tell application \"Keynote\"\n            if false then -- FIXME: how to detect play mode?\n                return (get slide number of current slide of front document) -- FIXME: wrong!\n            else\n                return (get slide number of current slide of front document)\n            end if\n        end tell\n    on error errMsg\n        return 0\n    end try\nend knGetCurSlide\n\n--  get Apple Keynote maximum slide\non knGetMaxSlide()\n    try\n        tell application \"Keynote\"\n            return (get count of slides of front document)\n        end tell\n    on error errMsg\n        return 0\n    end try\nend knGetMaxSlide\n\n--  the STATE command\non cmdSTATE()\n    set state to knGetState()\n    if state is \"closed\" then\n        set position to 0\n        set slides to 0\n    else\n        set position to knGetCurSlide()\n        set slides to knGetMaxSlide()\n    end if\n    return (\"{ \\\"response\\\": { \" & \u00ac\n        \"\\\"state\\\": \\\"\" & state & \"\\\", \" & \u00ac\n        \"\\\"position\\\": \" & position & \", \" & \u00ac\n        \"\\\"slides\\\": \" & slides & \" \" & \u00ac\n    \"} }\")\nend cmdSTATE\n\n--  the INFO command\non cmdINFO()\n    set output to \"\"\n    if knGetMaxSlide() is 0 then\n        error \"still no active presentation\"\n    end if\n    tell application \"Keynote\"\n        set thePresentation to front document\n        set theTitles to \"\"\n        set theNotes to \"\"\n        set slideCount to (get count of slides of thePresentation)\n        repeat with slideNum from 1 to slideCount\n            set theSlide to slide slideNum of thePresentation\n\n            set theTitle to (get object text of default title item of theSlide) as string\n            if theTitles is not \"\" then\n                set theTitles to (theTitles & \", \")\n            end if\n            set theTitles to (theTitles & \"\\\"\" & (my replaceText(theTitle, \"\\\"\", \"\\\\\\\"\")) & \"\\\"\")\n\n            set theNote to (presenter notes of theSlide) as string\n            set theNote to (my filterText(theNote, my asciiCharset()))\n            if theNotes is not \"\" then\n                set theNotes to (theNotes & \", \")\n            end if\n            set theNotes to (theNotes & \"\\\"\" & (my replaceText(theNote, \"\\\"\", \"\\\\\\\"\")) & \"\\\"\")\n\n        end repeat\n        set theTitles to (\"[ \" & theTitles & \" ]\")\n        set theNotes to (\"[ \" & theNotes & \" ]\")\n        set output to (\"{ \\\"response\\\": { \\\"titles\\\": \" & theTitles & \", \\\"notes\\\": \" & theNotes & \" } }\")\n    end tell\n    return output\nend cmdINFO\n\n--  the control commands\non cmdCTRL(command, arg)\n    set state to knGetState()\n    if command is \"BOOT\" then\n        if state is not \"closed\" then\n            error \"application already running\"\n        end if\n        tell application \"Keynote\"\n            activate\n        end tell\n    else if command is \"QUIT\" then\n        if state is \"closed\" then\n            error \"application already closed\"\n        end if\n        tell application \"Keynote\"\n            quit\n        end tell\n    else if command is \"OPEN\" then\n        if state is \"editing\" or state is \"viewing\" then\n            error \"active presentation already existing\"\n        end if\n        tell application \"Keynote\"\n            tell application \"Finder\" to set thePath to \u00ac\n                POSIX file (POSIX path of (container of (path to me) as string) & (arg)) as alias\n            open thePath\n        end tell\n    else if command is \"CLOSE\" then\n        if state is \"closed\" or state is \"running\" then\n            error \"still no active presentation\"\n        end if\n        tell application \"Keynote\"\n            close front document\n        end tell\n    else if command is \"START\" then\n        if state is \"closed\" or state is \"running\" then\n            error \"still no active presentation\"\n        end if\n        if state is \"viewing\" then\n            error \"active presentation already viewing\"\n        end if\n        tell application \"Keynote\"\n            start front document from (slide 1 of front document)\n        end tell\n    else if command is \"STOP\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            stop front document\n        end tell\n    else if command is \"PAUSE\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            activate\n            tell application \"System Events\" to keystroke \"b\"\n        end tell\n    else if command is \"RESUME\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            activate\n            tell application \"System Events\" to keystroke \"b\"\n        end tell\n    else if command is \"FIRST\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            repeat with i from 1 to (my knGetMaxSlide())\n                try\n                    show previous\n                on error errMsg\n                    exit repeat\n                end try\n                delay 0.02\n            end repeat\n        end tell\n    else if command is \"LAST\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            repeat with i from 1 to ((my knGetMaxSlide()) - 1)\n                try\n                    show next\n                on error errMsg\n                    exit repeat\n                end try\n                delay 0.02\n            end repeat\n        end tell\n    else if command is \"GOTO\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            repeat with i from 1 to (my knGetMaxSlide())\n                try\n                    show previous\n                on error errMsg\n                    exit repeat\n                end try\n                delay 0.02\n            end repeat\n            repeat with i from 1 to ((arg as integer) - 1)\n                try\n                    show next\n                end try\n                delay 0.02\n            end repeat\n        end tell\n    else if command is \"PREV\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show previous\n        end tell\n    else if command is \"NEXT\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show next\n        end tell\n    end if\n    return \"{ \\\"response\\\": \\\"OK\\\" }\"\nend cmdCTRL\n\n--  main procedure\non run argv\n    set cmd to item 1 of argv\n    set arg to \"\"\n    if count of argv is 2 then\n        set arg to item 2 of argv\n    end if\n    try\n        if cmd is \"STAT\" then\n            set output to cmdSTATE()\n        else if cmd is \"INFO\" then\n            set output to cmdINFO()\n        else if cmd is \"BOOT\" \u00ac\n            or cmd is \"QUIT\" \u00ac\n            or cmd is \"OPEN\" \u00ac\n            or cmd is \"CLOSE\" \u00ac\n            or cmd is \"START\" \u00ac\n            or cmd is \"STOP\" \u00ac\n            or cmd is \"PAUSE\" \u00ac\n            or cmd is \"RESUME\" \u00ac\n            or cmd is \"FIRST\" \u00ac\n            or cmd is \"LAST\" \u00ac\n            or cmd is \"GOTO\" \u00ac\n            or cmd is \"PREV\" \u00ac\n            or cmd is \"NEXT\" then\n            set output to cmdCTRL(cmd, arg)\n        else\n            set output to \"{ \\\"error\\\": \\\"invalid command\\\" }\"\n        end if\n    on error errMsg\n        set output to (\"{ \\\"error\\\": \\\"\" & errMsg & \"\\\" }\")\n    end try\n    copy output to stdout\nend run\n\n","new_contents":"--\n--  slideshow -- Observe and Control Slideshow Applications\n--  Copyright (c) 2014-2015 Ralf S. Engelschall <http:\/\/engelschall.com>\n--\n--  This Source Code Form is subject to the terms of the Mozilla Public\n--  License (MPL), version 2.0. If a copy of the MPL was not distributed\n--  with this file, You can obtain one at http:\/\/mozilla.org\/MPL\/2.0\/.\n--\n--  File:     connector-osx-kn6.scpt\n--  Purpose:  connector engine for Apple Keynote 6 under Mac OS X\n--  Language: AppleScript\n--\n\n--  utility function\non filterText(this_text, allowed_chars)\n   set new_text to \"\"\n   repeat with this_char in this_text\n       set x to the offset of this_char in allowed_chars\n       if x is not 0 then\n           set new_text to (new_text & this_char) as string\n       end if\n   end repeat\n   return new_text\nend filterText\n\n--  utility function\non replaceText(this_text, search_string, replacement_string)\n   set AppleScript's text item delimiters to the search_string\n   set the item_list to every text item of this_text\n   set AppleScript's text item delimiters to the replacement_string\n   set this_text to the item_list as string\n   set AppleScript's text item delimiters to \"\"\n   return this_text\nend replace_chars\n\n--  utility function\non asciiCharset()\n    set charset to \" \\\"'!#$%()*+,-.\/:;<=>?@[\\\\]^_{|}~\"\n    set charset to (charset & \"0123456789\")\n    set charset to (charset & \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\")\n    set charset to (charset & \"abcdefghijklmnopqrstuvwxyz\")\n    return charset\nend asciiCharset\n\n--  get application state\non knGetState()\n    set state to \"closed\"\n    tell application \"System Events\"\n        set is_running to (exists (some process whose name is \"Keynote\"))\n    end tell\n    if is_running then\n       try\n            set state to \"running\"\n            tell application \"Keynote\"\n                if false then -- FIXME: how to detect play mode?\n                    set state to \"viewing\"\n                else if (get count of slides of front document) > 0 then\n                    set state to \"editing\"\n                end if\n            end tell\n        on error errMsg\n        end try\n    end if\n    return state\nend knGetState\n\n--  get Apple Keynote current slide\non knGetCurSlide()\n    try\n        tell application \"Keynote\"\n            if false then -- FIXME: how to detect play mode?\n                return (get slide number of current slide of front document) -- FIXME: wrong!\n            else\n                return (get slide number of current slide of front document)\n            end if\n        end tell\n    on error errMsg\n        return 0\n    end try\nend knGetCurSlide\n\n--  get Apple Keynote maximum slide\non knGetMaxSlide()\n    try\n        tell application \"Keynote\"\n            return (get count of slides of front document)\n        end tell\n    on error errMsg\n        return 0\n    end try\nend knGetMaxSlide\n\n--  the STATE command\non cmdSTATE()\n    set state to knGetState()\n    if state is \"closed\" then\n        set position to 0\n        set slides to 0\n    else\n        set position to knGetCurSlide()\n        set slides to knGetMaxSlide()\n    end if\n    return (\"{ \\\"response\\\": { \" & \u00ac\n        \"\\\"state\\\": \\\"\" & state & \"\\\", \" & \u00ac\n        \"\\\"position\\\": \" & position & \", \" & \u00ac\n        \"\\\"slides\\\": \" & slides & \" \" & \u00ac\n    \"} }\")\nend cmdSTATE\n\n--  the INFO command\non cmdINFO()\n    set output to \"\"\n    if knGetMaxSlide() is 0 then\n        error \"still no active presentation\"\n    end if\n    tell application \"Keynote\"\n        set thePresentation to front document\n        set theTitles to \"\"\n        set theNotes to \"\"\n        set slideCount to (get count of slides of thePresentation)\n        repeat with slideNum from 1 to slideCount\n            set theSlide to slide slideNum of thePresentation\n\n            set theTitle to (get object text of default title item of theSlide) as string\n            if theTitles is not \"\" then\n                set theTitles to (theTitles & \", \")\n            end if\n            set theTitles to (theTitles & \"\\\"\" & (my replaceText(theTitle, \"\\\"\", \"\\\\\\\"\")) & \"\\\"\")\n\n            set theNote to (presenter notes of theSlide) as string\n            set theNote to (my filterText(theNote, my asciiCharset()))\n            if theNotes is not \"\" then\n                set theNotes to (theNotes & \", \")\n            end if\n            set theNotes to (theNotes & \"\\\"\" & (my replaceText(theNote, \"\\\"\", \"\\\\\\\"\")) & \"\\\"\")\n\n        end repeat\n        set theTitles to (\"[ \" & theTitles & \" ]\")\n        set theNotes to (\"[ \" & theNotes & \" ]\")\n        set output to (\"{ \\\"response\\\": { \\\"titles\\\": \" & theTitles & \", \\\"notes\\\": \" & theNotes & \" } }\")\n    end tell\n    return output\nend cmdINFO\n\n--  the control commands\non cmdCTRL(command, arg)\n    set state to knGetState()\n    if command is \"BOOT\" then\n        if state is not \"closed\" then\n            error \"application already running\"\n        end if\n        tell application \"Keynote\"\n            activate\n        end tell\n    else if command is \"QUIT\" then\n        if state is \"closed\" then\n            error \"application already closed\"\n        end if\n        tell application \"Keynote\"\n            quit\n        end tell\n    else if command is \"OPEN\" then\n        if state is \"editing\" or state is \"viewing\" then\n            error \"active presentation already existing\"\n        end if\n        tell application \"Keynote\"\n            tell application \"Finder\" to set thePath to \u00ac\n                POSIX file (POSIX path of (container of (path to me) as string) & (arg)) as alias\n            open thePath\n        end tell\n    else if command is \"CLOSE\" then\n        if state is \"closed\" or state is \"running\" then\n            error \"still no active presentation\"\n        end if\n        tell application \"Keynote\"\n            close front document\n        end tell\n    else if command is \"START\" then\n        if state is \"closed\" or state is \"running\" then\n            error \"still no active presentation\"\n        end if\n        if state is \"viewing\" then\n            error \"active presentation already viewing\"\n        end if\n        tell application \"Keynote\"\n            start front document from (slide 1 of front document)\n        end tell\n    else if command is \"STOP\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            stop front document\n        end tell\n    else if command is \"PAUSE\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            activate\n            tell application \"System Events\" to keystroke \"b\"\n        end tell\n    else if command is \"RESUME\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            activate\n            tell application \"System Events\" to keystroke \"b\"\n        end tell\n    else if command is \"FIRST\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            repeat with i from 1 to (my knGetMaxSlide())\n                try\n                    show previous\n                on error errMsg\n                    exit repeat\n                end try\n                delay 0.02\n            end repeat\n        end tell\n    else if command is \"LAST\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            repeat with i from 1 to ((my knGetMaxSlide()) - 1)\n                try\n                    show next\n                on error errMsg\n                    exit repeat\n                end try\n                delay 0.02\n            end repeat\n        end tell\n    else if command is \"GOTO\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            repeat with i from 1 to (my knGetMaxSlide())\n                try\n                    show previous\n                on error errMsg\n                    exit repeat\n                end try\n                delay 0.02\n            end repeat\n            repeat with i from 1 to ((arg as integer) - 1)\n                try\n                    show next\n                end try\n                delay 0.02\n            end repeat\n        end tell\n    else if command is \"PREV\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show previous\n        end tell\n    else if command is \"NEXT\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show next\n        end tell\n    end if\n    return \"{ \\\"response\\\": \\\"OK\\\" }\"\nend cmdCTRL\n\n--  main procedure\non run argv\n    set cmd to item 1 of argv\n    set arg to \"\"\n    if count of argv is 2 then\n        set arg to item 2 of argv\n    end if\n    try\n        if cmd is \"STAT\" then\n            set output to cmdSTATE()\n        else if cmd is \"INFO\" then\n            set output to cmdINFO()\n        else if cmd is \"BOOT\" \u00ac\n            or cmd is \"QUIT\" \u00ac\n            or cmd is \"OPEN\" \u00ac\n            or cmd is \"CLOSE\" \u00ac\n            or cmd is \"START\" \u00ac\n            or cmd is \"STOP\" \u00ac\n            or cmd is \"PAUSE\" \u00ac\n            or cmd is \"RESUME\" \u00ac\n            or cmd is \"FIRST\" \u00ac\n            or cmd is \"LAST\" \u00ac\n            or cmd is \"GOTO\" \u00ac\n            or cmd is \"PREV\" \u00ac\n            or cmd is \"NEXT\" then\n            set output to cmdCTRL(cmd, arg)\n        else\n            set output to \"{ \\\"error\\\": \\\"invalid command\\\" }\"\n        end if\n    on error errMsg\n        set output to (\"{ \\\"error\\\": \\\"\" & errMsg & \"\\\" }\")\n    end try\n    copy output to stdout\nend run\n\n","subject":"fix filename in comment","message":"fix filename in comment\n","lang":"AppleScript","license":"mpl-2.0","repos":"rse\/slideshow,rse\/slideshow"}
{"commit":"f100ca90f9855179d549d93f5d47bfcea6091d68","old_file":"keynote.applescript","new_file":"keynote.applescript","old_contents":"on newPresentation(themeName)\n\ttell application \"Keynote\"\n\t\tactivate\n\t\t-- FIXME: Make this selectable?\n\t\tset targetWidth to 1024 -- 1440 <-- higher resolution\n\t\tset targetHeight to 768 -- 1080 <-- higher resolution\n\n\t\tset props to {document theme:theme (themeName as string), width:targetWidth, height:targetHeight}\n\n\t\tset thisDocument to make new document with properties props\n\t\treturn id of thisDocument\n\tend tell\nend newPresentation\n\non openPresentation(posixPath)\n\ttell application \"Keynote\"\n\t\topen posixPath\n\tend tell\nend openPresentation\n\non savePresentation(docId, posixPath)\n\ttell application \"Keynote\"\t\n\t\tactivate\t\n        set theDocument to document id docId\n\t\tsave theDocument in POSIX file posixPath\n        delete theDocument\n        open posixPath \n\tend tell\nend savePresentation\t\n\non closePresentation(docId)\n\ttell application \"Keynote\"\t\n\t\tactivate\t\n        set theDocument to document id docId\n\t\tclose theDocument\n\tend tell\nend savePresentation\t\n\n\non createSlide(docId, masterSlideName)\n\ttell application \"Keynote\"\n\t\ttell document id docId\n\t\t\tset thisSlide to make new slide with properties {base slide:master slide masterSlideName}\n\t\tend tell\n\tend tell\nend createSlide\n\non deleteAllSlides(docId)\n\ttell application \"Keynote\"\n\t\ttell document id docId to delete every slide\n\tend tell\nend deleteAllSlides\n\non finalize(docId)\n\ttell application \"Keynote\"\n\t\ttell document id docId to delete slide 1\n\tend tell\nend finalize\n\non themeMasters(docId)\n\t--\t  tell application \"Keynote\" to get the name of every master slide of thisDocument\n\ttell application \"Keynote\"\n\t\tset names to the name of every master slide of document id docId\n\t\treturn names\n\tend tell\nend themeMasters\n\non addImage(docId, slideIndex, n, filepath)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n  tell application \"Keynote\"\n\ttell slide slideIndex of document id docId\n\t\t-- TO REPLACE A PLACEHOLDER OR EXISTING IMAGE:\n\t\tset thisPlaceholderImageItem to image n\n\t\t-- change the value of the \u201cfile name\u201d property of the image to be an HFS file reference to the replacement image file\n\t    set macPath to POSIX file filepath as Unicode text\n\t\tset file name of thisPlaceholderImageItem to \u00ac\n\t\t\talias macPath\n\tend tell\n  end tell\nend addImage\n\n\non addTitle(docId, slideIndex, thisSlideTitle)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n\ttell application \"Keynote\"\n    \ttell slide slideIndex of document id docId\n\t\t\tset the object text of the default title item to thisSlideTitle\n\t\tend tell\n\tend tell\nend addTitle\n\non addBody(docId, slideIndex, thisSlideBody)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n\ttell application \"Keynote\"\n    \ttell slide slideIndex of document id docId\n            set the object text of the default body item to thisSlideBody\n\t\tend tell\n\tend tell\nend addTitle\n\n    (*\n  \tFIXME: Use slide ID to adress slide instead of \"current slide\"\n    *)\non addPresenterNotes(docId, slideIndex, theNotes)\n\ttell application \"Keynote\"\n    \ttell slide slideIndex of document id docId\n\t\t\tset presenter notes to theNotes\n\t\tend tell\n\tend tell\nend addPresenterNotes\n\non addText(docId, slideIndex, n, theText)\n  (*\n\tFIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n  tell application \"Keynote\"\n  \ttell slide slideIndex of document id docId\n\t\tset thisPlaceholderItem to text item n\n\t\tset object text of thisPlaceholderItem to theText\n\tend tell\n  end tell\nend addText\n\n","new_contents":"on newPresentation(themeName)\n\ttell application \"Keynote\"\n\t\tactivate\n\t\t-- FIXME: Make this selectable?\n\t\tset targetWidth to 1024 -- 1440 <-- higher resolution\n\t\tset targetHeight to 768 -- 1080 <-- higher resolution\n\n\t\tset props to {document theme:theme (themeName as string), width:targetWidth, height:targetHeight}\n\n\t\tset thisDocument to make new document with properties props\n\t\treturn id of thisDocument\n\tend tell\nend newPresentation\n\non openPresentation(posixPath)\n\ttell application \"Keynote\"\n\t\topen posixPath\n\tend tell\nend openPresentation\n\non savePresentation(docId, posixPath)\n\ttell application \"Keynote\"\t\n\t\tactivate\t\n        set theDocument to document id docId\n\t\tsave theDocument in POSIX file posixPath\n        delete theDocument\n        open posixPath \n\tend tell\nend savePresentation\t\n\non closePresentation(docId)\n\ttell application \"Keynote\"\t\n\t\tactivate\t\n        set theDocument to document id docId\n\t\tclose theDocument\n\tend tell\nend savePresentation\t\n\n\non createSlide(docId, masterSlideName)\n\ttell application \"Keynote\"\n\t\ttell document id docId\n\t\t\tset thisSlide to make new slide with properties {base slide:master slide masterSlideName}\n\t\tend tell\n\tend tell\nend createSlide\n\non deleteAllSlides(docId)\n\ttell application \"Keynote\"\n\t\ttell document id docId to delete every slide\n\tend tell\nend deleteAllSlides\n\non finalize(docId)\n\ttell application \"Keynote\"\n\t\ttell document id docId to delete slide 1\n\tend tell\nend finalize\n\non themeMasters(docId)\n\t--\t  tell application \"Keynote\" to get the name of every master slide of thisDocument\n\ttell application \"Keynote\"\n\t\tset names to the name of every master slide of document id docId\n\t\treturn names\n\tend tell\nend themeMasters\n\non addImage(docId, slideIndex, n, filepath)\n  tell application \"Keynote\"\n\ttell slide slideIndex of document id docId\n\t\t-- TO REPLACE A PLACEHOLDER OR EXISTING IMAGE:\n\t\tset thisPlaceholderImageItem to image n\n\t\t-- change the value of the \u201cfile name\u201d property of the image to be an HFS file reference to the replacement image file\n\t    set macPath to POSIX file filepath as Unicode text\n\t\tset file name of thisPlaceholderImageItem to \u00ac\n\t\t\talias macPath\n\tend tell\n  end tell\nend addImage\n\n\non addTitle(docId, slideIndex, thisSlideTitle)\n\ttell application \"Keynote\"\n    \ttell slide slideIndex of document id docId\n\t\t\tset the object text of the default title item to thisSlideTitle\n\t\tend tell\n\tend tell\nend addTitle\n\non addBody(docId, slideIndex, thisSlideBody)\n\ttell application \"Keynote\"\n    \ttell slide slideIndex of document id docId\n            set the object text of the default body item to thisSlideBody\n\t\tend tell\n\tend tell\nend addTitle\n\non addPresenterNotes(docId, slideIndex, theNotes)\n\ttell application \"Keynote\"\n    \ttell slide slideIndex of document id docId\n\t\t\tset presenter notes to theNotes\n\t\tend tell\n\tend tell\nend addPresenterNotes\n\non addText(docId, slideIndex, n, theText)\n  tell application \"Keynote\"\n  \ttell slide slideIndex of document id docId\n\t\tset thisPlaceholderItem to text item n\n\t\tset object text of thisPlaceholderItem to theText\n\tend tell\n  end tell\nend addText\n\n","subject":"Remove FIXME: comments","message":"Remove FIXME: comments\n","lang":"AppleScript","license":"mit","repos":"persquare\/md2keynote"}
{"commit":"7ef6ad3e6ed50045b124699e56e85215e978774b","old_file":"alfred_script.applescript","new_file":"alfred_script.applescript","old_contents":"on alfred_script(q)\n\n    set AppleScript's text item delimiters to {\" \"}\n\n    tell application \"Google Chrome\"\n        \n        if q is \"\" or q is \"p\" or q is \"pp\" or q is \"play\" or q is \"pause\" then\n            set buttonClass to \"play\"\n            set execCode to \"$('.\" & buttonClass & \"').first().click()\"\n        else if q is \"next\" or q is \"skip\" or q is \"n\" then\n            set buttonClass to \"next\"\n            set execCode to \"$('.\" & buttonClass & \"').first().click()\"\n        else\n            set argList to every text item of q\n            if item 1 of argList is \"genre\" then\n                set execCode to \"$('li.genre a')[\" & item 2 of argList & \"].click();\"\n            end if\n        end if\n        \n        set seenPlayerTab to 0\n        \n        set thisWindowIndex to 1\n        repeat with thisWindow in windows\n            \n            set thisTabIndex to 1\n            repeat with thisTab in tabs of thisWindow\n                \n                if URL of thisTab starts with \"https:\/\/www.focusatwill.com\/\" then\n                    set seenPlayerTab to 1\n                    exit repeat\n                end if\n                \n                set thisTabIndex to thisTabIndex + 1\n                \n            end repeat\n            \n            if seenPlayerTab is greater than 0 then\n                tell tab thisTabIndex of window thisWindowIndex\n                    execute javascript execCode\n                end tell\n                exit repeat\n            end if\n            \n            set thisWindowIndex to thisWindowIndex + 1\n            \n        end repeat\n        \n        if seenPlayerTab is 0 then\n            set newTab to make new tab at end of tabs of window 1\n            set URL of newTab to \"https:\/\/www.focusatwill.com\/music\/#player\"\n            delay 5\n            tell newTab\n                execute javascript execCode\n            end tell\n        end if\n        \n    end tell\nend alfred_script\n","new_contents":"on alfred_script(q)\n\n    set AppleScript's text item delimiters to {\" \"}\n\n    tell application \"Google Chrome\"\n        \n        if q is \"\" or q is \"p\" or q is \"pp\" or q is \"play\" or q is \"pause\" then\n            set execCode to \"document.getElementsByClassName('play')[0].click()\"\n        else if q is \"next\" or q is \"skip\" or q is \"n\" then\n            set execCode to \"document.getElementsByClassName('next')[0].click()\"\n        else\n            set argList to every text item of q\n            if item 1 of argList is \"genre\" then\n                set execCode to \"document.querySelectorAll('li.genre a')[\" & item 2 of argList & \"].click();\"\n            end if\n        end if\n        \n        set seenPlayerTab to 0\n        \n        set thisWindowIndex to 1\n        repeat with thisWindow in windows\n            \n            set thisTabIndex to 1\n            repeat with thisTab in tabs of thisWindow\n                \n                if URL of thisTab starts with \"https:\/\/www.focusatwill.com\/\" then\n                    set seenPlayerTab to 1\n                    exit repeat\n                end if\n                \n                set thisTabIndex to thisTabIndex + 1\n                \n            end repeat\n            \n            if seenPlayerTab is greater than 0 then\n                tell tab thisTabIndex of window thisWindowIndex\n                    execute javascript execCode\n                end tell\n                exit repeat\n            end if\n            \n            set thisWindowIndex to thisWindowIndex + 1\n            \n        end repeat\n        \n        if seenPlayerTab is 0 then\n            set newTab to make new tab at end of tabs of window 1\n            set URL of newTab to \"https:\/\/www.focusatwill.com\/music\/#player\"\n            delay 5\n            tell newTab\n                execute javascript execCode\n            end tell\n        end if\n        \n    end tell\nend alfred_script\n","subject":"Fix broken javascript calls","message":"[#2]: Fix broken javascript calls\n\nAt some point, using $() seems to have broken in Chrome. Replaced those\ncalls with equivalent DOM calls in vanilla Javascript.\n","lang":"AppleScript","license":"mit","repos":"tangledhelix\/focusatwill-in-google-chrome,tangledhelix\/focusatwill-in-google-chrome"}
{"commit":"18f3993c1bf2b5153b42e60900bfa056ecdb3a11","old_file":"scripts\/resetsimulator.applescript","new_file":"scripts\/resetsimulator.applescript","old_contents":"tell application \"System Events\" to tell process \"iOS Simulator\"\n\tactivate\n\tset frontmost to true\n\tclick menu item \"Reset Content and Settings\" of menu 0 of menu bar item \"iOS Simulator\" of menu bar 1\n\tclick button \"Reset\" of window \"\"\n  return\nend tell\n","new_contents":"tell application \"System Events\" to tell process \"iOS Simulator\"\n\tactivate\n\tset frontmost to true\n\tclick menu item \"Reset Content and Settings\" of menu 0 of menu bar item \"iOS Simulator\" of menu bar 1\n  delay 0.1\n  tell application \"System Events\" to key code 36\n\t-- click button \"Reset\" of window \"\"\n  return\nend tell\n","subject":"Update reset sim script","message":"Update reset sim script\n","lang":"AppleScript","license":"mit","repos":"keith\/dotfiles,keith\/dotfiles,keith\/dotfiles,keith\/dotfiles,keith\/dotfiles,keith\/dotfiles"}
{"commit":"27662e0fbc68898a0673ac711c0413a1351880c7","old_file":"uninstall.applescript","new_file":"uninstall.applescript","old_contents":"property stdout : \"\"\non run\n\tset newline to ASCII character 10\n\t\n\tset stdout to stdout & \"  shutdown Terminal ...\" & newline\n\ttry\n\t\ttell application \"Terminal\" to quit\n\ton error\n\t\tset stdout to stdout & \"    Terminal was not running prior uninstallation\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalTerminal.app ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Applications\/TotalTerminal.app\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Applications\/TotalTerminal.app\" & newline\n\tend try\n\t\n\t\n\tset stdout to stdout & \"  remove TotalTerminal.osax ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Library\/ScriptingAdditions\/TotalTerminal.osax\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Library\/ScriptingAdditions\/TotalTerminal.osax\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  relaunch Terminal ...\" & newline\n\ttry\n\t\ttell application \"Terminal\" to launch\n\ton error\n\t\tset stdout to stdout & \"    failed to relaunch Terminal\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"TotalTerminal uninstallation finished\" & newline\n\t\n\t-- at this point Terminal should start cleanly and with no signs of TotalTerminal\n\t-- you may check Events\/Replies tab to see if there were no issues with uninstallation\n\t\n\tstdout -- this is needed for platypus to display output in details window\nend run","new_contents":"property stdout : \"\"\non run\n\tset newline to ASCII character 10\n\t\n\tset stdout to stdout & \"  shutdown Terminal ...\" & newline\n\ttry\n\t\ttell application \"Terminal\" to quit\n\ton error\n\t\tset stdout to stdout & \"    Terminal was not running prior uninstallation\" & newline\n\tend try\n\n\tset stdout to stdout & \"  shutdown TotalTerminalCrashWatcher ...\" & newline\n\ttry\n\t\tdo shell script \"killall -SIGINT TotalTerminalCrashWatcher\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    TotalTerminalCrashWatcher was not running\" & newline\n\tend try\n\t\t\n\tset stdout to stdout & \"  remove TotalTerminal.app ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Applications\/TotalTerminal.app\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Applications\/TotalTerminal.app\" & newline\n\tend try\n\t\n\t\n\tset stdout to stdout & \"  remove TotalTerminal.osax ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Library\/ScriptingAdditions\/TotalTerminal.osax\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Library\/ScriptingAdditions\/TotalTerminal.osax\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  relaunch Terminal ...\" & newline\n\ttry\n\t\ttell application \"Terminal\" to launch\n\ton error\n\t\tset stdout to stdout & \"    failed to relaunch Terminal\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"TotalTerminal uninstallation done\" & newline\n\t\n\t-- at this point Terminal should start cleanly and with no signs of TotalTerminal\n\t-- you may check Events\/Replies tab to see if there were no issues with uninstallation\n\t\n\tstdout -- this is needed for platypus to display output in details window\nend run","subject":"add shutdown step for TotalTerminalCrashWatcher","message":"add shutdown step for TotalTerminalCrashWatcher\n","lang":"AppleScript","license":"bsd-3-clause","repos":"binaryage\/totalterminal-installer"}
{"commit":"a66ad01492219045da0ae3888ef0da80168573dc","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\n-- brings queue into view in iTunes window\non focusQueue()\n\n\ttell application \"iTunes\"\n\n\t\treveal user playlist workflowPlaylistName\n\n\tend tell\n\nend focusQueue\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to first user playlist whose id is playlistId\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif disc number of theSong is discIndex and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\n\tfocusQueue()\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tfocusQueue()\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 25\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred-3:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkCacheFolderName : \"Album Artwork\"\nproperty artworkCachePath : (workflowCacheFolder & artworkCacheFolderName & \":\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- the text used to determine if a track is an audio file\nproperty songDescriptor : \"audio\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- builds path to album art for the given song\non getSongArtworkPath(theSong)\n\n\tif albumArtEnabled is false then return defaultIconName\n\n\ttell application \"iTunes\"\n\n\t\tset songArtist to artist of theSong\n\t\tset songAlbum to album of theSong\n\t\t-- generate a unique identifier for that album\n\t\tset songArtworkName to (songArtist & songArtworkNameSep & songAlbum) as text\n\t\t-- remove forbidden path characters\n\t\tset songArtworkName to replace(\":\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\"\/\", \"\", songArtworkName) of me\n\t\tset songArtworkName to replace(\".\", \"\", songArtworkName) of me\n\t\tset songArtworkPath to (artworkCachePath & songArtworkName & \".jpg\")\n\n\tend tell\n\n\ttell application \"Finder\"\n\n\t\t-- cache artwork if it's not already cached\n\t\tif not (songArtworkPath exists) then\n\n\t\t\ttell application \"iTunes\"\n\n\t\t\t\tset songArtworks to artworks of theSong\n\t\t\t\t-- only save artwork if artwork exists for this song\n\t\t\t\tif (length of songArtworks) is 0 then\n\n\t\t\t\t\t-- use default iTunes icon if song has no artwork\n\t\t\t\t\tset songArtworkPath to defaultIconName\n\n\t\t\t\telse\n\n\t\t\t\t\t-- save artwork to file\n\t\t\t\t\tset songArtwork to data of (item 1 of songArtworks)\n\t\t\t\t\tfileWrite(songArtworkPath, songArtwork) of me\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\tend if\n\n\tend tell\n\n\treturn songArtworkPath\n\nend getSongArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"iTunes\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"iTunes\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\n-- brings queue into view in iTunes window\non focusQueue()\n\n\ttell application \"iTunes\"\n\n\t\treveal user playlist workflowPlaylistName\n\n\tend tell\n\nend focusQueue\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"iTunes\"\n\n\t\tset thePlaylist to first user playlist whose id is playlistId\n\t\tset theSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn theSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose genre is genreName and kind contains songDescriptor\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset theSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset theSongs to theSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn theSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose artist is artistName and kind contains songDescriptor\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"iTunes\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset theSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName and kind contains songDescriptor)\n\t\t\tset albumSongs to sortSongsByAlbumOrder(albumSongs) of me\n\t\t\tset theSongs to theSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn theSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongs to every track of playlist 2 whose album is albumName and kind contains songDescriptor\n\t\tset theSongs to sortSongsByAlbumOrder(theSongs) of me\n\n\tend tell\n\n\treturn theSongs\n\nend getAlbumSongs\n\n-- sorts songs from the same album by track number\non sortSongsByAlbumOrder(theSongs)\n\n\ttell application \"iTunes\"\n\n\t\tset theSongsSorted to theSongs\n\n\t\tif length of theSongs is greater than 1 then\n\n\t\t\tset trackCount to track count of (item 1 of theSongs)\n\t\t\tset discCount to disc count of (item 1 of theSongs)\n\n\t\t\tif trackCount is not 0 and discCount is not 0 then\n\n\t\t\t\tset theSongsSorted to {} as list\n\n\t\t\t\trepeat with discIndex from 1 to discCount\n\n\t\t\t\t\trepeat with songIndex from 1 to trackCount\n\n\t\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\t\tif disc number of theSong is discIndex and track number of theSong is songIndex then\n\n\t\t\t\t\t\t\t\tset nextSong to theSong\n\t\t\t\t\t\t\t\tcopy nextSong to the end of theSongsSorted\n\n\t\t\t\t\t\t\tend if\n\n\t\t\t\t\t\tend repeat\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend repeat\n\n\t\t\tend if\n\n\t\tend if\n\n\tend tell\n\n\treturn theSongsSorted\n\nend sortSongsByAlbumOrder\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"iTunes\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId and kind contains songDescriptor\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit, songDescriptor)\n\n\t\t\ttell application \\\"iTunes\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query and kind contains songDescriptor)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query) and kind contains songDescriptor)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit, songDescriptor)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset theSongs to getAlbumSongs(albumName)\n\tqueueSongs(theSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset theSongs to getArtistSongs(artistName)\n\tqueueSongs(theSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset theSongs to getGenreSongs(genreName)\n\tqueueSongs(theSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset theSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(theSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unknown type: \" & theType\n\tend if\n\n\tfocusQueue()\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tfocusQueue()\n\tplayQueue()\n\nend play\n","subject":"Add generic iTunes search as an additional fallback","message":"Add generic iTunes search as an additional fallback\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"bbdafa44a8e4e49cb8a44e4b55cb1cec3d7612c7","old_file":"macosx\/scripts\/iTunes\/mobile-speakers.applescript","new_file":"macosx\/scripts\/iTunes\/mobile-speakers.applescript","old_contents":"(*\n  Script object to make calling a defined function easier while in the\n  iTunes and System Events name space.\n*)\nscript remoteSpeakerFinder\n  -- Given a list of buttons, find the remote speakers button\n  -- by finding the first button with a name that isn't in a \n  -- rejection list.\n  on findCorrectButton (in_buttons)\n    set buttons_to_skip to {\"Burn Disc\"}\n\n    repeat with a_button in in_buttons\n      try -- some buttons don't have names\n        set the_name to name of a_button\n        if buttons_to_skip does not contain {the_name} then\n          return the_name\n        end if\n      end try\n    end repeat\n\n    return 16 -- default response\n  end findCorrectButton\nend script\n\n(*\n  Tell iTunes to use the \"Mobile\" set of remote speakers.\n*)\ntell application \"iTunes\"\n  set the_bwindow to (get first browser window)\n  set the_state to (get minimized of the_bwindow)\n  set visible of the_bwindow to true\n  set minimized of the_bwindow to false\nend tell\n\ntell application \"System Events\"\n  tell process \"iTunes\"\n        \n     set the_buttons to (get buttons of window 1)\n     set the_speaker_button to (remoteSpeakerFinder's findCorrectButton(the_buttons))\n\n     -- Switch to the speakers in my bedroom\n     set frontmost to true\n     click button the_speaker_button of window 1\n     key code 115                -- Home Key (first speaker in list)\n     key code 125                -- Down Arrow\n     key code 125                -- Down Arrow\n     key code 36                 -- Return Key\n\n     -- Wait for iTunes to connect to the speakers\n     delay 5\n  end tell\nend tell\n\ntell application \"iTunes\"\n  -- Return window to previous state\n  set minimized of the_bwindow to the_state\nend tell\n","new_contents":"(*\n  Script object to make calling a defined function easier while in the\n  iTunes and System Events name space.\n*)\nscript remoteSpeakerFinder\n\tglobal the_bwindow, the_state\n\t\n\t-- Given a list of buttons, find the remote speakers button\n\t-- by finding the first button with a name that isn't in a \n\t-- rejection list.\n\ton findCorrectButton(in_buttons)\n\t\tset buttons_to_skip to {\"Burn Disc\"}\n\t\t\n\t\trepeat with a_button in in_buttons\n\t\t\ttry -- some buttons don't have names\n\t\t\t\tset the_name to name of a_button\n\t\t\t\tif buttons_to_skip does not contain {the_name} then\n\t\t\t\t\treturn the_name\n\t\t\t\tend if\n\t\t\tend try\n\t\tend repeat\n\t\t\n\t\treturn 16 -- default response\n\tend findCorrectButton\n\t\n\ton setRemoteSpeakersTo(item_index)\n\t\ttell application \"System Events\"\n\t\t\ttell process \"iTunes\"\n\t\t\t\t\n\t\t\t\tset the_buttons to (get buttons of window 1)\n\t\t\t\tset the_speaker_button to (remoteSpeakerFinder's findCorrectButton(the_buttons))\n\t\t\t\t\n\t\t\t\t-- Switch to the speakers in my bedroom\n\t\t\t\tset frontmost to true\n\t\t\t\tclick button the_speaker_button of window 1\n\t\t\t\tkey code 115 -- Home Key (first speaker in list)\n\t\t\t\t\n\t\t\t\trepeat item_index times\n\t\t\t\t\tkey code 125 -- Down Arrow\n\t\t\t\tend repeat\n\t\t\t\t\n\t\t\t\tkey code 36 -- Return Key\n\t\t\t\t\n\t\t\t\t-- Wait for iTunes to connect to the speakers\n\t\t\t\tdelay 5\n\t\t\tend tell\n\t\tend tell\n\tend setRemoteSpeakersTo\n\t\n\ton prepareWindow()\n\t\ttell application \"iTunes\"\n\t\t\tset the_bwindow to (get first browser window)\n\t\t\tset the_state to (get minimized of the_bwindow)\n\t\t\tset visible of the_bwindow to true\n\t\t\tset minimized of the_bwindow to false\n\t\tend tell\n\tend prepareWindow\n\t\n\ton resetWindow()\n\t\ttell application \"iTunes\"\n\t\t\t-- Return window to previous state\n\t\t\tset minimized of the_bwindow to the_state\n\t\tend tell\n\tend resetWindow\nend script\n\non handle_string(s)\n\tremoteSpeakerFinder's prepareWindow()\n\tremoteSpeakerFinder's setRemoteSpeakersTo(s)\n\tremoteSpeakerFinder's resetWindow()\n\tset volume 1\n\ttell application \"iTunes\"\n\t\tplay (get the first item of (get every track where database ID is 24759))\n\tend tell\nend handle_string\n\non run\n\tremoteSpeakerFinder's prepareWindow()\n\tremoteSpeakerFinder's setRemoteSpeakersTo(2)\n\tremoteSpeakerFinder's resetWindow()\nend run\n","subject":"Add a way to select which speakers to set","message":"Add a way to select which speakers to set\n","lang":"AppleScript","license":"bsd-3-clause","repos":"pjones\/emacsrc"}
{"commit":"68aa4a3a8855980a01290679cc36cbc1e0a5bf10","old_file":"run.scpt","new_file":"run.scpt","old_contents":"JsOsaDAS1.001.00bplist00\u0001\u0002Vscript_\u0010var app = Application(\"Unity\");\napp.activate();\ndelay(0.15);\nsys = Application(\"System Events\");\nsys.keystroke(\"p\", { using: \"command down\"});\b\u000b\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000jscr\u0000\u0001\u0000\f\u07ad","new_contents":"var app = Application(\"Unity\");\napp.activate();\ndelay(0.15);\nsys = Application(\"System Events\");\nsys.keystroke(\"p\", { using: \"command down\"});\n","subject":"convert textfile","message":"convert textfile\n","lang":"AppleScript","license":"mit","repos":"katapad\/unity-runner"}
{"commit":"00bc0213301804471b0b5c8cdcf18f2bd7bc6f39","old_file":"CopyFinderButton.app\/Contents\/Resources\/Scripts\/main.scpt","new_file":"CopyFinderButton.app\/Contents\/Resources\/Scripts\/main.scpt","old_contents":"JsOsaDAS1.001.00bplist00\u0001\u0002Vscripto\u0011\u00074\u0000\/\u0000\/\u0000 \u0000 \u0000T\u0000h\u0000e\u0000 \u0000M\u0000I\u0000T\u0000 \u0000L\u0000i\u0000c\u0000e\u0000n\u0000s\u0000e\u0000 \u0000(\u0000M\u0000I\u0000T\u0000)\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000C\u0000o\u0000p\u0000y\u0000r\u0000i\u0000g\u0000h\u0000t\u0000 \u0000\u0000 \u00002\u00000\u00001\u00007\u0000 \u0000L\u0000e\u0000x\u0000 \u0000T\u0000a\u0000n\u0000g\u0000,\u0000 \u0000h\u0000t\u0000t\u0000p\u0000:\u0000\/\u0000\/\u0000l\u0000e\u0000x\u0000r\u0000u\u0000s\u0000.\u0000c\u0000o\u0000m\u0000\n\u0000\/\u0000\/\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000h\u0000t\u0000t\u0000p\u0000s\u0000:\u0000\/\u0000\/\u0000g\u0000i\u0000t\u0000h\u0000u\u0000b\u0000.\u0000c\u0000o\u0000m\u0000\/\u0000l\u0000e\u0000x\u0000r\u0000u\u0000s\u0000\/\u0000L\u0000T\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000B\u0000u\u0000t\u0000t\u0000o\u0000n\u0000s\u0000\n\u0000\/\u0000\/\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000P\u0000e\u0000r\u0000m\u0000i\u0000s\u0000s\u0000i\u0000o\u0000n\u0000 \u0000i\u0000s\u0000 \u0000h\u0000e\u0000r\u0000e\u0000b\u0000y\u0000 \u0000g\u0000r\u0000a\u0000n\u0000t\u0000e\u0000d\u0000,\u0000 \u0000f\u0000r\u0000e\u0000e\u0000 \u0000o\u0000f\u0000 \u0000c\u0000h\u0000a\u0000r\u0000g\u0000e\u0000,\u0000 \u0000t\u0000o\u0000 \u0000a\u0000n\u0000y\u0000 \u0000p\u0000e\u0000r\u0000s\u0000o\u0000n\u0000 \u0000o\u0000b\u0000t\u0000a\u0000i\u0000n\u0000i\u0000n\u0000g\u0000 \u0000a\u0000 \u0000c\u0000o\u0000p\u0000y\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000o\u0000f\u0000 \u0000t\u0000h\u0000i\u0000s\u0000 \u0000s\u0000o\u0000f\u0000t\u0000w\u0000a\u0000r\u0000e\u0000 \u0000a\u0000n\u0000d\u0000 \u0000a\u0000s\u0000s\u0000o\u0000c\u0000i\u0000a\u0000t\u0000e\u0000d\u0000 \u0000d\u0000o\u0000c\u0000u\u0000m\u0000e\u0000n\u0000t\u0000a\u0000t\u0000i\u0000o\u0000n\u0000 \u0000f\u0000i\u0000l\u0000e\u0000s\u0000 \u0000(\u0000t\u0000h\u0000e\u0000  \u001c\u0000S\u0000o\u0000f\u0000t\u0000w\u0000a\u0000r\u0000e \u001d\u0000)\u0000,\u0000 \u0000t\u0000o\u0000 \u0000d\u0000e\u0000a\u0000l\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000i\u0000n\u0000 \u0000t\u0000h\u0000e\u0000 \u0000S\u0000o\u0000f\u0000t\u0000w\u0000a\u0000r\u0000e\u0000 \u0000w\u0000i\u0000t\u0000h\u0000o\u0000u\u0000t\u0000 \u0000r\u0000e\u0000s\u0000t\u0000r\u0000i\u0000c\u0000t\u0000i\u0000o\u0000n\u0000,\u0000 \u0000i\u0000n\u0000c\u0000l\u0000u\u0000d\u0000i\u0000n\u0000g\u0000 \u0000w\u0000i\u0000t\u0000h\u0000o\u0000u\u0000t\u0000 \u0000l\u0000i\u0000m\u0000i\u0000t\u0000a\u0000t\u0000i\u0000o\u0000n\u0000 \u0000t\u0000h\u0000e\u0000 \u0000r\u0000i\u0000g\u0000h\u0000t\u0000s\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000t\u0000o\u0000 \u0000u\u0000s\u0000e\u0000,\u0000 \u0000c\u0000o\u0000p\u0000y\u0000,\u0000 \u0000m\u0000o\u0000d\u0000i\u0000f\u0000y\u0000,\u0000 \u0000m\u0000e\u0000r\u0000g\u0000e\u0000,\u0000 \u0000p\u0000u\u0000b\u0000l\u0000i\u0000s\u0000h\u0000,\u0000 \u0000d\u0000i\u0000s\u0000t\u0000r\u0000i\u0000b\u0000u\u0000t\u0000e\u0000,\u0000 \u0000s\u0000u\u0000b\u0000l\u0000i\u0000c\u0000e\u0000n\u0000s\u0000e\u0000,\u0000 \u0000a\u0000n\u0000d\u0000\/\u0000o\u0000r\u0000 \u0000s\u0000e\u0000l\u0000l\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000c\u0000o\u0000p\u0000i\u0000e\u0000s\u0000 \u0000o\u0000f\u0000 \u0000t\u0000h\u0000e\u0000 \u0000S\u0000o\u0000f\u0000t\u0000w\u0000a\u0000r\u0000e\u0000,\u0000 \u0000a\u0000n\u0000d\u0000 \u0000t\u0000o\u0000 \u0000p\u0000e\u0000r\u0000m\u0000i\u0000t\u0000 \u0000p\u0000e\u0000r\u0000s\u0000o\u0000n\u0000s\u0000 \u0000t\u0000o\u0000 \u0000w\u0000h\u0000o\u0000m\u0000 \u0000t\u0000h\u0000e\u0000 \u0000S\u0000o\u0000f\u0000t\u0000w\u0000a\u0000r\u0000e\u0000 \u0000i\u0000s\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000f\u0000u\u0000r\u0000n\u0000i\u0000s\u0000h\u0000e\u0000d\u0000 \u0000t\u0000o\u0000 \u0000d\u0000o\u0000 \u0000s\u0000o\u0000,\u0000 \u0000s\u0000u\u0000b\u0000j\u0000e\u0000c\u0000t\u0000 \u0000t\u0000o\u0000 \u0000t\u0000h\u0000e\u0000 \u0000f\u0000o\u0000l\u0000l\u0000o\u0000w\u0000i\u0000n\u0000g\u0000 \u0000c\u0000o\u0000n\u0000d\u0000i\u0000t\u0000i\u0000o\u0000n\u0000s\u0000:\u0000\n\u0000\/\u0000\/\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000T\u0000h\u0000e\u0000 \u0000a\u0000b\u0000o\u0000v\u0000e\u0000 \u0000c\u0000o\u0000p\u0000y\u0000r\u0000i\u0000g\u0000h\u0000t\u0000 \u0000n\u0000o\u0000t\u0000i\u0000c\u0000e\u0000 \u0000a\u0000n\u0000d\u0000 \u0000t\u0000h\u0000i\u0000s\u0000 \u0000p\u0000e\u0000r\u0000m\u0000i\u0000s\u0000s\u0000i\u0000o\u0000n\u0000 \u0000n\u0000o\u0000t\u0000i\u0000c\u0000e\u0000 \u0000s\u0000h\u0000a\u0000l\u0000l\u0000 \u0000b\u0000e\u0000 \u0000i\u0000n\u0000c\u0000l\u0000u\u0000d\u0000e\u0000d\u0000 \u0000i\u0000n\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000a\u0000l\u0000l\u0000 \u0000c\u0000o\u0000p\u0000i\u0000e\u0000s\u0000 \u0000o\u0000r\u0000 \u0000s\u0000u\u0000b\u0000s\u0000t\u0000a\u0000n\u0000t\u0000i\u0000a\u0000l\u0000 \u0000p\u0000o\u0000r\u0000t\u0000i\u0000o\u0000n\u0000s\u0000 \u0000o\u0000f\u0000 \u0000t\u0000h\u0000e\u0000 \u0000S\u0000o\u0000f\u0000t\u0000w\u0000a\u0000r\u0000e\u0000.\u0000\n\u0000\/\u0000\/\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000T\u0000H\u0000E\u0000 \u0000S\u0000O\u0000F\u0000T\u0000W\u0000A\u0000R\u0000E\u0000 \u0000I\u0000S\u0000 \u0000P\u0000R\u0000O\u0000V\u0000I\u0000D\u0000E\u0000D\u0000  \u001c\u0000A\u0000S\u0000 \u0000I\u0000S \u001d\u0000,\u0000 \u0000W\u0000I\u0000T\u0000H\u0000O\u0000U\u0000T\u0000 \u0000W\u0000A\u0000R\u0000R\u0000A\u0000N\u0000T\u0000Y\u0000 \u0000O\u0000F\u0000 \u0000A\u0000N\u0000Y\u0000 \u0000K\u0000I\u0000N\u0000D\u0000,\u0000 \u0000E\u0000X\u0000P\u0000R\u0000E\u0000S\u0000S\u0000 \u0000O\u0000R\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000I\u0000M\u0000P\u0000L\u0000I\u0000E\u0000D\u0000,\u0000 \u0000I\u0000N\u0000C\u0000L\u0000U\u0000D\u0000I\u0000N\u0000G\u0000 \u0000B\u0000U\u0000T\u0000 \u0000N\u0000O\u0000T\u0000 \u0000L\u0000I\u0000M\u0000I\u0000T\u0000E\u0000D\u0000 \u0000T\u0000O\u0000 \u0000T\u0000H\u0000E\u0000 \u0000W\u0000A\u0000R\u0000R\u0000A\u0000N\u0000T\u0000I\u0000E\u0000S\u0000 \u0000O\u0000F\u0000 \u0000M\u0000E\u0000R\u0000C\u0000H\u0000A\u0000N\u0000T\u0000A\u0000B\u0000I\u0000L\u0000I\u0000T\u0000Y\u0000,\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000F\u0000I\u0000T\u0000N\u0000E\u0000S\u0000S\u0000 \u0000F\u0000O\u0000R\u0000 \u0000A\u0000 \u0000P\u0000A\u0000R\u0000T\u0000I\u0000C\u0000U\u0000L\u0000A\u0000R\u0000 \u0000P\u0000U\u0000R\u0000P\u0000O\u0000S\u0000E\u0000 \u0000A\u0000N\u0000D\u0000 \u0000N\u0000O\u0000N\u0000I\u0000N\u0000F\u0000R\u0000I\u0000N\u0000G\u0000E\u0000M\u0000E\u0000N\u0000T\u0000.\u0000 \u0000I\u0000N\u0000 \u0000N\u0000O\u0000 \u0000E\u0000V\u0000E\u0000N\u0000T\u0000 \u0000S\u0000H\u0000A\u0000L\u0000L\u0000 \u0000T\u0000H\u0000E\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000A\u0000U\u0000T\u0000H\u0000O\u0000R\u0000S\u0000 \u0000O\u0000R\u0000 \u0000C\u0000O\u0000P\u0000Y\u0000R\u0000I\u0000G\u0000H\u0000T\u0000 \u0000H\u0000O\u0000L\u0000D\u0000E\u0000R\u0000S\u0000 \u0000B\u0000E\u0000 \u0000L\u0000I\u0000A\u0000B\u0000L\u0000E\u0000 \u0000F\u0000O\u0000R\u0000 \u0000A\u0000N\u0000Y\u0000 \u0000C\u0000L\u0000A\u0000I\u0000M\u0000,\u0000 \u0000D\u0000A\u0000M\u0000A\u0000G\u0000E\u0000S\u0000 \u0000O\u0000R\u0000 \u0000O\u0000T\u0000H\u0000E\u0000R\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000L\u0000I\u0000A\u0000B\u0000I\u0000L\u0000I\u0000T\u0000Y\u0000,\u0000 \u0000W\u0000H\u0000E\u0000T\u0000H\u0000E\u0000R\u0000 \u0000I\u0000N\u0000 \u0000A\u0000N\u0000 \u0000A\u0000C\u0000T\u0000I\u0000O\u0000N\u0000 \u0000O\u0000F\u0000 \u0000C\u0000O\u0000N\u0000T\u0000R\u0000A\u0000C\u0000T\u0000,\u0000 \u0000T\u0000O\u0000R\u0000T\u0000 \u0000O\u0000R\u0000 \u0000O\u0000T\u0000H\u0000E\u0000R\u0000W\u0000I\u0000S\u0000E\u0000,\u0000 \u0000A\u0000R\u0000I\u0000S\u0000I\u0000N\u0000G\u0000 \u0000F\u0000R\u0000O\u0000M\u0000,\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000O\u0000U\u0000T\u0000 \u0000O\u0000F\u0000 \u0000O\u0000R\u0000 \u0000I\u0000N\u0000 \u0000C\u0000O\u0000N\u0000N\u0000E\u0000C\u0000T\u0000I\u0000O\u0000N\u0000 \u0000W\u0000I\u0000T\u0000H\u0000 \u0000T\u0000H\u0000E\u0000 \u0000S\u0000O\u0000F\u0000T\u0000W\u0000A\u0000R\u0000E\u0000 \u0000O\u0000R\u0000 \u0000T\u0000H\u0000E\u0000 \u0000U\u0000S\u0000E\u0000 \u0000O\u0000R\u0000 \u0000O\u0000T\u0000H\u0000E\u0000R\u0000 \u0000D\u0000E\u0000A\u0000L\u0000I\u0000N\u0000G\u0000S\u0000 \u0000I\u0000N\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000T\u0000H\u0000E\u0000 \u0000S\u0000O\u0000F\u0000T\u0000W\u0000A\u0000R\u0000E\u0000.\u0000\n\u0000\n\u0000v\u0000a\u0000r\u0000 \u0000a\u0000p\u0000p\u0000 \u0000=\u0000 \u0000A\u0000p\u0000p\u0000l\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000.\u0000c\u0000u\u0000r\u0000r\u0000e\u0000n\u0000t\u0000A\u0000p\u0000p\u0000l\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000(\u0000)\u0000\n\u0000a\u0000p\u0000p\u0000.\u0000i\u0000n\u0000c\u0000l\u0000u\u0000d\u0000e\u0000S\u0000t\u0000a\u0000n\u0000d\u0000a\u0000r\u0000d\u0000A\u0000d\u0000d\u0000i\u0000t\u0000i\u0000o\u0000n\u0000s\u0000 \u0000=\u0000 \u0000t\u0000r\u0000u\u0000e\u0000\n\u0000\n\u0000O\u0000b\u0000j\u0000C\u0000.\u0000i\u0000m\u0000p\u0000o\u0000r\u0000t\u0000(\u0000\"\u0000F\u0000o\u0000u\u0000n\u0000d\u0000a\u0000t\u0000i\u0000o\u0000n\u0000\"\u0000)\u0000\n\u0000\n\u0000f\u0000u\u0000n\u0000c\u0000t\u0000i\u0000o\u0000n\u0000 \u0000u\u0000r\u0000l\u0000P\u0000a\u0000t\u0000h\u0000T\u0000o\u0000P\u0000o\u0000s\u0000i\u0000x\u0000P\u0000a\u0000t\u0000h\u0000(\u0000p\u0000a\u0000t\u0000h\u0000)\u0000 \u0000{\u0000\n\u0000\t\u0000r\u0000e\u0000t\u0000u\u0000r\u0000n\u0000 \u0000u\u0000n\u0000e\u0000s\u0000c\u0000a\u0000p\u0000e\u0000(\u0000p\u0000a\u0000t\u0000h\u0000)\u0000\n\u0000\t\u0000 \u0000 \u0000 \u0000 \u0000.\u0000r\u0000e\u0000p\u0000l\u0000a\u0000c\u0000e\u0000(\u0000\/\u0000^\u0000\\\u0000\/\u0000?\u0000f\u0000i\u0000l\u0000e\u0000[\u0000:\u0000]\u0000\\\u0000\/\u0000+\u0000\/\u0000i\u0000,\u0000 \u0000'\u0000\/\u0000'\u0000)\u0000\n\u0000\t\u0000\t\u0000.\u0000r\u0000e\u0000p\u0000l\u0000a\u0000c\u0000e\u0000(\u0000\/\u0000(\u0000\"\u0000)\u0000\/\u0000g\u0000,\u0000 \u0000'\u0000\\\u0000\\\u0000$\u00001\u0000'\u0000)\u0000\n\u0000}\u0000\n\u0000\n\u0000f\u0000u\u0000n\u0000c\u0000t\u0000i\u0000o\u0000n\u0000 \u0000g\u0000e\u0000t\u0000C\u0000u\u0000r\u0000r\u0000e\u0000n\u0000t\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000P\u0000a\u0000t\u0000h\u0000(\u0000)\u0000 \u0000{\u0000\n\u0000\t\u0000v\u0000a\u0000r\u0000 \u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000 \u0000=\u0000 \u0000A\u0000p\u0000p\u0000l\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000(\u0000'\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000'\u0000)\u0000\n\u0000\t\u0000v\u0000a\u0000r\u0000 \u0000i\u0000t\u0000e\u0000m\u0000 \u0000=\u0000 \u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000.\u0000s\u0000e\u0000l\u0000e\u0000c\u0000t\u0000i\u0000o\u0000n\u0000(\u0000)\u0000[\u00000\u0000]\u0000\n\u0000\t\u0000i\u0000f\u0000 \u0000(\u0000!\u0000i\u0000t\u0000e\u0000m\u0000)\u0000 \u0000{\u0000\n\u0000\t\u0000\t\u0000t\u0000r\u0000y\u0000 \u0000{\u0000\n\u0000\t\u0000\t\u0000\t\u0000r\u0000e\u0000t\u0000u\u0000r\u0000n\u0000 \u0000u\u0000r\u0000l\u0000P\u0000a\u0000t\u0000h\u0000T\u0000o\u0000P\u0000o\u0000s\u0000i\u0000x\u0000P\u0000a\u0000t\u0000h\u0000(\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000.\u0000w\u0000i\u0000n\u0000d\u0000o\u0000w\u0000s\u0000[\u00000\u0000]\u0000.\u0000t\u0000a\u0000r\u0000g\u0000e\u0000t\u0000(\u0000)\u0000.\u0000u\u0000r\u0000l\u0000(\u0000)\u0000)\u0000\n\u0000\t\u0000\t\u0000}\u0000 \u0000c\u0000a\u0000t\u0000c\u0000h\u0000 \u0000(\u0000e\u0000)\u0000 \u0000{\u0000\n\u0000\t\u0000\t\u0000\t\u0000r\u0000e\u0000t\u0000u\u0000r\u0000n\u0000 \u0000u\u0000r\u0000l\u0000P\u0000a\u0000t\u0000h\u0000T\u0000o\u0000P\u0000o\u0000s\u0000i\u0000x\u0000P\u0000a\u0000t\u0000h\u0000(\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000.\u0000d\u0000e\u0000s\u0000k\u0000t\u0000o\u0000p\u0000(\u0000)\u0000.\u0000u\u0000r\u0000l\u0000(\u0000)\u0000)\u0000\n\u0000\t\u0000\t\u0000}\u0000\n\u0000\t\u0000}\u0000\n\u0000\t\u0000r\u0000e\u0000t\u0000u\u0000r\u0000n\u0000 \u0000u\u0000r\u0000l\u0000P\u0000a\u0000t\u0000h\u0000T\u0000o\u0000P\u0000o\u0000s\u0000i\u0000x\u0000P\u0000a\u0000t\u0000h\u0000(\u0000i\u0000t\u0000e\u0000m\u0000.\u0000u\u0000r\u0000l\u0000(\u0000)\u0000)\u0000\n\u0000}\u0000\n\u0000\n\u0000\n\u0000v\u0000a\u0000r\u0000 \u0000c\u0000u\u0000r\u0000r\u0000e\u0000n\u0000t\u0000F\u0000o\u0000l\u0000d\u0000e\u0000r\u0000P\u0000a\u0000t\u0000h\u0000 \u0000=\u0000 \u0000g\u0000e\u0000t\u0000C\u0000u\u0000r\u0000r\u0000e\u0000n\u0000t\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000P\u0000a\u0000t\u0000h\u0000(\u0000)\u0000\n\u0000a\u0000p\u0000p\u0000.\u0000s\u0000e\u0000t\u0000T\u0000h\u0000e\u0000C\u0000l\u0000i\u0000p\u0000b\u0000o\u0000a\u0000r\u0000d\u0000T\u0000o\u0000(\u0000c\u0000u\u0000r\u0000r\u0000e\u0000n\u0000t\u0000F\u0000o\u0000l\u0000d\u0000e\u0000r\u0000P\u0000a\u0000t\u0000h\u0000)\u0000\b\u0000\u000b\u0000\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000e~jscr\u0000\u0001\u0000\f\u07ad","new_contents":"JsOsaDAS1.001.00bplist00\u0001\u0002Vscripto\u0011\u0007O\u0000\/\u0000\/\u0000 \u0000 \u0000T\u0000h\u0000e\u0000 \u0000M\u0000I\u0000T\u0000 \u0000L\u0000i\u0000c\u0000e\u0000n\u0000s\u0000e\u0000 \u0000(\u0000M\u0000I\u0000T\u0000)\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000C\u0000o\u0000p\u0000y\u0000r\u0000i\u0000g\u0000h\u0000t\u0000 \u0000\u0000 \u00002\u00000\u00001\u00007\u0000 \u0000L\u0000e\u0000x\u0000 \u0000T\u0000a\u0000n\u0000g\u0000,\u0000 \u0000h\u0000t\u0000t\u0000p\u0000:\u0000\/\u0000\/\u0000l\u0000e\u0000x\u0000r\u0000u\u0000s\u0000.\u0000c\u0000o\u0000m\u0000\n\u0000\/\u0000\/\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000h\u0000t\u0000t\u0000p\u0000s\u0000:\u0000\/\u0000\/\u0000g\u0000i\u0000t\u0000h\u0000u\u0000b\u0000.\u0000c\u0000o\u0000m\u0000\/\u0000l\u0000e\u0000x\u0000r\u0000u\u0000s\u0000\/\u0000L\u0000T\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000B\u0000u\u0000t\u0000t\u0000o\u0000n\u0000s\u0000\n\u0000\/\u0000\/\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000P\u0000e\u0000r\u0000m\u0000i\u0000s\u0000s\u0000i\u0000o\u0000n\u0000 \u0000i\u0000s\u0000 \u0000h\u0000e\u0000r\u0000e\u0000b\u0000y\u0000 \u0000g\u0000r\u0000a\u0000n\u0000t\u0000e\u0000d\u0000,\u0000 \u0000f\u0000r\u0000e\u0000e\u0000 \u0000o\u0000f\u0000 \u0000c\u0000h\u0000a\u0000r\u0000g\u0000e\u0000,\u0000 \u0000t\u0000o\u0000 \u0000a\u0000n\u0000y\u0000 \u0000p\u0000e\u0000r\u0000s\u0000o\u0000n\u0000 \u0000o\u0000b\u0000t\u0000a\u0000i\u0000n\u0000i\u0000n\u0000g\u0000 \u0000a\u0000 \u0000c\u0000o\u0000p\u0000y\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000o\u0000f\u0000 \u0000t\u0000h\u0000i\u0000s\u0000 \u0000s\u0000o\u0000f\u0000t\u0000w\u0000a\u0000r\u0000e\u0000 \u0000a\u0000n\u0000d\u0000 \u0000a\u0000s\u0000s\u0000o\u0000c\u0000i\u0000a\u0000t\u0000e\u0000d\u0000 \u0000d\u0000o\u0000c\u0000u\u0000m\u0000e\u0000n\u0000t\u0000a\u0000t\u0000i\u0000o\u0000n\u0000 \u0000f\u0000i\u0000l\u0000e\u0000s\u0000 \u0000(\u0000t\u0000h\u0000e\u0000  \u001c\u0000S\u0000o\u0000f\u0000t\u0000w\u0000a\u0000r\u0000e \u001d\u0000)\u0000,\u0000 \u0000t\u0000o\u0000 \u0000d\u0000e\u0000a\u0000l\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000i\u0000n\u0000 \u0000t\u0000h\u0000e\u0000 \u0000S\u0000o\u0000f\u0000t\u0000w\u0000a\u0000r\u0000e\u0000 \u0000w\u0000i\u0000t\u0000h\u0000o\u0000u\u0000t\u0000 \u0000r\u0000e\u0000s\u0000t\u0000r\u0000i\u0000c\u0000t\u0000i\u0000o\u0000n\u0000,\u0000 \u0000i\u0000n\u0000c\u0000l\u0000u\u0000d\u0000i\u0000n\u0000g\u0000 \u0000w\u0000i\u0000t\u0000h\u0000o\u0000u\u0000t\u0000 \u0000l\u0000i\u0000m\u0000i\u0000t\u0000a\u0000t\u0000i\u0000o\u0000n\u0000 \u0000t\u0000h\u0000e\u0000 \u0000r\u0000i\u0000g\u0000h\u0000t\u0000s\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000t\u0000o\u0000 \u0000u\u0000s\u0000e\u0000,\u0000 \u0000c\u0000o\u0000p\u0000y\u0000,\u0000 \u0000m\u0000o\u0000d\u0000i\u0000f\u0000y\u0000,\u0000 \u0000m\u0000e\u0000r\u0000g\u0000e\u0000,\u0000 \u0000p\u0000u\u0000b\u0000l\u0000i\u0000s\u0000h\u0000,\u0000 \u0000d\u0000i\u0000s\u0000t\u0000r\u0000i\u0000b\u0000u\u0000t\u0000e\u0000,\u0000 \u0000s\u0000u\u0000b\u0000l\u0000i\u0000c\u0000e\u0000n\u0000s\u0000e\u0000,\u0000 \u0000a\u0000n\u0000d\u0000\/\u0000o\u0000r\u0000 \u0000s\u0000e\u0000l\u0000l\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000c\u0000o\u0000p\u0000i\u0000e\u0000s\u0000 \u0000o\u0000f\u0000 \u0000t\u0000h\u0000e\u0000 \u0000S\u0000o\u0000f\u0000t\u0000w\u0000a\u0000r\u0000e\u0000,\u0000 \u0000a\u0000n\u0000d\u0000 \u0000t\u0000o\u0000 \u0000p\u0000e\u0000r\u0000m\u0000i\u0000t\u0000 \u0000p\u0000e\u0000r\u0000s\u0000o\u0000n\u0000s\u0000 \u0000t\u0000o\u0000 \u0000w\u0000h\u0000o\u0000m\u0000 \u0000t\u0000h\u0000e\u0000 \u0000S\u0000o\u0000f\u0000t\u0000w\u0000a\u0000r\u0000e\u0000 \u0000i\u0000s\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000f\u0000u\u0000r\u0000n\u0000i\u0000s\u0000h\u0000e\u0000d\u0000 \u0000t\u0000o\u0000 \u0000d\u0000o\u0000 \u0000s\u0000o\u0000,\u0000 \u0000s\u0000u\u0000b\u0000j\u0000e\u0000c\u0000t\u0000 \u0000t\u0000o\u0000 \u0000t\u0000h\u0000e\u0000 \u0000f\u0000o\u0000l\u0000l\u0000o\u0000w\u0000i\u0000n\u0000g\u0000 \u0000c\u0000o\u0000n\u0000d\u0000i\u0000t\u0000i\u0000o\u0000n\u0000s\u0000:\u0000\n\u0000\/\u0000\/\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000T\u0000h\u0000e\u0000 \u0000a\u0000b\u0000o\u0000v\u0000e\u0000 \u0000c\u0000o\u0000p\u0000y\u0000r\u0000i\u0000g\u0000h\u0000t\u0000 \u0000n\u0000o\u0000t\u0000i\u0000c\u0000e\u0000 \u0000a\u0000n\u0000d\u0000 \u0000t\u0000h\u0000i\u0000s\u0000 \u0000p\u0000e\u0000r\u0000m\u0000i\u0000s\u0000s\u0000i\u0000o\u0000n\u0000 \u0000n\u0000o\u0000t\u0000i\u0000c\u0000e\u0000 \u0000s\u0000h\u0000a\u0000l\u0000l\u0000 \u0000b\u0000e\u0000 \u0000i\u0000n\u0000c\u0000l\u0000u\u0000d\u0000e\u0000d\u0000 \u0000i\u0000n\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000a\u0000l\u0000l\u0000 \u0000c\u0000o\u0000p\u0000i\u0000e\u0000s\u0000 \u0000o\u0000r\u0000 \u0000s\u0000u\u0000b\u0000s\u0000t\u0000a\u0000n\u0000t\u0000i\u0000a\u0000l\u0000 \u0000p\u0000o\u0000r\u0000t\u0000i\u0000o\u0000n\u0000s\u0000 \u0000o\u0000f\u0000 \u0000t\u0000h\u0000e\u0000 \u0000S\u0000o\u0000f\u0000t\u0000w\u0000a\u0000r\u0000e\u0000.\u0000\n\u0000\/\u0000\/\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000T\u0000H\u0000E\u0000 \u0000S\u0000O\u0000F\u0000T\u0000W\u0000A\u0000R\u0000E\u0000 \u0000I\u0000S\u0000 \u0000P\u0000R\u0000O\u0000V\u0000I\u0000D\u0000E\u0000D\u0000  \u001c\u0000A\u0000S\u0000 \u0000I\u0000S \u001d\u0000,\u0000 \u0000W\u0000I\u0000T\u0000H\u0000O\u0000U\u0000T\u0000 \u0000W\u0000A\u0000R\u0000R\u0000A\u0000N\u0000T\u0000Y\u0000 \u0000O\u0000F\u0000 \u0000A\u0000N\u0000Y\u0000 \u0000K\u0000I\u0000N\u0000D\u0000,\u0000 \u0000E\u0000X\u0000P\u0000R\u0000E\u0000S\u0000S\u0000 \u0000O\u0000R\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000I\u0000M\u0000P\u0000L\u0000I\u0000E\u0000D\u0000,\u0000 \u0000I\u0000N\u0000C\u0000L\u0000U\u0000D\u0000I\u0000N\u0000G\u0000 \u0000B\u0000U\u0000T\u0000 \u0000N\u0000O\u0000T\u0000 \u0000L\u0000I\u0000M\u0000I\u0000T\u0000E\u0000D\u0000 \u0000T\u0000O\u0000 \u0000T\u0000H\u0000E\u0000 \u0000W\u0000A\u0000R\u0000R\u0000A\u0000N\u0000T\u0000I\u0000E\u0000S\u0000 \u0000O\u0000F\u0000 \u0000M\u0000E\u0000R\u0000C\u0000H\u0000A\u0000N\u0000T\u0000A\u0000B\u0000I\u0000L\u0000I\u0000T\u0000Y\u0000,\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000F\u0000I\u0000T\u0000N\u0000E\u0000S\u0000S\u0000 \u0000F\u0000O\u0000R\u0000 \u0000A\u0000 \u0000P\u0000A\u0000R\u0000T\u0000I\u0000C\u0000U\u0000L\u0000A\u0000R\u0000 \u0000P\u0000U\u0000R\u0000P\u0000O\u0000S\u0000E\u0000 \u0000A\u0000N\u0000D\u0000 \u0000N\u0000O\u0000N\u0000I\u0000N\u0000F\u0000R\u0000I\u0000N\u0000G\u0000E\u0000M\u0000E\u0000N\u0000T\u0000.\u0000 \u0000I\u0000N\u0000 \u0000N\u0000O\u0000 \u0000E\u0000V\u0000E\u0000N\u0000T\u0000 \u0000S\u0000H\u0000A\u0000L\u0000L\u0000 \u0000T\u0000H\u0000E\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000A\u0000U\u0000T\u0000H\u0000O\u0000R\u0000S\u0000 \u0000O\u0000R\u0000 \u0000C\u0000O\u0000P\u0000Y\u0000R\u0000I\u0000G\u0000H\u0000T\u0000 \u0000H\u0000O\u0000L\u0000D\u0000E\u0000R\u0000S\u0000 \u0000B\u0000E\u0000 \u0000L\u0000I\u0000A\u0000B\u0000L\u0000E\u0000 \u0000F\u0000O\u0000R\u0000 \u0000A\u0000N\u0000Y\u0000 \u0000C\u0000L\u0000A\u0000I\u0000M\u0000,\u0000 \u0000D\u0000A\u0000M\u0000A\u0000G\u0000E\u0000S\u0000 \u0000O\u0000R\u0000 \u0000O\u0000T\u0000H\u0000E\u0000R\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000L\u0000I\u0000A\u0000B\u0000I\u0000L\u0000I\u0000T\u0000Y\u0000,\u0000 \u0000W\u0000H\u0000E\u0000T\u0000H\u0000E\u0000R\u0000 \u0000I\u0000N\u0000 \u0000A\u0000N\u0000 \u0000A\u0000C\u0000T\u0000I\u0000O\u0000N\u0000 \u0000O\u0000F\u0000 \u0000C\u0000O\u0000N\u0000T\u0000R\u0000A\u0000C\u0000T\u0000,\u0000 \u0000T\u0000O\u0000R\u0000T\u0000 \u0000O\u0000R\u0000 \u0000O\u0000T\u0000H\u0000E\u0000R\u0000W\u0000I\u0000S\u0000E\u0000,\u0000 \u0000A\u0000R\u0000I\u0000S\u0000I\u0000N\u0000G\u0000 \u0000F\u0000R\u0000O\u0000M\u0000,\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000O\u0000U\u0000T\u0000 \u0000O\u0000F\u0000 \u0000O\u0000R\u0000 \u0000I\u0000N\u0000 \u0000C\u0000O\u0000N\u0000N\u0000E\u0000C\u0000T\u0000I\u0000O\u0000N\u0000 \u0000W\u0000I\u0000T\u0000H\u0000 \u0000T\u0000H\u0000E\u0000 \u0000S\u0000O\u0000F\u0000T\u0000W\u0000A\u0000R\u0000E\u0000 \u0000O\u0000R\u0000 \u0000T\u0000H\u0000E\u0000 \u0000U\u0000S\u0000E\u0000 \u0000O\u0000R\u0000 \u0000O\u0000T\u0000H\u0000E\u0000R\u0000 \u0000D\u0000E\u0000A\u0000L\u0000I\u0000N\u0000G\u0000S\u0000 \u0000I\u0000N\u0000\n\u0000\/\u0000\/\u0000 \u0000 \u0000T\u0000H\u0000E\u0000 \u0000S\u0000O\u0000F\u0000T\u0000W\u0000A\u0000R\u0000E\u0000.\u0000\n\u0000\n\u0000v\u0000a\u0000r\u0000 \u0000a\u0000p\u0000p\u0000 \u0000=\u0000 \u0000A\u0000p\u0000p\u0000l\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000.\u0000c\u0000u\u0000r\u0000r\u0000e\u0000n\u0000t\u0000A\u0000p\u0000p\u0000l\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000(\u0000)\u0000\n\u0000a\u0000p\u0000p\u0000.\u0000i\u0000n\u0000c\u0000l\u0000u\u0000d\u0000e\u0000S\u0000t\u0000a\u0000n\u0000d\u0000a\u0000r\u0000d\u0000A\u0000d\u0000d\u0000i\u0000t\u0000i\u0000o\u0000n\u0000s\u0000 \u0000=\u0000 \u0000t\u0000r\u0000u\u0000e\u0000\n\u0000\n\u0000O\u0000b\u0000j\u0000C\u0000.\u0000i\u0000m\u0000p\u0000o\u0000r\u0000t\u0000(\u0000\"\u0000F\u0000o\u0000u\u0000n\u0000d\u0000a\u0000t\u0000i\u0000o\u0000n\u0000\"\u0000)\u0000\n\u0000\n\u0000f\u0000u\u0000n\u0000c\u0000t\u0000i\u0000o\u0000n\u0000 \u0000u\u0000r\u0000l\u0000P\u0000a\u0000t\u0000h\u0000T\u0000o\u0000P\u0000o\u0000s\u0000i\u0000x\u0000P\u0000a\u0000t\u0000h\u0000(\u0000p\u0000a\u0000t\u0000h\u0000)\u0000 \u0000{\u0000\n\u0000\t\u0000r\u0000e\u0000t\u0000u\u0000r\u0000n\u0000 \u0000u\u0000n\u0000e\u0000s\u0000c\u0000a\u0000p\u0000e\u0000(\u0000p\u0000a\u0000t\u0000h\u0000)\u0000\n\u0000\t\u0000 \u0000 \u0000 \u0000 \u0000.\u0000r\u0000e\u0000p\u0000l\u0000a\u0000c\u0000e\u0000(\u0000\/\u0000^\u0000\\\u0000\/\u0000?\u0000f\u0000i\u0000l\u0000e\u0000[\u0000:\u0000]\u0000\\\u0000\/\u0000+\u0000\/\u0000i\u0000,\u0000 \u0000'\u0000\/\u0000'\u0000)\u0000\n\u0000\t\u0000\t\u0000.\u0000r\u0000e\u0000p\u0000l\u0000a\u0000c\u0000e\u0000(\u0000\/\u0000(\u0000\"\u0000)\u0000\/\u0000g\u0000,\u0000 \u0000'\u0000\\\u0000\\\u0000$\u00001\u0000'\u0000)\u0000\n\u0000}\u0000\n\u0000\n\u0000f\u0000u\u0000n\u0000c\u0000t\u0000i\u0000o\u0000n\u0000 \u0000g\u0000e\u0000t\u0000C\u0000u\u0000r\u0000r\u0000e\u0000n\u0000t\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000P\u0000a\u0000t\u0000h\u0000(\u0000)\u0000 \u0000{\u0000\n\u0000\t\u0000v\u0000a\u0000r\u0000 \u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000 \u0000=\u0000 \u0000A\u0000p\u0000p\u0000l\u0000i\u0000c\u0000a\u0000t\u0000i\u0000o\u0000n\u0000(\u0000'\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000'\u0000)\u0000\n\u0000\t\u0000v\u0000a\u0000r\u0000 \u0000i\u0000t\u0000e\u0000m\u0000 \u0000=\u0000 \u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000.\u0000s\u0000e\u0000l\u0000e\u0000c\u0000t\u0000i\u0000o\u0000n\u0000(\u0000)\u0000[\u00000\u0000]\u0000\n\u0000\t\u0000i\u0000f\u0000 \u0000(\u0000!\u0000i\u0000t\u0000e\u0000m\u0000)\u0000 \u0000{\u0000\n\u0000\t\u0000\t\u0000t\u0000r\u0000y\u0000 \u0000{\u0000\n\u0000\t\u0000\t\u0000\t\u0000r\u0000e\u0000t\u0000u\u0000r\u0000n\u0000 \u0000u\u0000r\u0000l\u0000P\u0000a\u0000t\u0000h\u0000T\u0000o\u0000P\u0000o\u0000s\u0000i\u0000x\u0000P\u0000a\u0000t\u0000h\u0000(\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000.\u0000w\u0000i\u0000n\u0000d\u0000o\u0000w\u0000s\u0000[\u00000\u0000]\u0000.\u0000t\u0000a\u0000r\u0000g\u0000e\u0000t\u0000(\u0000)\u0000.\u0000u\u0000r\u0000l\u0000(\u0000)\u0000)\u0000\n\u0000\t\u0000\t\u0000}\u0000 \u0000c\u0000a\u0000t\u0000c\u0000h\u0000 \u0000(\u0000e\u0000)\u0000 \u0000{\u0000\n\u0000\t\u0000\t\u0000\t\u0000r\u0000e\u0000t\u0000u\u0000r\u0000n\u0000 \u0000u\u0000r\u0000l\u0000P\u0000a\u0000t\u0000h\u0000T\u0000o\u0000P\u0000o\u0000s\u0000i\u0000x\u0000P\u0000a\u0000t\u0000h\u0000(\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000.\u0000d\u0000e\u0000s\u0000k\u0000t\u0000o\u0000p\u0000(\u0000)\u0000.\u0000u\u0000r\u0000l\u0000(\u0000)\u0000)\u0000\n\u0000\t\u0000\t\u0000}\u0000\n\u0000\t\u0000}\u0000\n\u0000\t\u0000r\u0000e\u0000t\u0000u\u0000r\u0000n\u0000 \u0000u\u0000r\u0000l\u0000P\u0000a\u0000t\u0000h\u0000T\u0000o\u0000P\u0000o\u0000s\u0000i\u0000x\u0000P\u0000a\u0000t\u0000h\u0000(\u0000i\u0000t\u0000e\u0000m\u0000.\u0000u\u0000r\u0000l\u0000(\u0000)\u0000)\u0000\n\u0000}\u0000\n\u0000\n\u0000\n\u0000v\u0000a\u0000r\u0000 \u0000c\u0000u\u0000r\u0000r\u0000e\u0000n\u0000t\u0000F\u0000o\u0000l\u0000d\u0000e\u0000r\u0000P\u0000a\u0000t\u0000h\u0000 \u0000=\u0000d\u0000e\u0000c\u0000o\u0000d\u0000e\u0000U\u0000R\u0000I\u0000C\u0000o\u0000m\u0000p\u0000o\u0000n\u0000e\u0000n\u0000t\u0000(\u0000e\u0000s\u0000c\u0000a\u0000p\u0000e\u0000(\u0000g\u0000e\u0000t\u0000C\u0000u\u0000r\u0000r\u0000e\u0000n\u0000t\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000P\u0000a\u0000t\u0000h\u0000(\u0000)\u0000)\u0000)\u0000\r\u0000a\u0000p\u0000p\u0000.\u0000s\u0000e\u0000t\u0000T\u0000h\u0000e\u0000C\u0000l\u0000i\u0000p\u0000b\u0000o\u0000a\u0000r\u0000d\u0000T\u0000o\u0000(\u0000c\u0000u\u0000r\u0000r\u0000e\u0000n\u0000t\u0000F\u0000o\u0000l\u0000d\u0000e\u0000r\u0000P\u0000a\u0000t\u0000h\u0000)\u0000\b\u0000\u000b\u0000\u0012\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0001\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000ejscr\u0000\u0001\u0000\f\u07ad","subject":"support file name utf8 encoded","message":"support file name utf8 encoded\n","lang":"AppleScript","license":"mit","repos":"lexrus\/LTFinderButtons"}
{"commit":"852e7598d93a6ddc7702fcb30b71af7728869ed9","old_file":"resources\/config.applescript","new_file":"resources\/config.applescript","old_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\nproperty homeFolder : (path to home folder as text)\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\nproperty artworkDocsFolder : ((get path to library folder from user domain as text) & \"Containers:com.apple.AMPArtworkAgent:Data:Documents\")\nproperty artworkImageFolder : (artworkDocsFolder & \":artwork:\")\nproperty songArtworkNameSep : \" | \"\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and convert from hexadecimal to decimal (base-10)\n\t\t\tset hexSongId to persistent ID of theSong\n\t\t\tset decSongId to (do shell script \"echo $((16#\" & hexSongId & \"))\")\n\n\t\t\t-- retrieve filename of cached artwork\n\t\t\tset artworkName to (do shell script (\"\/usr\/bin\/sqlite3 \" & (POSIX path of artworkDocsFolder) & \"\/artworkd.sqlite '\" & \u00ac\n\t\t\t\"select ZHASHSTRING, ZKIND from ZIMAGEINFO where Z_PK = (\" & \u00ac\n\t\t\t\"(select ZIMAGEINFO from ZSOURCEINFO where Z_PK = (\" & \u00ac\n\t\t\t\"select ZSOURCEINFO from ZDATABASEITEMINFO where ZPERSISTENTID = \" & \u00ac\n\t\t\tdecSongId & \")))' | \" & \u00ac\n\t\t\t\"awk '{split($0,a,\\\"|\\\"); print a[1] \\\"_sk_\\\" a[2] \\\"_cid_1.jpeg\\\"}'\"))\n\n\t\t\tset artworkPath to (artworkImageFolder & artworkName)\n\n\t\tend tell\n\n\t\treturn artworkPath\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getNativeCachedArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"Music\"\n\n\t\tset genreSongs to every track of playlist 2 whose genre is genreName\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in genreSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset genreSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset genreSongs to genreSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn genreSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in artistSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset artistSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName)\n\t\t\tset artistSongs to artistSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","new_contents":"-- core configuration --\n\n-- configurable options --\n\n-- limit number of songs to improve efficiency\nproperty resultLimit : 15\n-- whether or not to retrieve\/display album artwork for each result\nproperty albumArtEnabled : true\n\n-- workflow parameters --\n\n-- workflow folders\nproperty libraryFolder : (path to library folder from user domain as text)\nproperty cacheFolder : (libraryFolder & \"Caches:\")\nproperty alfredWorkflowDataFolder : (cacheFolder & \"com.runningwithcrayons.Alfred:Workflow Data:\")\nproperty bundleId : \"com.calebevans.playsong\"\nproperty workflowCacheFolder : (alfredWorkflowDataFolder & bundleId & \":\") as text\n\n-- album artwork folders\nproperty artworkDocsFolder : ((get path to library folder from user domain as text) & \"Containers:com.apple.AMPArtworkAgent:Data:Documents\")\nproperty artworkImageFolder : (artworkDocsFolder & \":artwork:\")\n\n-- the default icon used for search results without album artwork\nproperty defaultIconName : \"resources\/icon-noartwork.png\"\n-- the name of the playlist used by the workflow for playing songs\nproperty workflowPlaylistName : \"Alfred Play Song\"\n-- list of Alfred results\nproperty resultList : {}\n\n-- replaces substring in string with another substring\non replace(replaceThis, replaceWith, theString)\n\n\tset oldDelims to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to replaceThis\n\tset strItems to text items of theString\n\tset AppleScript's text item delimiters to replaceWith\n\tset newString to strItems as text\n\tset AppleScript's text item delimiters to oldDelims\n\treturn newString\n\nend replace\n\n-- retrieve the plural\/singular form of a quantity based on the given number\non quantifyNumber(theNumber, quantityName, pluralQuantityName)\n\n\tif theNumber is 1 then\n\n\t\tset theString to (theNumber as text) & space & quantityName\n\n\telse\n\n\t\tset theString to (theNumber as text) & space & pluralQuantityName\n\n\tend if\n\n\treturn theString\n\nend quantifyNumber\n\n-- encodes JSON reserved characters in the given string\non encodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\", \"\\\\\\\\\", theString)\n\tset theString to replace(\"\\\"\", \"\\\\\\\"\", theString)\n\treturn theString\n\nend encodeFeedbackChars\n\n-- decodes JSON reserved characters in the given string\non decodeFeedbackChars(theString)\n\n\tset theString to replace(\"\\\\\\\\\", \"\\\\\", theString)\n\tset theString to replace(\"\\\\\\\"\", \"\\\"\", theString)\n\treturn theString\n\nend decodeFeedbackChars\n\n-- adds Alfred result to result list\non addResult(theResult)\n\n\tcopy theResult to the end of resultList\n\nend addResult\n\n-- adds item for \"No Results\" message\non addNoResultsItem(query, queryType)\n\n\taddResult({uid:\"no-results\", valid:\"no\", title:\"No Results Found\", subtitle:(\"No \" & queryType & \"s matching '\" & query & \"'\"), icon:defaultIconName})\n\nend addNoResultsItem\n\non resultListIsFull()\n\n\treturn (length of resultList is resultLimit)\n\nend resultListIsFull\n\non resultListIsEmpty()\n\n\treturn (length of resultList is 0)\n\nend resultListIsFull\n\n-- builds Alfred result item as JSON\non getResultFeedback(theResult)\n\n\t-- encode reserved JSON characters\n\tset resultUid to encodeFeedbackChars(uid of theResult)\n\tset resultValid to (valid of theResult) as text\n\tset resultTitle to encodeFeedbackChars(title of theResult)\n\tset resultSubtitle to encodeFeedbackChars(subtitle of theResult)\n\n\tif (icon of theResult) contains \":\" then\n\n\t\tset resultIcon to encodeFeedbackChars(POSIX path of icon of theResult)\n\n\telse\n\n\t\tset resultIcon to icon of theResult\n\n\tend if\n\n\tset json to \"{\"\n\tset json to json & \"\\\"uid\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"arg\\\":\\\"\" & resultUid & \"\\\",\"\n\tset json to json & \"\\\"valid\\\":\\\"\" & resultValid & \"\\\",\"\n\tset json to json & \"\\\"title\\\":\\\"\" & resultTitle & \"\\\",\"\n\tset json to json & \"\\\"subtitle\\\":\\\"\" & resultSubtitle & \"\\\",\"\n\tset json to json & \"\\\"icon\\\":{\\\"path\\\":\\\"\" & resultIcon & \"\\\"}\"\n\tset json to json & \"}\"\n\treturn json\n\nend getResultFeedback\n\n-- retrieves JSON document for Alfred results\non getResultListFeedback()\n\n\tset json to \"{\\\"items\\\": [\"\n\n\trepeat with theResult in resultList\n\n\t\tset json to json & getResultFeedback(theResult)\n\t\tset json to json & \",\"\n\n\tend repeat\n\n\t-- remove trailing comma after last item\n\tset json to text 1 thru (length of json - 1) of json\n\tset json to json & \"]}\"\n\treturn json\n\nend getResultListFeedback\n\n-- writes the given content to the given file\non fileWrite(theFile, theContent)\n\n\tset fileRef to open for access theFile with write permission\n\ttry\n\t\tset eof of fileRef to 0\n\t\twrite theContent to fileRef starting at eof\n\t\tclose access fileRef\n\ton error\n\t\tclose access fileRef\n\tend try\n\nend fileWrite\n\n-- query path to artwork image file cached natively by Music.app in Catalina\non getSongArtworkPath(theSong)\n\n\ttry\n\n\t\tif albumArtEnabled is false then return defaultIconName\n\n\t\ttell application \"Music\"\n\n\t\t\t-- get persistent ID of song and convert from hexadecimal to decimal (base-10)\n\t\t\tset hexSongId to persistent ID of theSong\n\t\t\tset decSongId to (do shell script \"echo $((16#\" & hexSongId & \"))\")\n\n\t\t\t-- retrieve filename of cached artwork\n\t\t\tset artworkName to (do shell script (\"\/usr\/bin\/sqlite3 \" & (POSIX path of artworkDocsFolder) & \"\/artworkd.sqlite '\" & \u00ac\n\t\t\t\"select ZHASHSTRING, ZKIND from ZIMAGEINFO where Z_PK = (\" & \u00ac\n\t\t\t\"(select ZIMAGEINFO from ZSOURCEINFO where Z_PK = (\" & \u00ac\n\t\t\t\"select ZSOURCEINFO from ZDATABASEITEMINFO where ZPERSISTENTID = \" & \u00ac\n\t\t\tdecSongId & \")))' | \" & \u00ac\n\t\t\t\"awk '{split($0,a,\\\"|\\\"); print a[1] \\\"_sk_\\\" a[2] \\\"_cid_1.jpeg\\\"}'\"))\n\n\t\t\tset artworkPath to (artworkImageFolder & artworkName)\n\n\t\tend tell\n\n\t\treturn artworkPath\n\n\ton error errorMessage\n\n\t\tlog errorMessage\n\n\tend try\n\nend getNativeCachedArtworkPath\n\n-- creates album artwork cache\non createWorkflowPlaylist()\n\n\ttell application \"Music\"\n\n\t\tif not (user playlist workflowPlaylistName exists) then\n\n\t\t\tmake new user playlist with properties {name:workflowPlaylistName, shuffle:false}\n\n\t\tend if\n\n\tend tell\n\nend createWorkflowPlaylist\n\non clearQueue()\n\n\ttell application \"Music\"\n\n\t\tif user playlist workflowPlaylistName exists then\n\n\t\t\tdelete tracks of user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend clearQueue\n\non queueSongs(theSongs)\n\n\ttell application \"Music\"\n\n\t\trepeat with theSong in theSongs\n\n\t\t\tduplicate theSong to user playlist workflowPlaylistName\n\n\t\tend repeat\n\n\tend tell\n\nend queueSongs\n\non playQueue()\n\n\ttell application \"Music\"\n\n\t\tif number of tracks in user playlist workflowPlaylistName is not 0 then\n\n\t\t\tplay user playlist workflowPlaylistName\n\n\t\tend if\n\n\tend tell\n\nend playQueue\n\non getPlaylist(playlistId)\n\n\ttell application \"Music\"\n\n\t\treturn (first playlist whose id is playlistId)\n\n\tend tell\n\nend getPlaylist\n\non getPlaylistSongs(playlistId)\n\n\ttell application \"Music\"\n\n\t\tset thePlaylist to getPlaylist(playlistId) of me\n\t\tset playlistSongs to every track of thePlaylist\n\n\tend tell\n\n\treturn playlistSongs\n\nend getPlaylistSongs\n\n-- retrieves list of artist names for the given genre\non getGenreArtists(genreName)\n\n\ttell application \"Music\"\n\n\t\tset genreSongs to every track of playlist 2 whose genre is genreName\n\t\tset artistNames to {}\n\n\t\trepeat with theSong in genreSongs\n\n\t\t\tif (artist of theSong) is not in artistNames then\n\n\t\t\t\tset artistNames to artistNames & (artist of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistNames\n\nend getGenreArtists\n\n-- retrieves list of songs within the given genre, sorted by artist\non getGenreSongs(genreName)\n\n\tset artistNames to getGenreArtists(genreName) of me\n\tset genreSongs to {}\n\n\trepeat with artistName in artistNames\n\n\t\tset genreSongs to genreSongs & getArtistSongs(artistName) of me\n\n\tend repeat\n\n\treturn genreSongs\n\nend getGenreSongs\n\n-- retrieves list of album names for the given artist\non getArtistAlbums(artistName)\n\n\ttell application \"Music\"\n\n\t\tset artistSongs to every track of playlist 2 whose artist is artistName\n\t\tset albumNames to {}\n\n\t\trepeat with theSong in artistSongs\n\n\t\t\tif (album of theSong) is not in albumNames then\n\n\t\t\t\tset albumNames to albumNames & (album of theSong)\n\n\t\t\tend if\n\n\t\tend repeat\n\n\tend tell\n\n\treturn albumNames\n\nend getArtistAlbums\n\n-- retrieves list of songs by the given artist, sorted by album\non getArtistSongs(artistName)\n\n\ttell application \"Music\"\n\n\t\tset albumNames to getArtistAlbums(artistName) of me\n\t\tset artistSongs to {}\n\n\t\trepeat with albumName in albumNames\n\n\t\t\tset albumSongs to (every track of playlist 2 whose artist is artistName and album is albumName)\n\t\t\tset artistSongs to artistSongs & albumSongs\n\n\t\tend repeat\n\n\tend tell\n\n\treturn artistSongs\n\nend getArtistSongs\n\n-- retrieves list of songs in the given album\non getAlbumSongs(albumName)\n\n\ttell application \"Music\"\n\n\t\tset albumSongs to every track of playlist 2 whose album is albumName\n\n\tend tell\n\n\treturn albumSongs\n\nend getAlbumSongs\n\n-- retrieves the song with the given ID\non getSong(songId)\n\n\ttell application \"Music\"\n\n\t\tset theSong to first track of playlist 2 whose database ID is songId\n\n\tend tell\n\n\treturn theSong\n\nend getSong\n\n-- retrieves a list of objects or names matching the given query and type\non getResultsFromQuery(query, queryType)\n\n\tset evalScript to run script \"\n\tscript\n\n\t\ton findResults(query, queryType, resultLimit)\n\n\t\t\ttell application \\\"Music\\\"\n\n\t\t\t\tset theSongs to (get every track in playlist 2 whose \" & queryType & \" starts with query)\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains (space & query) and \" & queryType & \" does not start with query)\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs < resultLimit then\n\n\t\t\t\t\tset theSongs to theSongs & (get every track in playlist 2 whose \" & queryType & \" contains query and \" & queryType & \" does not start with query and \" & queryType & \" does not contain (space & query))\n\n\t\t\t\tend if\n\n\t\t\t\tif length of theSongs is 0 then\n\n\t\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only songs)\n\n\t\t\t\t\telse if queryType is not \\\"genre\\\" then\n\n\t\t\t\t\t\tset theSongs to theSongs & (search playlist 2 for query only \" & queryType & \"s)\n\n\t\t\t\t\tend if\n\n\t\t\t\tend if\n\n\t\t\t\tif queryType is \\\"name\\\" then\n\n\t\t\t\t\tif length of theSongs > resultLimit then\n\n\t\t\t\t\t\tset theSongs to items 1 thru resultLimit of theSongs\n\n\t\t\t\t\tend if\n\n\t\t\t\t\tset theResults to theSongs\n\n\t\t\t\telse\n\n\t\t\t\t\tset theResults to {}\n\n\t\t\t\t\trepeat with theSong in theSongs\n\n\t\t\t\t\t\tif length of theResults is resultLimit then exit repeat\n\n\t\t\t\t\t\tset theResult to \" & queryType & \" of theSong\n\n\t\t\t\t\t\tif theResult is not in theResults then\n\n\t\t\t\t\t\t\tset theResults to theResults & theResult\n\n\t\t\t\t\t\tend if\n\n\t\t\t\t\tend repeat\n\n\t\t\t\tend if\n\n\t\t\tend tell\n\n\t\t\treturn theResults\n\n\t\tend findResults\n\n\tend script\n\t\"\n\n\tevalScript's findResults(query, queryType, resultLimit)\n\nend getResultsFromQuery\n\n-- returns the given string with leading and trailing whitespace removed\non trimWhitespace(theString)\n\n\t-- trim leading whitespace\n\trepeat while theString begins with space\n\n\t\tif length of theString is 1 then return \"\"\n\t\tset theString to text 2 thru end of theString\n\n\tend repeat\n\n\t-- trim trailing whitespace\n\trepeat while theString ends with space\n\n\t\tset theString to text 1 thru ((length of theString) - 1) of theString\n\n\tend repeat\n\n\treturn theString\n\nend trimWhitespace\n\n-- queues the song with the given ID\non queueSong(songId)\n\n\tset theSong to getSong(songId)\n\tqueueSongs({theSong})\n\nend queueSong\n\n-- queues all songs belonging to the given album\non queueAlbum(albumName)\n\n\tset albumName to decodeFeedbackChars(albumName)\n\tset albumSongs to getAlbumSongs(albumName)\n\tqueueSongs(albumSongs)\n\nend queueAlbum\n\n-- queues all songs by the given artist\non queueArtist(artistName)\n\n\tset artistName to decodeFeedbackChars(artistName)\n\tset artistSongs to getArtistSongs(artistName)\n\tqueueSongs(artistSongs)\n\nend queueArtist\n\n-- queues all songs within the given genre\non queueGenre(genreName)\n\n\tset genreName to decodeFeedbackChars(genreName)\n\tset genreSongs to getGenreSongs(genreName)\n\tqueueSongs(genreSongs)\n\nend queueGenre\n\n-- queues all songs in the given playlist\non queuePlaylist(playlistId)\n\n\tset playlistSongs to getPlaylistSongs(playlistId)\n\tqueueSongs(playlistSongs)\n\nend queuePlaylist\n\n-- parses the given result query to retrieve type and id of item to queue\non parseResultQuery(query)\n\n\tset pos to offset of \"-\" in query\n\tset theType to text 1 thru (pos - 1) of query\n\tset theId to text (pos + 1) thru end of query\n\treturn {type:theType, id:theId}\n\nend parseResultQuery\n\non queue(query)\n\n\tset typeAndId to parseResultQuery(query)\n\tset theType to type of typeAndId\n\tset theId to id of typeAndId\n\n\tcreateWorkflowPlaylist()\n\n\tif theType is \"song\" then\n\t\tqueueSong(theId)\n\telse if theType is \"album\" then\n\t\tqueueAlbum(theId)\n\telse if theType is \"artist\" then\n\t\tqueueArtist(theId)\n\telse if theType is \"genre\" then\n\t\tqueueGenre(theId)\n\telse if theType is \"playlist\" then\n\t\tqueuePlaylist(theId)\n\telse\n\t\tlog \"Unsupported type: \" & theType\n\tend if\n\nend queue\n\non play(query)\n\n\tclearQueue()\n\tqueue(query)\n\tplayQueue()\n\nend play\n","subject":"Reorganize and clean up workflow parameters","message":"Reorganize and clean up workflow parameters\n","lang":"AppleScript","license":"mit","repos":"caleb531\/play-song,caleb531\/play-song"}
{"commit":"90849d69bf32eb6cfe7b309270beef51d10054a1","old_file":"start-iterm-env.scpt","new_file":"start-iterm-env.scpt","old_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\t\u0000\u0007\r\u0000\u0007\u0000\u0002r\u0000\u0000\u0000\u0000\u0000\t\u0000\b\u0000\t\r\u0000\b\u0000\u0002n\u0000\u0000\u0000\u0000\u0000\u0007\u0000\n\u0000\u000b\r\u0000\n\u0000\u00011\u0000\u0000\u0000\u0005\u0000\u0007\n\u0000\u0004\npsxp\r\u0000\u000b\u0000\u0003l\u0000\u0005\u0000\u0000\u0000\u0005\u0000\f\r\u0000\f\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0005\u0000\r\n\u0000\u0018.earsffdralis\u0000\u0000\u0000\u0000\u0000\u0000 \u0000afdr\r\u0000\r\u0000\u0000f\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000\t\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u000f0\u0000\u000bscript_path\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000\u000e\u0000\u000f\r\u0000\u000e\u0000\u0003l\u0000\u0002\u0000\n\u0000\u0013\u0000\u0010\r\u0000\u0010\u0000\u0002r\u0000\u0000\u0000\n\u0000\u0013\u0000\u0011\u0000\u0012\r\u0000\u0011\u0000\u0003l\u0000\u0005\u0000\n\u0000\u0011\u0000\u0013\r\u0000\u0013\u0000\u0003I\u0000\u0002\u0000\n\u0000\u0011\u0000\u0014\n\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\r\u0000\u0014\u0000\u0002b\u0000\u0000\u0000\n\u0000\r\u0000\u0015\u0000\u0016\r\u0000\u0015\u0000\u0001m\u0000\u0000\u0000\n\u0000\u000b\u0000\u0017\u000e\u0000\u0017\u0000\u0001\u0000\u0018\u0011\u0000\u0018\u0000\u0010\u0000d\u0000i\u0000r\u0000n\u0000a\u0000m\u0000e\u0000 \r\u0000\u0016\u0000\u0001o\u0000\u0000\u0000\u000b\u0000\f\u000b\u0000\u000f0\u0000\u000bscript_path\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000\u0012\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00100\u0000\fproject_path\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u000f\u0000\u0002\u0000\u0019\u0000\u001a\r\u0000\u0019\u0000\u0003l\u0000\u0002\u0000\u0014\u0000\u0017\u0000\u001b\r\u0000\u001b\u0000\u0002r\u0000\u0000\u0000\u0014\u0000\u0017\u0000\u001c\u0000\u001d\r\u0000\u001c\u0000\u0001m\u0000\u0000\u0000\u0014\u0000\u0015\u0000\u001e\u000e\u0000\u001e\u0000\u0001\u0000\u001f\u0011\u0000\u001f\u0000\u0014\u0000t\u0000r\u0000a\u0000k\u0000.\u0000i\u0000o\u0000.\u0000j\u0000s\r\u0000\u001d\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00100\u0000\fproject_name\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u001a\u0000\u0002\u0000 \u0000!\r\u0000 \u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000!\u0000\u0002\u0000\"\r\u0000\"\u0000\u0003l\u0000\u0002\u0000\u0018\u0000\u0000#\r\u0000#\u0000\u0002O\u0000\u0000\u0000\u0018\u0000\u0000$\u0000%\r\u0000$\u0000\u0001k\u0000\u0000\u0000\u001c\u0000\u0000&\u0002\u0000&\u0000\u0002\u0000'\u0000(\r\u0000'\u0000\u0003I\u0000\u0002\u0000\u001c\u0000!\n\u0000\u0018.miscactvnull\u0000\u0000null\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000(\u0000\u0002\u0000)\u0000*\r\u0000)\u0000\u0003l\u0000\u0002\u0000\"\u0000\"\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000*\u0000\u0002\u0000+\u0000,\r\u0000+\u0000\u0003l\u0000\u0001\u0000\"\u0000\"\u0000-\u0000.\u0001\u0000\u0000\f\u0000-\u0000\u001a\u0000\u0014 make a new terminal\u0000\u0002\u0000\u0000\u000e\u0000.\u0000\u0001\u0000\/\u0011\u0000\/\u0000(\u0000 \u0000m\u0000a\u0000k\u0000e\u0000 \u0000a\u0000 \u0000n\u0000e\u0000w\u0000 \u0000t\u0000e\u0000r\u0000m\u0000i\u0000n\u0000a\u0000l\u0002\u0000,\u0000\u0002\u00000\u00001\r\u00000\u0000\u0002r\u0000\u0000\u0000\"\u0000+\u00002\u00003\r\u00002\u0000\u0003l\u0000\u0005\u0000\"\u0000)\u00004\r\u00004\u0000\u0003I\u0000\u0002\u0000\"\u0000)\u00005\n\u0000\u0018.corecrel****\u0000\u0000\u0000\u0000\u0000\u0000\u0000null\u0001\u0000\u0000\u0006\u00005\u0000\u0003\u00006\n\u0000\u0004\nkocl\r\u00006\u0000\u0001m\u0000\u0000\u0000$\u0000%\n\u0000\u0004\nPtrm\u0006\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u00003\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00110\u0000\rtrak_terminal\u0000\u0000\u0002\u00001\u0000\u0002\u00007\u00008\r\u00007\u0000\u0003l\u0000\u0002\u0000,\u0000,\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u00008\u0000\u0002\u00009\u0000:\r\u00009\u0000\u0003l\u0000\u0001\u0000,\u0000,\u0000;\u0000<\u0001\u0000\u0000\f\u0000;\u0000\u001f\u0000\u0019 talk to the new terminal\u0000\u0002\u0000\u0000\u000e\u0000<\u0000\u0001\u0000=\u0011\u0000=\u00002\u0000 \u0000t\u0000a\u0000l\u0000k\u0000 \u0000t\u0000o\u0000 \u0000t\u0000h\u0000e\u0000 \u0000n\u0000e\u0000w\u0000 \u0000t\u0000e\u0000r\u0000m\u0000i\u0000n\u0000a\u0000l\u0002\u0000:\u0000\u0002\u0000>\u0000?\r\u0000>\u0000\u0002O\u0000\u0000\u0000,\u0000\u0000@\u0000A\r\u0000@\u0000\u0001k\u0000\u0000\u00000\u0000\u0000B\u0002\u0000B\u0000\u0002\u0000C\u0000D\r\u0000C\u0000\u0003l\u0000\u0002\u00000\u00000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000D\u0000\u0002\u0000E\u0000F\r\u0000E\u0000\u0003I\u0000\u0002\u00000\u00007\u0000G\n\u0000\u0018.ITRMLNCHPssn\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000obj \u0001\u0000\u0000\u0006\u0000G\u0000\u0003\u0000H\n\u0000\u0004\nPssn\r\u0000H\u0000\u0001m\u0000\u0000\u00002\u00003\u0000I\u000e\u0000I\u0000\u0001\u0000J\u0011\u0000J\u0000\u0014\u0000S\u0000m\u0000a\u0000l\u0000l\u0000 \u0000T\u0000e\u0000x\u0000t\u0006\u0000\u0000\u0002\u0000F\u0000\u0002\u0000K\u0000L\r\u0000K\u0000\u0002O\u0000\u0000\u00008\u0000f\u0000M\u0000N\r\u0000M\u0000\u0001k\u0000\u0000\u0000@\u0000e\u0000O\u0002\u0000O\u0000\u0002\u0000P\u0000Q\r\u0000P\u0000\u0002r\u0000\u0000\u0000@\u0000K\u0000R\u0000S\r\u0000R\u0000\u0002b\u0000\u0000\u0000@\u0000E\u0000T\u0000U\r\u0000T\u0000\u0001m\u0000\u0000\u0000@\u0000C\u0000V\u000e\u0000V\u0000\u0001\u0000W\u0011\u0000W\u0000\u000e\u0000S\u0000e\u0000r\u0000v\u0000e\u0000r\u0000 \r\u0000U\u0000\u0001o\u0000\u0000\u0000C\u0000D\u000b\u0000\u00100\u0000\fproject_name\u0000\u0000\r\u0000S\u0000\u00011\u0000\u0000\u0000E\u0000J\n\u0000\u0004\npnam\u0002\u0000Q\u0000\u0002\u0000X\u0000Y\r\u0000X\u0000\u0003I\u0000\u0002\u0000L\u0000Y\u0000Z\n\u0000\u0018.ITRMWrtenull\u0000\u0000\u0000\u0010\u0000obj \u0001\u0000\u0000\u0006\u0000Z\u0000\u0003\u0000[\n\u0000\u0004\niTxt\r\u0000[\u0000\u0002b\u0000\u0000\u0000P\u0000U\u0000\\\u0000]\r\u0000\\\u0000\u0001m\u0000\u0000\u0000P\u0000S\u0000^\u000e\u0000^\u0000\u0001\u0000_\u0011\u0000_\u0000\u0006\u0000c\u0000d\u0000 \r\u0000]\u0000\u0001o\u0000\u0000\u0000S\u0000T\u000b\u0000\u00100\u0000\fproject_path\u0000\u0000\u0006\u0000\u0000\u0002\u0000Y\u0000\u0002\u0000`\r\u0000`\u0000\u0003I\u0000\u0002\u0000Z\u0000e\u0000a\n\u0000\u0018.ITRMWrtenull\u0000\u0000\u0000\u0010\u0000obj \u0001\u0000\u0000\u0006\u0000a\u0000\u0003\u0000b\n\u0000\u0004\niTxt\r\u0000b\u0000\u0001m\u0000\u0000\u0000^\u0000a\u0000c\u000e\u0000c\u0000\u0001\u0000d\u0011\u0000d\u0000\u0016\u0000m\u0000a\u0000k\u0000e\u0000 \u0000s\u0000e\u0000r\u0000v\u0000e\u0000r\u0006\u0000\u0000\u0002\u0000\u0000\r\u0000N\u0000\u00011\u0000\u0000\u00008\u0000=\n\u0000\u0004\nCssn\u0002\u0000L\u0000\u0002\u0000e\u0000f\r\u0000e\u0000\u0003l\u0000\u0002\u0000g\u0000g\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000f\u0000\u0002\u0000g\u0000h\r\u0000g\u0000\u0003I\u0000\u0002\u0000g\u0000p\u0000i\n\u0000\u0018.ITRMLNCHPssn\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000obj \u0001\u0000\u0000\u0006\u0000i\u0000\u0003\u0000j\n\u0000\u0004\nPssn\r\u0000j\u0000\u0001m\u0000\u0000\u0000i\u0000l\u0000k\u000e\u0000k\u0000\u0001\u0000l\u0011\u0000l\u0000\u0014\u0000S\u0000m\u0000a\u0000l\u0000l\u0000 \u0000T\u0000e\u0000x\u0000t\u0006\u0000\u0000\u0002\u0000h\u0000\u0002\u0000m\u0000n\r\u0000m\u0000\u0002O\u0000\u0000\u0000q\u0000\u0000o\u0000p\r\u0000o\u0000\u0001k\u0000\u0000\u0000y\u0000\u0000q\u0002\u0000q\u0000\u0002\u0000r\u0000s\r\u0000r\u0000\u0002r\u0000\u0000\u0000y\u0000\u0000t\u0000u\r\u0000t\u0000\u0002b\u0000\u0000\u0000y\u0000~\u0000v\u0000w\r\u0000v\u0000\u0001m\u0000\u0000\u0000y\u0000|\u0000x\u000e\u0000x\u0000\u0001\u0000y\u0011\u0000y\u0000\f\u0000G\u0000u\u0000a\u0000r\u0000d\u0000 \r\u0000w\u0000\u0001o\u0000\u0000\u0000|\u0000}\u000b\u0000\u00100\u0000\fproject_name\u0000\u0000\r\u0000u\u0000\u00011\u0000\u0000\u0000~\u0000\n\u0000\u0004\npnam\u0002\u0000s\u0000\u0002\u0000z\u0000{\r\u0000z\u0000\u0003I\u0000\u0002\u0000\u0000\u0000|\n\u0000\u0018.ITRMWrtenull\u0000\u0000\u0000\u0010\u0000obj \u0001\u0000\u0000\u0006\u0000|\u0000\u0003\u0000}\n\u0000\u0004\niTxt\r\u0000}\u0000\u0002b\u0000\u0000\u0000\u0000\u0000~\u0000\r\u0000~\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0006\u0000c\u0000d\u0000 \r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u00100\u0000\fproject_path\u0000\u0000\u0006\u0000\u0000\u0002\u0000{\u0000\u0002\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\n\u0000\u0018.ITRMWrtenull\u0000\u0000\u0000\u0010\u0000obj \u0001\u0000\u0000\u0006\u0000\u0000\u0003\u0000\n\u0000\u0004\niTxt\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\n\u0000g\u0000u\u0000a\u0000r\u0000d\u0006\u0000\u0000\u0002\u0000\u0000\r\u0000p\u0000\u00011\u0000\u0000\u0000q\u0000v\n\u0000\u0004\nCssn\u0002\u0000n\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\n\u0000\u0018.ITRMLNCHPssn\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000obj \u0001\u0000\u0000\u0006\u0000\u0000\u0003\u0000\n\u0000\u0004\nPssn\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0014\u0000S\u0000m\u0000a\u0000l\u0000l\u0000 \u0000T\u0000e\u0000x\u0000t\u0006\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0002O\u0000\u0000\u0000\u0000\u0000\u0000\r\u0000\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0002r\u0000\u0000\u0000\u0000\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u00100\u0000\fproject_name\u0000\u0000\r\u0000\u0000\u00011\u0000\u0000\u0000\u0000\n\u0000\u0004\npnam\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\n\u0000\u0018.ITRMWrtenull\u0000\u0000\u0000\u0010\u0000obj \u0001\u0000\u0000\u0006\u0000\u0000\u0003\u0000\n\u0000\u0004\niTxt\r\u0000\u0000\u0002b\u0000\u0000\u0000\u0000\u0000\u0000\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0006\u0000c\u0000d\u0000 \r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u00100\u0000\fproject_path\u0000\u0000\u0006\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u00011\u0000\u0000\u0000\u0000\n\u0000\u0004\nCssn\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000A\u0000\u0001o\u0000\u0000\u0000,\u0000-\u000b\u0000\u00110\u0000\rtrak_terminal\u0000\u0000\u0002\u0000?\u0000\u0002\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000%\u0000\u0001m\u0000\u0000\u0000\u0018\u0000\u0019\u0000\u000f\u0000\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000ITRM\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001H\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0018H+\u0000\u0000\u0000\u0000\u0000M\tiTerm.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003>\u000beB\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fApplications\u0000\u0010\u0000\b\u0000\u0000\u0018\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000W2\u0000\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000M\u0000\u0002\u0000$Macintosh HD:Applications:\u0000iTerm.app\u0000\u000e\u0000\u0014\u0000\t\u0000i\u0000T\u0000e\u0000r\u0000m\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000\u0016Applications\/iTerm.app\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\n\u0000\u0000\u0000\u0000\u0000\u001e\u0000\u0001\u0000\u0000\u0010\u0000\u0000\b\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000b\u0000\u000f0\u0000\u000bscript_path\u0000\u0000\u000b\u0000\u00100\u0000\fproject_path\u0000\u0000\u000b\u0000\u00100\u0000\fproject_name\u0000\u0000\u000b\u0000\u00110\u0000\rtrak_terminal\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u000e\u0000\u0000\u0007\u0010\u0000\u0000\u0000\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0005\u0000\u0002\u0000\u0000\u0002\u0000\u000e\u0000\u0002\u0000\u0000\u0002\u0000\u0019\u0000\u0002\u0000\u0000\u0002\u0000\"\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000\u0000\u0000\u0010\u0000\u0000\u001e~\u0000\u0017}|\u0000\u001e{\u0000zyxwvu\u0000Its\u0000Vrq\u0000^p\u0000c\u0000k\u0000x\u0000\u0000\u0000\u0000\n\u0000\u0018.earsffdralis\u0000\u0000\u0000\u0000\u0000\u0000 \u0000afdr\n\u0000\u0004\npsxp\u000b~\u0000\u000f0\u0000\u000bscript_path\u0000\u0000\n}\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\u000b|\u0000\u00100\u0000\fproject_path\u0000\u0000\u000b{\u0000\u00100\u0000\fproject_name\u0000\u0000\nz\u0000\u0018.miscactvnull\u0000\u0000null\ny\u0000\u0004\nkocl\nx\u0000\u0004\nPtrm\nw\u0000\u0018.corecrel****\u0000\u0000\u0000\u0000\u0000\u0000\u0000null\u000bv\u0000\u00110\u0000\rtrak_terminal\u0000\u0000\nu\u0000\u0004\nPssn\nt\u0000\u0018.ITRMLNCHPssn\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000obj \ns\u0000\u0004\nCssn\nr\u0000\u0004\npnam\nq\u0000\u0004\niTxt\np\u0000\u0018.ITRMWrtenull\u0000\u0000\u0000\u0010\u0000obj \u0011\u0000)j\f\u0000\u0000,EO%j\f\u0000\u0004EOEO\u0012\u0000*j\f\u0000\tO*l\f\u0000\fEO\u0012\u0000*l\f\u0000\u0010O*a\u0000\u0011,\u0012\u0000'a\u0000\u0012%*a\u0000\u0013,FO*a\u0000\u0014a\u0000\u0015%l\f\u0000\u0016O*a\u0000\u0014a\u0000\u0017l\f\u0000\u0016UO*a\u0000\u0018l\f\u0000\u0010O*a\u0000\u0011,\u0012\u0000'a\u0000\u0019%*a\u0000\u0013,FO*a\u0000\u0014a\u0000\u001a%l\f\u0000\u0016O*a\u0000\u0014a\u0000\u001bl\f\u0000\u0016UO*a\u0000\u001cl\f\u0000\u0010O*a\u0000\u0011,\u0012\u0000\u0017*a\u0000\u0013,FO*a\u0000\u0014a\u0000\u001d%l\f\u0000\u0016UOPUOPU\u000f\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0000\/\u0000U\u0000s\u0000e\u0000r\u0000s\u0000\/\u0000m\u0000s\u0000a\u0000s\u0000p\u0000e\u0000n\u0000c\u0000e\u0000\/\u0000P\u0000r\u0000o\u0000j\u0000e\u0000c\u0000t\u0000s\u0000\/\u0000t\u0000r\u0000a\u0000k\u0000.\u0000i\u0000o\u0000\/\u0000c\u0000o\u0000d\u0000e\u0000\/\u0000t\u0000r\u0000a\u0000k\u0000.\u0000i\u0000o\u0000.\u0000j\u0000s\u0000\/\u0000s\u0000t\u0000a\u0000r\u0000t\u0000-\u0000i\u0000t\u0000e\u0000r\u0000m\u0000-\u0000e\u0000n\u0000v\u0000.\u0000s\u0000c\u0000p\u0000t\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000b\u0000\/\u0000U\u0000s\u0000e\u0000r\u0000s\u0000\/\u0000m\u0000s\u0000a\u0000s\u0000p\u0000e\u0000n\u0000c\u0000e\u0000\/\u0000P\u0000r\u0000o\u0000j\u0000e\u0000c\u0000t\u0000s\u0000\/\u0000t\u0000r\u0000a\u0000k\u0000.\u0000i\u0000o\u0000\/\u0000c\u0000o\u0000d\u0000e\u0000\/\u0000t\u0000r\u0000a\u0000k\u0000.\u0000i\u0000o\u0000.\u0000j\u0000s\u000e\u0000\u0000\u0001\u0014\u0000\u000e\u0000\u0000\u0003\u0018\u0000on\no\u0000\u0004\nPtrm\u0003n\u0000\u0003\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0000ascr\u0000\u0001\u0000\r\u07ad","new_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\t\u0000\u0007\r\u0000\u0007\u0000\u0002r\u0000\u0000\u0000\u0000\u0000\t\u0000\b\u0000\t\r\u0000\b\u0000\u0002n\u0000\u0000\u0000\u0000\u0000\u0007\u0000\n\u0000\u000b\r\u0000\n\u0000\u00011\u0000\u0000\u0000\u0005\u0000\u0007\n\u0000\u0004\npsxp\r\u0000\u000b\u0000\u0003l\u0000\u0005\u0000\u0000\u0000\u0005\u0000\f\r\u0000\f\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0005\u0000\r\n\u0000\u0018.earsffdralis\u0000\u0000\u0000\u0000\u0000\u0000 \u0000afdr\r\u0000\r\u0000\u0000f\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000\t\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u000f0\u0000\u000bscript_path\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000\u000e\u0000\u000f\r\u0000\u000e\u0000\u0003l\u0000\u0002\u0000\n\u0000\u0013\u0000\u0010\r\u0000\u0010\u0000\u0002r\u0000\u0000\u0000\n\u0000\u0013\u0000\u0011\u0000\u0012\r\u0000\u0011\u0000\u0003l\u0000\u0005\u0000\n\u0000\u0011\u0000\u0013\r\u0000\u0013\u0000\u0003I\u0000\u0002\u0000\n\u0000\u0011\u0000\u0014\n\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\r\u0000\u0014\u0000\u0002b\u0000\u0000\u0000\n\u0000\r\u0000\u0015\u0000\u0016\r\u0000\u0015\u0000\u0001m\u0000\u0000\u0000\n\u0000\u000b\u0000\u0017\u000e\u0000\u0017\u0000\u0001\u0000\u0018\u0011\u0000\u0018\u0000\u0010\u0000d\u0000i\u0000r\u0000n\u0000a\u0000m\u0000e\u0000 \r\u0000\u0016\u0000\u0001o\u0000\u0000\u0000\u000b\u0000\f\u000b\u0000\u000f0\u0000\u000bscript_path\u0000\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000\u0012\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00100\u0000\fproject_path\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u000f\u0000\u0002\u0000\u0019\u0000\u001a\r\u0000\u0019\u0000\u0003l\u0000\u0002\u0000\u0014\u0000\u0017\u0000\u001b\r\u0000\u001b\u0000\u0002r\u0000\u0000\u0000\u0014\u0000\u0017\u0000\u001c\u0000\u001d\r\u0000\u001c\u0000\u0001m\u0000\u0000\u0000\u0014\u0000\u0015\u0000\u001e\u000e\u0000\u001e\u0000\u0001\u0000\u001f\u0011\u0000\u001f\u0000\u0014\u0000t\u0000r\u0000a\u0000k\u0000.\u0000i\u0000o\u0000.\u0000j\u0000s\r\u0000\u001d\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00100\u0000\fproject_name\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u001a\u0000\u0002\u0000 \u0000!\r\u0000 \u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000!\u0000\u0002\u0000\"\r\u0000\"\u0000\u0003l\u0000\u0002\u0000\u0018\u0000\u0000#\r\u0000#\u0000\u0002O\u0000\u0000\u0000\u0018\u0000\u0000$\u0000%\r\u0000$\u0000\u0001k\u0000\u0000\u0000\u001c\u0000\u0000&\u0002\u0000&\u0000\u0002\u0000'\u0000(\r\u0000'\u0000\u0003I\u0000\u0002\u0000\u001c\u0000!\n\u0000\u0018.miscactvnull\u0000\u0000null\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000(\u0000\u0002\u0000)\u0000*\r\u0000)\u0000\u0003l\u0000\u0002\u0000\"\u0000\"\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000*\u0000\u0002\u0000+\u0000,\r\u0000+\u0000\u0003l\u0000\u0001\u0000\"\u0000\"\u0000-\u0000.\u0001\u0000\u0000\f\u0000-\u0000\u001a\u0000\u0014 make a new terminal\u0000\u0002\u0000\u0000\u000e\u0000.\u0000\u0001\u0000\/\u0011\u0000\/\u0000(\u0000 \u0000m\u0000a\u0000k\u0000e\u0000 \u0000a\u0000 \u0000n\u0000e\u0000w\u0000 \u0000t\u0000e\u0000r\u0000m\u0000i\u0000n\u0000a\u0000l\u0002\u0000,\u0000\u0002\u00000\u00001\r\u00000\u0000\u0002r\u0000\u0000\u0000\"\u0000+\u00002\u00003\r\u00002\u0000\u0003l\u0000\u0005\u0000\"\u0000)\u00004\r\u00004\u0000\u0003I\u0000\u0002\u0000\"\u0000)\u00005\n\u0000\u0018.corecrel****\u0000\u0000\u0000\u0000\u0000\u0000\u0000null\u0001\u0000\u0000\u0006\u00005\u0000\u0003\u00006\n\u0000\u0004\nkocl\r\u00006\u0000\u0001m\u0000\u0000\u0000$\u0000%\n\u0000\u0004\nPtrm\u0006\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u00003\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00110\u0000\rtrak_terminal\u0000\u0000\u0002\u00001\u0000\u0002\u00007\u00008\r\u00007\u0000\u0003l\u0000\u0002\u0000,\u0000,\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u00008\u0000\u0002\u00009\u0000:\r\u00009\u0000\u0003l\u0000\u0001\u0000,\u0000,\u0000;\u0000<\u0001\u0000\u0000\f\u0000;\u0000\u001f\u0000\u0019 talk to the new terminal\u0000\u0002\u0000\u0000\u000e\u0000<\u0000\u0001\u0000=\u0011\u0000=\u00002\u0000 \u0000t\u0000a\u0000l\u0000k\u0000 \u0000t\u0000o\u0000 \u0000t\u0000h\u0000e\u0000 \u0000n\u0000e\u0000w\u0000 \u0000t\u0000e\u0000r\u0000m\u0000i\u0000n\u0000a\u0000l\u0002\u0000:\u0000\u0002\u0000>\u0000?\r\u0000>\u0000\u0002O\u0000\u0000\u0000,\u0000\u0000@\u0000A\r\u0000@\u0000\u0001k\u0000\u0000\u00000\u0000\u0000B\u0002\u0000B\u0000\u0002\u0000C\u0000D\r\u0000C\u0000\u0003l\u0000\u0002\u00000\u00000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000D\u0000\u0002\u0000E\u0000F\r\u0000E\u0000\u0003I\u0000\u0002\u00000\u00007\u0000G\n\u0000\u0018.ITRMLNCHPssn\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000obj \u0001\u0000\u0000\u0006\u0000G\u0000\u0003\u0000H\n\u0000\u0004\nPssn\r\u0000H\u0000\u0001m\u0000\u0000\u00002\u00003\u0000I\u000e\u0000I\u0000\u0001\u0000J\u0011\u0000J\u0000\u0014\u0000S\u0000m\u0000a\u0000l\u0000l\u0000 \u0000T\u0000e\u0000x\u0000t\u0006\u0000\u0000\u0002\u0000F\u0000\u0002\u0000K\u0000L\r\u0000K\u0000\u0002O\u0000\u0000\u00008\u0000f\u0000M\u0000N\r\u0000M\u0000\u0001k\u0000\u0000\u0000@\u0000e\u0000O\u0002\u0000O\u0000\u0002\u0000P\u0000Q\r\u0000P\u0000\u0002r\u0000\u0000\u0000@\u0000K\u0000R\u0000S\r\u0000R\u0000\u0002b\u0000\u0000\u0000@\u0000E\u0000T\u0000U\r\u0000T\u0000\u0001m\u0000\u0000\u0000@\u0000C\u0000V\u000e\u0000V\u0000\u0001\u0000W\u0011\u0000W\u0000\u000e\u0000S\u0000e\u0000r\u0000v\u0000e\u0000r\u0000 \r\u0000U\u0000\u0001o\u0000\u0000\u0000C\u0000D\u000b\u0000\u00100\u0000\fproject_name\u0000\u0000\r\u0000S\u0000\u00011\u0000\u0000\u0000E\u0000J\n\u0000\u0004\npnam\u0002\u0000Q\u0000\u0002\u0000X\u0000Y\r\u0000X\u0000\u0003I\u0000\u0002\u0000L\u0000Y\u0000Z\n\u0000\u0018.ITRMWrtenull\u0000\u0000\u0000\u0010\u0000obj \u0001\u0000\u0000\u0006\u0000Z\u0000\u0003\u0000[\n\u0000\u0004\niTxt\r\u0000[\u0000\u0002b\u0000\u0000\u0000P\u0000U\u0000\\\u0000]\r\u0000\\\u0000\u0001m\u0000\u0000\u0000P\u0000S\u0000^\u000e\u0000^\u0000\u0001\u0000_\u0011\u0000_\u0000\u0006\u0000c\u0000d\u0000 \r\u0000]\u0000\u0001o\u0000\u0000\u0000S\u0000T\u000b\u0000\u00100\u0000\fproject_path\u0000\u0000\u0006\u0000\u0000\u0002\u0000Y\u0000\u0002\u0000`\r\u0000`\u0000\u0003I\u0000\u0002\u0000Z\u0000e\u0000a\n\u0000\u0018.ITRMWrtenull\u0000\u0000\u0000\u0010\u0000obj \u0001\u0000\u0000\u0006\u0000a\u0000\u0003\u0000b\n\u0000\u0004\niTxt\r\u0000b\u0000\u0001m\u0000\u0000\u0000^\u0000a\u0000c\u000e\u0000c\u0000\u0001\u0000d\u0011\u0000d\u0000\u0016\u0000m\u0000a\u0000k\u0000e\u0000 \u0000s\u0000e\u0000r\u0000v\u0000e\u0000r\u0006\u0000\u0000\u0002\u0000\u0000\r\u0000N\u0000\u00011\u0000\u0000\u00008\u0000=\n\u0000\u0004\nCssn\u0002\u0000L\u0000\u0002\u0000e\u0000f\r\u0000e\u0000\u0003l\u0000\u0002\u0000g\u0000g\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000f\u0000\u0002\u0000g\u0000h\r\u0000g\u0000\u0003I\u0000\u0002\u0000g\u0000p\u0000i\n\u0000\u0018.ITRMLNCHPssn\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000obj \u0001\u0000\u0000\u0006\u0000i\u0000\u0003\u0000j\n\u0000\u0004\nPssn\r\u0000j\u0000\u0001m\u0000\u0000\u0000i\u0000l\u0000k\u000e\u0000k\u0000\u0001\u0000l\u0011\u0000l\u0000\u0014\u0000S\u0000m\u0000a\u0000l\u0000l\u0000 \u0000T\u0000e\u0000x\u0000t\u0006\u0000\u0000\u0002\u0000h\u0000\u0002\u0000m\u0000n\r\u0000m\u0000\u0002O\u0000\u0000\u0000q\u0000\u0000o\u0000p\r\u0000o\u0000\u0001k\u0000\u0000\u0000y\u0000\u0000q\u0002\u0000q\u0000\u0002\u0000r\u0000s\r\u0000r\u0000\u0002r\u0000\u0000\u0000y\u0000\u0000t\u0000u\r\u0000t\u0000\u0002b\u0000\u0000\u0000y\u0000~\u0000v\u0000w\r\u0000v\u0000\u0001m\u0000\u0000\u0000y\u0000|\u0000x\u000e\u0000x\u0000\u0001\u0000y\u0011\u0000y\u0000\f\u0000G\u0000u\u0000a\u0000r\u0000d\u0000 \r\u0000w\u0000\u0001o\u0000\u0000\u0000|\u0000}\u000b\u0000\u00100\u0000\fproject_name\u0000\u0000\r\u0000u\u0000\u00011\u0000\u0000\u0000~\u0000\n\u0000\u0004\npnam\u0002\u0000s\u0000\u0002\u0000z\u0000{\r\u0000z\u0000\u0003I\u0000\u0002\u0000\u0000\u0000|\n\u0000\u0018.ITRMWrtenull\u0000\u0000\u0000\u0010\u0000obj \u0001\u0000\u0000\u0006\u0000|\u0000\u0003\u0000}\n\u0000\u0004\niTxt\r\u0000}\u0000\u0002b\u0000\u0000\u0000\u0000\u0000~\u0000\r\u0000~\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0006\u0000c\u0000d\u0000 \r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u00100\u0000\fproject_path\u0000\u0000\u0006\u0000\u0000\u0002\u0000{\u0000\u0002\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\n\u0000\u0018.ITRMWrtenull\u0000\u0000\u0000\u0010\u0000obj \u0001\u0000\u0000\u0006\u0000\u0000\u0003\u0000\n\u0000\u0004\niTxt\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\n\u0000g\u0000u\u0000a\u0000r\u0000d\u0006\u0000\u0000\u0002\u0000\u0000\r\u0000p\u0000\u00011\u0000\u0000\u0000q\u0000v\n\u0000\u0004\nCssn\u0002\u0000n\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\n\u0000\u0018.ITRMLNCHPssn\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000obj \u0001\u0000\u0000\u0006\u0000\u0000\u0003\u0000\n\u0000\u0004\nPssn\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0014\u0000S\u0000m\u0000a\u0000l\u0000l\u0000 \u0000T\u0000e\u0000x\u0000t\u0006\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0002O\u0000\u0000\u0000\u0000\u0000\u0000\r\u0000\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0002r\u0000\u0000\u0000\u0000\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u00100\u0000\fproject_name\u0000\u0000\r\u0000\u0000\u00011\u0000\u0000\u0000\u0000\n\u0000\u0004\npnam\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\n\u0000\u0018.ITRMWrtenull\u0000\u0000\u0000\u0010\u0000obj \u0001\u0000\u0000\u0006\u0000\u0000\u0003\u0000\n\u0000\u0004\niTxt\r\u0000\u0000\u0002b\u0000\u0000\u0000\u0000\u0000\u0000\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0006\u0000c\u0000d\u0000 \r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u00100\u0000\fproject_path\u0000\u0000\u0006\u0000\u0000\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\n\u0000\u0018.ITRMWrtenull\u0000\u0000\u0000\u0010\u0000obj \u0001\u0000\u0000\u0006\u0000\u0000\u0003\u0000\n\u0000\u0004\niTxt\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000B\u0000g\u0000i\u0000t\u0000 \u0000c\u0000h\u0000e\u0000c\u0000k\u0000o\u0000u\u0000t\u0000 \u0000s\u0000t\u0000a\u0000r\u0000t\u0000-\u0000i\u0000t\u0000e\u0000r\u0000m\u0000-\u0000e\u0000n\u0000v\u0000.\u0000s\u0000c\u0000p\u0000t\u0006\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u00011\u0000\u0000\u0000\u0000\n\u0000\u0004\nCssn\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000A\u0000\u0001o\u0000\u0000\u0000,\u0000-\u000b\u0000\u00110\u0000\rtrak_terminal\u0000\u0000\u0002\u0000?\u0000\u0002\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000%\u0000\u0001m\u0000\u0000\u0000\u0018\u0000\u0019\u0000\u000f\u0000\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000ITRM\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001H\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0018H+\u0000\u0000\u00073\tiTerm.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\n=F\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fApplications\u0000\u0010\u0000\b\u0000\u0000\u0018\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000F\u0000\u0000\u0000\u0001\u0000\u0004\u00073\u0000\u0002\u0000$Macintosh HD:Applications:\u0000iTerm.app\u0000\u000e\u0000\u0014\u0000\t\u0000i\u0000T\u0000e\u0000r\u0000m\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000\u0016Applications\/iTerm.app\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0003\u0000\u0000\u0001\u0000\u0000\u0010\u0000\u0000\u0001\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000e\u0000\u0000\u0007\u0010\u0000\u0000\u0000\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0005\u0000\u0002\u0000\u0000\u0002\u0000\u000e\u0000\u0002\u0000\u0000\u0002\u0000\u0019\u0000\u0002\u0000\u0000\u0002\u0000\"\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000\u0000\u0000\u0010\u0000\u0000\u001f\u0000\u0017\u0000\u001e\u0000~}|{\u0000Izy\u0000Vxw\u0000^v\u0000c\u0000k\u0000x\u0000\u0000\u0000\u0000\u0000\n\u0000\u0018.earsffdralis\u0000\u0000\u0000\u0000\u0000\u0000 \u0000afdr\n\u0000\u0004\npsxp\u000b\u0000\u000f0\u0000\u000bscript_path\u0000\u0000\n\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\u000b\u0000\u00100\u0000\fproject_path\u0000\u0000\u000b\u0000\u00100\u0000\fproject_name\u0000\u0000\n\u0000\u0018.miscactvnull\u0000\u0000null\n\u0000\u0004\nkocl\n~\u0000\u0004\nPtrm\n}\u0000\u0018.corecrel****\u0000\u0000\u0000\u0000\u0000\u0000\u0000null\u000b|\u0000\u00110\u0000\rtrak_terminal\u0000\u0000\n{\u0000\u0004\nPssn\nz\u0000\u0018.ITRMLNCHPssn\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000obj \ny\u0000\u0004\nCssn\nx\u0000\u0004\npnam\nw\u0000\u0004\niTxt\nv\u0000\u0018.ITRMWrtenull\u0000\u0000\u0000\u0010\u0000obj \u0011\u0000)j\f\u0000\u0000,EO%j\f\u0000\u0004EOEO\u0012\u0000*j\f\u0000\tO*l\f\u0000\fEO\u0012\u0000*l\f\u0000\u0010O*a\u0000\u0011,\u0012\u0000'a\u0000\u0012%*a\u0000\u0013,FO*a\u0000\u0014a\u0000\u0015%l\f\u0000\u0016O*a\u0000\u0014a\u0000\u0017l\f\u0000\u0016UO*a\u0000\u0018l\f\u0000\u0010O*a\u0000\u0011,\u0012\u0000'a\u0000\u0019%*a\u0000\u0013,FO*a\u0000\u0014a\u0000\u001a%l\f\u0000\u0016O*a\u0000\u0014a\u0000\u001bl\f\u0000\u0016UO*a\u0000\u001cl\f\u0000\u0010O*a\u0000\u0011,\u0012\u0000#*a\u0000\u0013,FO*a\u0000\u0014a\u0000\u001d%l\f\u0000\u0016O*a\u0000\u0014a\u0000\u001el\f\u0000\u0016UOPUOPU\u000f\u0000ascr\u0000\u0001\u0000\r\u07ad","subject":"Change startup script to disgard its own changes on startup","message":"Change startup script to disgard its own changes on startup\n","lang":"AppleScript","license":"apache-2.0","repos":"trakio\/trak.io.js,trakio\/trak.io.js,trakio\/trak.io.js"}
{"commit":"9b1d578b45f6811b43803231985841a8cc865e5e","old_file":"km.scpt","new_file":"km.scpt","old_contents":"try\n\tget application id \"com.stairways.keyboardmaestro.engine\"\non error err_msg number err_num\n\treturn \"Keyboard Maestro not found. First install it and then use this workflow.\"\nend try\n\ntell application id \"com.stairways.keyboardmaestro.engine\"\n\tgethotkeys with asstring\nend tell\n","new_contents":"try\n\tget application id \"com.stairways.keyboardmaestro.engine\"\non error err_msg number err_num\n\treturn \"Keyboard Maestro not found. First install it and then use this workflow.\"\nend try\n\ntell application id \"com.stairways.keyboardmaestro.engine\"\n\tgethotkeys with asstring and getall\nend tell\n","subject":"Update script to get ALL macros instead of just hotkeyed macros.","message":"Update script to get ALL macros instead of just hotkeyed macros.\n","lang":"AppleScript","license":"mit","repos":"iansinnott\/alfred-maestro,iansinnott\/alfred-maestro"}
{"commit":"4181fd73b1a998202f6ce356a44b979ef7102f35","old_file":"source\/Reminders\/RemindersNewItem.applescript","new_file":"source\/Reminders\/RemindersNewItem.applescript","old_contents":"tell application \"Reminders\"\n\tactivate\n\tset theAccount to name of first account\n\ttell account theAccount\n\t\tset theList to name of first list\n\t\tset myReminder to (make new reminder at list theList with properties {name:\"{popclip text}\"})\n\tend tell\nend tell","new_contents":"on sortList(unsortedList)\n\tset oldDelimiters to AppleScript's text item delimiters\n\tset AppleScript's text item delimiters to (ASCII character 10)\n\tset sortedList to paragraphs of (do shell script \"echo \" & quoted form of (unsortedList as string) & \"| sort  -d -f\")\n\tset AppleScript's text item delimiters to oldDelimiters\n\treturn sortedList\nend sortList\n\n-- sort the list\ntell application \"Reminders\"\n\tactivate\n\tget the name of every account\n\tset theAccount to name of first account\n\ttell account theAccount\n\t\tset allLists to the name of every list\n\tend tell\nend tell\nset sortedList to sortList(allLists)\nset theList to first item of sortedList\n\ntell application \"Reminders\"\n\ttell account theAccount to set myReminder to (make new reminder at list theList with properties {name:\"{popclip text}\"})\nend tell","subject":"update Reminders to choose first list in alphabetical order","message":"update Reminders to choose first list in alphabetical order\n","lang":"AppleScript","license":"mit","repos":"dreki\/PopClip-Extensions,dreki\/PopClip-Extensions,onecrayon\/PopClip-Extensions,dreki\/PopClip-Extensions,chenruixuan\/PopClip-Extensions,dreki\/PopClip-Extensions,chenruixuan\/PopClip-Extensions,onecrayon\/PopClip-Extensions,onecrayon\/PopClip-Extensions,Kapeli\/PopClip-Extensions,chenruixuan\/PopClip-Extensions,chenruixuan\/PopClip-Extensions,dreki\/PopClip-Extensions,onecrayon\/PopClip-Extensions,a-b\/PopClip-Extensions,bopo\/PopClip-Extensions,Kapeli\/PopClip-Extensions,a-b\/PopClip-Extensions,dreki\/PopClip-Extensions,bopo\/PopClip-Extensions,bopo\/PopClip-Extensions,onecrayon\/PopClip-Extensions,Kapeli\/PopClip-Extensions,a-b\/PopClip-Extensions,Kapeli\/PopClip-Extensions,bopo\/PopClip-Extensions,a-b\/PopClip-Extensions,onecrayon\/PopClip-Extensions,a-b\/PopClip-Extensions,a-b\/PopClip-Extensions,chenruixuan\/PopClip-Extensions,Kapeli\/PopClip-Extensions,chenruixuan\/PopClip-Extensions,Kapeli\/PopClip-Extensions,bopo\/PopClip-Extensions,bopo\/PopClip-Extensions"}
{"commit":"a0ba90e349cb5bf9d38a68ae5ddd4ae4c0652cc6","old_file":"web-app\/webstart\/toolkits\/terminal.scpt","new_file":"web-app\/webstart\/toolkits\/terminal.scpt","old_contents":"on run argv\n    tell app \"Terminal\"\n        activate\n\t\tset custom title to \"CodeCanaan\"\n        set tab1 to do script item 1 of argv\n    end tell\nend run\n","new_contents":"on run argv\n    tell app \"Terminal\"\n        activate\n        set tab1 to do script item 1 of argv\n\t\ttell tab1 to set custom title to \"CodeCanaan\"\n    end tell\nend run\n","subject":"\u8a2d\u5b9a Mac Terminal Title","message":"\u8a2d\u5b9a Mac Terminal Title\n","lang":"AppleScript","license":"mit","repos":"codecanaan\/codecanaan,codecanaan\/codecanaan,codecanaan\/codecanaan,codecanaan\/codecanaan,codecanaan\/codecanaan,codecanaan\/codecanaan,codecanaan\/codecanaan"}
{"commit":"672818246de129e65ca44632fcf4e26dd90e2b04","old_file":"keynote.applescript","new_file":"keynote.applescript","old_contents":"on newPresentation(themeName)\n    tell application \"Keynote\"\n    \tactivate\n    \t-- set the chosenTheme to themeName\n\n\n    \tset targetWidth to 1024 -- 1440 <-- higher resolution\n    \tset targetHeight to 768 -- 1080 <-- higher resolution\n\n    \tset thisDocument to \u00ac\n    \t\tmake new document with properties \u00ac\n                {document theme:theme (themeName as string)}\n    \t\t\t--{document theme:theme (themeName as string), width:targetWidth, height:targetHeight}\n        return name of thisDocument\n    end tell\nend newPresentation\n\n\non createSlide(docname, masterSlideName, thisSlideTitle, thisSlideBody)\n\ttry\n\t\ttell application \"Keynote\"\n\t\t\ttell document named docname\n\t\t\t\tset thisSlide to make new slide with properties {base slide:master slide masterSlideName}\n\t\t\t\ttell thisSlide\n\t\t\t\t\t-- set the transition properties to {transition effect:dissolve, transition duration:defaultTransitionDuration, transition delay:defaultTransitionDelay, automatic transition:defaultAutomaticTransition}\n\t\t\t\t\tif title showing is true then\n\t\t\t\t\t\tset the object text of the default title item to thisSlideTitle\n\t\t\t\t\tend if\n\t\t\t\t\tif body showing is true then\n\t\t\t\t\t\tset the object text of the default body item to thisSlideBody\n\t\t\t\t\tend if\n\t\t\t\tend tell\n\t\t\tend tell\n      return thisSlide\n\t\tend tell\n\ton error\n\t\treturn 0\n\tend try\nend createSlide\n\non finalize(docname)\n\ttell application \"Keynote\"\n\t\ttell document named docname to delete slide 1\n    end tell\nend finalize\n\non themeMasters(docname)\n    --    tell application \"Keynote\" to get the name of every master slide of thisDocument\n\ttell application \"Keynote\"\n\t\tset names to the name of every master slide of document named docname\n        return names\n    end tell\nend themeMasters\n","new_contents":"on newPresentation(themeName)\n    tell application \"Keynote\"\n    \tactivate\n    \t-- set the chosenTheme to themeName\n\n\n    \tset targetWidth to 1024 -- 1440 <-- higher resolution\n    \tset targetHeight to 768 -- 1080 <-- higher resolution\n\n    \tset thisDocument to \u00ac\n    \t\tmake new document with properties \u00ac\n                {document theme:theme (themeName as string)}\n    \t\t\t--{document theme:theme (themeName as string), width:targetWidth, height:targetHeight}\n        return name of thisDocument\n    end tell\nend newPresentation\n\n\non createSlide(docname, masterSlideName, thisSlideTitle, thisSlideBody)\n\ttry\n\t\ttell application \"Keynote\"\n\t\t\ttell document named docname\n\t\t\t\tset thisSlide to make new slide with properties {base slide:master slide masterSlideName}\n\t\t\t\ttell thisSlide\n\t\t\t\t\t-- set the transition properties to {transition effect:dissolve, transition duration:defaultTransitionDuration, transition delay:defaultTransitionDelay, automatic transition:defaultAutomaticTransition}\n\t\t\t\t\tif title showing is true then\n\t\t\t\t\t\tset the object text of the default title item to thisSlideTitle\n\t\t\t\t\tend if\n\t\t\t\t\tif body showing is true then\n\t\t\t\t\t\tset the object text of the default body item to thisSlideBody\n\t\t\t\t\tend if\n\t\t\t\tend tell\n\t\t\tend tell\n      return thisSlide\n\t\tend tell\n\ton error\n\t\treturn 0\n\tend try\nend createSlide\n\non finalize(docname)\n\ttell application \"Keynote\"\n\t\ttell document named docname to delete slide 1\n    end tell\nend finalize\n\non themeMasters(docname)\n    --    tell application \"Keynote\" to get the name of every master slide of thisDocument\n\ttell application \"Keynote\"\n\t\tset names to the name of every master slide of document named docname\n        return names\n    end tell\nend themeMasters\n\non addImage(docname, filepath)\n  (*\n    FIXME: Use slide ID to adress slide instead of \"current slide\"\n  *)\n  tell application \"Keynote\"\n  \ttell document named docname\n  \t\ttell the current slide\n\t\t\t\n  \t\t\t-- TO REPLACE A PLACEHOLDER OR EXISTING IMAGE:\n  \t\t\tset thisPlaceholderImageItem to image 1\n  \t\t\t-- change the value of the \u201cfile name\u201d property of the image to be an HFS file reference to the replacement image file\n        set macPath to POSIX file filepath as Unicode text\n  \t\t\tset file name of thisPlaceholderImageItem to \u00ac\n  \t\t\t\talias macPath\n\t\t\t\n  \t\tend tell\n  \tend tell\n  end tell\nend addImage\n\n","subject":"Add an image to a slide (with an image placeholder)","message":"Add an image to a slide (with an image placeholder)\n","lang":"AppleScript","license":"mit","repos":"persquare\/md2keynote"}
{"commit":"980d32d60185b8cc2dd30108e582afe17da7d1bd","old_file":"connector-osx-kn.scpt","new_file":"connector-osx-kn.scpt","old_contents":"--\n--  slideshow -- Observe and Control Slideshow Applications\n--  Copyright (c) 2014 Ralf S. Engelschall <http:\/\/engelschall.com>\n--\n--  This Source Code Form is subject to the terms of the Mozilla Public\n--  License (MPL), version 2.0. If a copy of the MPL was not distributed\n--  with this file, You can obtain one at http:\/\/mozilla.org\/MPL\/2.0\/.\n--\n--  File:     connector-osx-kn.js\n--  Purpose:  connector engine for Apple Keynote 5 under Mac OS X\n--  Language: AppleScript\n--\n\n--  utility function\non filterText(this_text, allowed_chars)\n   set new_text to \"\"\n   repeat with this_char in this_text\n       set x to the offset of this_char in allowed_chars\n       if x is not 0 then\n           set new_text to (new_text & this_char) as string\n       end if\n   end repeat\n   return new_text\nend filterText\n\n--  utility function\non replaceText(this_text, search_string, replacement_string)\n   set AppleScript's text item delimiters to the search_string\n   set the item_list to every text item of this_text\n   set AppleScript's text item delimiters to the replacement_string\n   set this_text to the item_list as string\n   set AppleScript's text item delimiters to \"\"\n   return this_text\nend replace_chars\n\n--  utility function\non asciiCharset()\n    set charset to \" \\\"'!#$%()*+,-.\/:;<=>?@[\\\\]^_{|}~\"\n    set charset to (charset & \"0123456789\")\n    set charset to (charset & \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\")\n    set charset to (charset & \"abcdefghijklmnopqrstuvwxyz\")\n    return charset\nend asciiCharset\n\n--  get application state\non knGetState()\n    set state to \"closed\"\n    tell application \"System Events\"\n        set is_running to (exists (some process whose name is \"Keynote\"))\n    end tell\n    if is_running then\n       try\n            set state to \"running\"\n            tell application \"Keynote\"\n                if playing then\n                    set state to \"viewing\"\n                else if (get count of slides of front document) > 0 then\n                    set state to \"editing\"\n                end if\n            end tell\n        on error errMsg\n        end try\n    end if\n    return state\nend knGetState\n\n--  get Apple Keynote current slide\non knGetCurSlide()\n    try\n        tell application \"Keynote\"\n            if playing then\n                return (get slide number of current slide of front document)\n            else\n                return (get slide number of current slide of front document)\n            end if\n        end tell\n    on error errMsg\n        return 0\n    end try\nend knGetCurSlide\n\n--  get Apple Keynote maximum slide\non knGetMaxSlide()\n    try\n        tell application \"Keynote\"\n            return (get count of slides of front document)\n        end tell\n    on error errMsg\n        return 0\n    end try\nend knGetMaxSlide\n\n--  the STATE command\non cmdSTATE()\n    set state to knGetState()\n    if state is \"closed\" then\n        set position to 0\n        set slides to 0\n    else\n        set position to knGetCurSlide()\n        set slides to knGetMaxSlide()\n    end if\n    return (\"{ \\\"response\\\": { \" & \u00ac\n        \"\\\"state\\\": \\\"\" & state & \"\\\", \" & \u00ac\n        \"\\\"position\\\": \" & position & \", \" & \u00ac\n        \"\\\"slides\\\": \" & slides & \" \" & \u00ac\n    \"} }\")\nend cmdSTATE\n\n--  the INFO command\non cmdINFO()\n    set output to \"\"\n    if knGetMaxSlide() is 0 then\n        error \"still no active presentation\"\n    end if\n    tell application \"Keynote\"\n        set thePresentation to front document\n        set theTitles to \"\"\n        set theNotes to \"\"\n        set slideCount to (get count of slides of thePresentation)\n        repeat with slideNum from 1 to slideCount\n            set theSlide to slide slideNum of thePresentation\n\n            set theTitle to (title of theSlide) as string\n            if theTitles is not \"\" then\n                set theTitles to (theTitles & \", \")\n            end if\n            set theTitles to (theTitles & \"\\\"\" & (my replaceText(theTitle, \"\\\"\", \"\\\\\\\"\")) & \"\\\"\")\n\n            set theNote to (notes of theSlide) as string\n            set theNote to (my filterText(theNote, my asciiCharset()))\n            if theNotes is not \"\" then\n                set theNotes to (theNotes & \", \")\n            end if\n            set theNotes to (theNotes & \"\\\"\" & (my replaceText(theNote, \"\\\"\", \"\\\\\\\"\")) & \"\\\"\")\n\n        end repeat\n        set theTitles to (\"[ \" & theTitles & \" ]\")\n        set theNotes to (\"[ \" & theNotes & \" ]\")\n        set output to (\"{ \\\"response\\\": { \\\"titles\\\": \" & theTitles & \", \\\"notes\\\": \" & theNotes & \" } }\")\n    end tell\n    return output\nend cmdINFO\n\n--  the control commands\non cmdCTRL(command, arg)\n    set state to knGetState()\n    if command is \"BOOT\" then\n        if state is not \"closed\" then\n            error \"application already running\"\n        end if\n        tell application \"Keynote\"\n            activate\n        end tell\n    else if command is \"QUIT\" then\n        if state is \"closed\" then\n            error \"application already closed\"\n        end if\n        tell application \"Keynote\"\n            quit\n        end tell\n    else if command is \"OPEN\" then\n        if state is \"editing\" or state is \"viewing\" then\n            error \"active presentation already existing\"\n        end if\n        tell application \"Keynote\"\n            tell application \"Finder\" to set thePath to \u00ac\n                POSIX file (POSIX path of (container of (path to me) as string) & (arg)) as alias\n            open thePath\n        end tell\n    else if command is \"CLOSE\" then\n        if state is \"closed\" or state is \"running\" then\n            error \"still no active presentation\"\n        end if\n        tell application \"Keynote\"\n            close front document\n        end tell\n    else if command is \"START\" then\n        if state is \"closed\" or state is \"running\" then\n            error \"still no active presentation\"\n        end if\n        if state is \"viewing\" then\n            error \"active presentation already viewing\"\n        end if\n        tell application \"Keynote\"\n            start from (slide 1 of front document)\n        end tell\n    else if command is \"STOP\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            stop slideshow (slideshow 1)\n        end tell\n    else if command is \"PAUSE\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            activate\n            tell application \"System Events\" to keystroke \"b\"\n        end tell\n    else if command is \"RESUME\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            activate\n            tell application \"System Events\" to keystroke \"b\"\n        end tell\n    else if command is \"FIRST\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show (item 1 of slides of slideshow 1)\n        end tell\n    else if command is \"LAST\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show (item (get count of slides of slideshow 1) of slides of slideshow 1)\n        end tell\n    else if command is \"GOTO\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show (item (arg as integer) of slides of slideshow 1)\n        end tell\n    else if command is \"PREV\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show previous\n        end tell\n    else if command is \"NEXT\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show next\n        end tell\n    end if\n    return \"{ \\\"result\\\": \\\"OK\\\" }\"\nend cmdCTRL\n\n--  main procedure\non run argv\n    set cmd to item 1 of argv\n    set arg to \"\"\n    if count of argv is 2 then\n        set arg to item 2 of argv\n    end if\n    try\n        if cmd is \"STAT\" then\n            set output to cmdSTATE()\n        else if cmd is \"INFO\" then\n            set output to cmdINFO()\n        else if cmd is \"BOOT\" \u00ac\n            or cmd is \"QUIT\" \u00ac\n            or cmd is \"OPEN\" \u00ac\n            or cmd is \"CLOSE\" \u00ac\n            or cmd is \"START\" \u00ac\n            or cmd is \"STOP\" \u00ac\n            or cmd is \"PAUSE\" \u00ac\n            or cmd is \"RESUME\" \u00ac\n            or cmd is \"FIRST\" \u00ac\n            or cmd is \"LAST\" \u00ac\n            or cmd is \"GOTO\" \u00ac\n            or cmd is \"PREV\" \u00ac\n            or cmd is \"NEXT\" then\n            set output to cmdCTRL(cmd, arg)\n        else\n            set output to \"{ \\\"error\\\": \\\"invalid command\\\" }\"\n        end if\n    on error errMsg\n        set output to (\"{ \\\"error\\\": \\\"\" & errMsg & \"\\\" }\")\n    end try\n    copy output to stdout\nend run\n\n","new_contents":"--\n--  slideshow -- Observe and Control Slideshow Applications\n--  Copyright (c) 2014 Ralf S. Engelschall <http:\/\/engelschall.com>\n--\n--  This Source Code Form is subject to the terms of the Mozilla Public\n--  License (MPL), version 2.0. If a copy of the MPL was not distributed\n--  with this file, You can obtain one at http:\/\/mozilla.org\/MPL\/2.0\/.\n--\n--  File:     connector-osx-kn.js\n--  Purpose:  connector engine for Apple Keynote 5 under Mac OS X\n--  Language: AppleScript\n--\n\n--  utility function\non filterText(this_text, allowed_chars)\n   set new_text to \"\"\n   repeat with this_char in this_text\n       set x to the offset of this_char in allowed_chars\n       if x is not 0 then\n           set new_text to (new_text & this_char) as string\n       end if\n   end repeat\n   return new_text\nend filterText\n\n--  utility function\non replaceText(this_text, search_string, replacement_string)\n   set AppleScript's text item delimiters to the search_string\n   set the item_list to every text item of this_text\n   set AppleScript's text item delimiters to the replacement_string\n   set this_text to the item_list as string\n   set AppleScript's text item delimiters to \"\"\n   return this_text\nend replace_chars\n\n--  utility function\non asciiCharset()\n    set charset to \" \\\"'!#$%()*+,-.\/:;<=>?@[\\\\]^_{|}~\"\n    set charset to (charset & \"0123456789\")\n    set charset to (charset & \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\")\n    set charset to (charset & \"abcdefghijklmnopqrstuvwxyz\")\n    return charset\nend asciiCharset\n\n--  get application state\non knGetState()\n    set state to \"closed\"\n    tell application \"System Events\"\n        set is_running to (exists (some process whose name is \"Keynote\"))\n    end tell\n    if is_running then\n       try\n            set state to \"running\"\n            tell application \"Keynote\"\n                if playing then\n                    set state to \"viewing\"\n                else if (get count of slides of front document) > 0 then\n                    set state to \"editing\"\n                end if\n            end tell\n        on error errMsg\n        end try\n    end if\n    return state\nend knGetState\n\n--  get Apple Keynote current slide\non knGetCurSlide()\n    try\n        tell application \"Keynote\"\n            if playing then\n                return (get slide number of current slide of front document)\n            else\n                return (get slide number of current slide of front document)\n            end if\n        end tell\n    on error errMsg\n        return 0\n    end try\nend knGetCurSlide\n\n--  get Apple Keynote maximum slide\non knGetMaxSlide()\n    try\n        tell application \"Keynote\"\n            return (get count of slides of front document)\n        end tell\n    on error errMsg\n        return 0\n    end try\nend knGetMaxSlide\n\n--  the STATE command\non cmdSTATE()\n    set state to knGetState()\n    if state is \"closed\" then\n        set position to 0\n        set slides to 0\n    else\n        set position to knGetCurSlide()\n        set slides to knGetMaxSlide()\n    end if\n    return (\"{ \\\"response\\\": { \" & \u00ac\n        \"\\\"state\\\": \\\"\" & state & \"\\\", \" & \u00ac\n        \"\\\"position\\\": \" & position & \", \" & \u00ac\n        \"\\\"slides\\\": \" & slides & \" \" & \u00ac\n    \"} }\")\nend cmdSTATE\n\n--  the INFO command\non cmdINFO()\n    set output to \"\"\n    if knGetMaxSlide() is 0 then\n        error \"still no active presentation\"\n    end if\n    tell application \"Keynote\"\n        set thePresentation to front document\n        set theTitles to \"\"\n        set theNotes to \"\"\n        set slideCount to (get count of slides of thePresentation)\n        repeat with slideNum from 1 to slideCount\n            set theSlide to slide slideNum of thePresentation\n\n            set theTitle to (title of theSlide) as string\n            if theTitles is not \"\" then\n                set theTitles to (theTitles & \", \")\n            end if\n            set theTitles to (theTitles & \"\\\"\" & (my replaceText(theTitle, \"\\\"\", \"\\\\\\\"\")) & \"\\\"\")\n\n            set theNote to (notes of theSlide) as string\n            set theNote to (my filterText(theNote, my asciiCharset()))\n            if theNotes is not \"\" then\n                set theNotes to (theNotes & \", \")\n            end if\n            set theNotes to (theNotes & \"\\\"\" & (my replaceText(theNote, \"\\\"\", \"\\\\\\\"\")) & \"\\\"\")\n\n        end repeat\n        set theTitles to (\"[ \" & theTitles & \" ]\")\n        set theNotes to (\"[ \" & theNotes & \" ]\")\n        set output to (\"{ \\\"response\\\": { \\\"titles\\\": \" & theTitles & \", \\\"notes\\\": \" & theNotes & \" } }\")\n    end tell\n    return output\nend cmdINFO\n\n--  the control commands\non cmdCTRL(command, arg)\n    set state to knGetState()\n    if command is \"BOOT\" then\n        if state is not \"closed\" then\n            error \"application already running\"\n        end if\n        tell application \"Keynote\"\n            activate\n        end tell\n    else if command is \"QUIT\" then\n        if state is \"closed\" then\n            error \"application already closed\"\n        end if\n        tell application \"Keynote\"\n            quit\n        end tell\n    else if command is \"OPEN\" then\n        if state is \"editing\" or state is \"viewing\" then\n            error \"active presentation already existing\"\n        end if\n        tell application \"Keynote\"\n            tell application \"Finder\" to set thePath to \u00ac\n                POSIX file (POSIX path of (container of (path to me) as string) & (arg)) as alias\n            open thePath\n        end tell\n    else if command is \"CLOSE\" then\n        if state is \"closed\" or state is \"running\" then\n            error \"still no active presentation\"\n        end if\n        tell application \"Keynote\"\n            close front document\n        end tell\n    else if command is \"START\" then\n        if state is \"closed\" or state is \"running\" then\n            error \"still no active presentation\"\n        end if\n        if state is \"viewing\" then\n            error \"active presentation already viewing\"\n        end if\n        tell application \"Keynote\"\n            start from (slide 1 of front document)\n        end tell\n    else if command is \"STOP\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            stop slideshow (slideshow 1)\n        end tell\n    else if command is \"PAUSE\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            activate\n            tell application \"System Events\" to keystroke \"b\"\n        end tell\n    else if command is \"RESUME\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            activate\n            tell application \"System Events\" to keystroke \"b\"\n        end tell\n    else if command is \"FIRST\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show (item 1 of slides of slideshow 1)\n        end tell\n    else if command is \"LAST\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show (item (get count of slides of slideshow 1) of slides of slideshow 1)\n        end tell\n    else if command is \"GOTO\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show (item (arg as integer) of slides of slideshow 1)\n        end tell\n    else if command is \"PREV\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show previous\n        end tell\n    else if command is \"NEXT\" then\n        if state is not \"viewing\" then\n            error \"no active slideshow\"\n        end if\n        tell application \"Keynote\"\n            show next\n        end tell\n    end if\n    return \"{ \\\"response\\\": \\\"OK\\\" }\"\nend cmdCTRL\n\n--  main procedure\non run argv\n    set cmd to item 1 of argv\n    set arg to \"\"\n    if count of argv is 2 then\n        set arg to item 2 of argv\n    end if\n    try\n        if cmd is \"STAT\" then\n            set output to cmdSTATE()\n        else if cmd is \"INFO\" then\n            set output to cmdINFO()\n        else if cmd is \"BOOT\" \u00ac\n            or cmd is \"QUIT\" \u00ac\n            or cmd is \"OPEN\" \u00ac\n            or cmd is \"CLOSE\" \u00ac\n            or cmd is \"START\" \u00ac\n            or cmd is \"STOP\" \u00ac\n            or cmd is \"PAUSE\" \u00ac\n            or cmd is \"RESUME\" \u00ac\n            or cmd is \"FIRST\" \u00ac\n            or cmd is \"LAST\" \u00ac\n            or cmd is \"GOTO\" \u00ac\n            or cmd is \"PREV\" \u00ac\n            or cmd is \"NEXT\" then\n            set output to cmdCTRL(cmd, arg)\n        else\n            set output to \"{ \\\"error\\\": \\\"invalid command\\\" }\"\n        end if\n    on error errMsg\n        set output to (\"{ \\\"error\\\": \\\"\" & errMsg & \"\\\" }\")\n    end try\n    copy output to stdout\nend run\n\n","subject":"fix protocol","message":"fix protocol\n","lang":"AppleScript","license":"mpl-2.0","repos":"rse\/slideshow,rse\/slideshow"}
{"commit":"b9a768cd410115878d9321b838e81588fe587604","old_file":"yes.applescript","new_file":"yes.applescript","old_contents":"on run args\n\tif count of args is greater than 0\n\t\tset applescript's text item delimiters to \" \"\n\t\tset pn to (args as string)\n\t\trepeat \n\t\t\tlog pn\n\t\tend\n\telse\n\t\trepeat\n\t\t\tlog \"y\"\n\t\tend\n\tend\nend\n\n","new_contents":"#!\/usr\/bin\/osascript\n\non run args\n\tif count of args is greater than 0\n\t\tset applescript's text item delimiters to \" \"\n\t\tset pn to (args as string)\n\t\trepeat \n\t\t\tlog pn\n\t\tend\n\telse\n\t\trepeat\n\t\t\tlog \"y\"\n\t\tend\n\tend\nend\n\n","subject":"Add Shebang to Applescript","message":"Add Shebang to Applescript","lang":"AppleScript","license":"mit","repos":"mubaris\/yes,mubaris\/yes,mubaris\/yes,mubaris\/yes,mubaris\/yes,mubaris\/yes,mubaris\/yes,mubaris\/yes,mubaris\/yes,mubaris\/yes,mubaris\/yes,mubaris\/yes,mubaris\/yes,mubaris\/yes,mubaris\/yes,mubaris\/yes,mubaris\/yes,mubaris\/yes"}
{"commit":"d46b326a29da7d081e2bbd389bd8627927328f1c","old_file":"Extras\/GrowlTunes\/Scripts\/jackItunesArtwork.scpt","new_file":"Extras\/GrowlTunes\/Scripts\/jackItunesArtwork.scpt","old_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0002l\u0000\u0002\u0000\u0000\u0000H\u0000\u0007\r\u0000\u0007\u0000\u0003Q\u0000\u0000\u0000\u0000\u0000H\u0000\b\u0000\t\u0000\n\r\u0000\b\u0000\u0002O\u0000\u0000\u0000\u0003\u0000=\u0000\u000b\u0000\f\r\u0000\u000b\u0000\u0001k\u0000\u0000\u0000\u0007\u0000<\u0000\r\u0002\u0000\r\u0000\u0002\u0000\u000e\u0000\u000f\r\u0000\u000e\u0000\u0002r\u0000\u0000\u0000\u0007\u0000\n\u0000\u0010\u0000\u0011\r\u0000\u0010\u0000\u0001m\u0000\u0000\u0000\u0007\u0000\b\u0000\u0012\f\u0000\u0012\u0000\n\u0000\u0004fsck\u0000\u0002\u0000\u0000\r\u0000\u0011\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\u0002\u0000\u000f\u0000\u0002\u0000\u0013\u0000\u0014\r\u0000\u0013\u0000\u0002r\u0000\u0000\u0000\u000b\u0000\u0012\u0000\u0015\u0000\u0016\r\u0000\u0015\u0000\u0002n\u0000\u0000\u0000\u000b\u0000\u0010\u0000\u0017\u0000\u0018\r\u0000\u0017\u0000\u00011\u0000\u0000\u0000\u000e\u0000\u0010\n\u0000\u0004\npnam\r\u0000\u0018\u0000\u00011\u0000\u0000\u0000\u000b\u0000\u000e\n\u0000\u0004\npPla\r\u0000\u0016\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00140\u0000\balibrary\u0000\baLibrary\u0002\u0000\u0014\u0000\u0002\u0000\u0019\u0000\u001a\r\u0000\u0019\u0000\u0002r\u0000\u0000\u0000\u0013\u0000\u0018\u0000\u001b\u0000\u001c\r\u0000\u001b\u0000\u00011\u0000\u0000\u0000\u0013\u0000\u0016\n\u0000\u0004\npTrk\r\u0000\u001c\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00100\u0000\u0006atrack\u0000\u0006aTrack\u0002\u0000\u001a\u0000\u0002\u0000\u001d\u0000\u001e\r\u0000\u001d\u0000\u0002r\u0000\u0000\u0000\u0019\u0000\u001c\u0000\u001f\u0000 \r\u0000\u001f\u0000\u0001m\u0000\u0000\u0000\u0019\u0000\u001a\n\u0000\u0004\nnull\r\u0000 \u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001e0\u0000\ratrackartwork\u0000\raTrackArtwork\u0002\u0000\u001e\u0000\u0002\u0000!\u0000\"\r\u0000!\u0000\u0004Z\u0000\u0000\u0000\u001d\u00005\u0000#\u0000$\r\u0000#\u0000\u0002@\u0000\u0000\u0000\u001d\u0000&\u0000%\u0000&\r\u0000%\u0000\u0002l\u0000\u0005\u0000\u001d\u0000$\u0000'\r\u0000'\u0000\u0003I\u0000\u0001\u0000\u001d\u0000$\u0000(\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\r\u0000(\u0000\u0002n\u0000\u0000\u0000\u001d\u0000 \u0000)\u0000*\r\u0000)\u0000\u0001m\u0000\u0000\u0000\u001e\u0000 \n\u0000\u0004\ncArt\r\u0000*\u0000\u0001o\u0000\u0000\u0000\u001d\u0000\u001e\u000b\u0000\u00100\u0000\u0006atrack\u0000\u0006aTrack\u0002\u0000\u0000\u0001\u0000\u0000\r\u0000&\u0000\u0001m\u0000\u0000\u0000$\u0000%\u0003\u0000\u0001\r\u0000$\u0000\u0002r\u0000\u0000\u0000)\u00001\u0000+\u0000,\r\u0000+\u0000\u0002n\u0000\u0000\u0000)\u0000\/\u0000-\u0000.\r\u0000-\u0000\u00011\u0000\u0000\u0000-\u0000\/\n\u0000\u0004\npPCT\r\u0000.\u0000\u0002n\u0000\u0000\u0000)\u0000-\u0000\/\u00000\r\u0000\/\u0000\u00024\u0000\u0000\u0000*\u0000-\u00001\n\u0000\u0004\ncArt\r\u00001\u0000\u0001m\u0000\u0000\u0000+\u0000,\u0003\u0000\u0001\r\u00000\u0000\u0001o\u0000\u0000\u0000)\u0000*\u000b\u0000\u00100\u0000\u0006atrack\u0000\u0006aTrack\r\u0000,\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001e0\u0000\ratrackartwork\u0000\raTrackArtwork\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\"\u0000\u0002\u00002\r\u00002\u0000\u0002r\u0000\u0000\u00006\u0000<\u00003\u00004\r\u00003\u0000\u0001J\u0000\u0000\u00006\u0000:\u00005\u0002\u00005\u0000\u0002\u00006\u00007\r\u00006\u0000\u0001o\u0000\u0000\u00006\u00007\u000b\u0000\u001e0\u0000\ratrackartwork\u0000\raTrackArtwork\u0002\u00007\u0000\u0002\u00008\r\u00008\u0000\u0001o\u0000\u0000\u00007\u00008\u000b\u0000\u00140\u0000\balibrary\u0000\baLibrary\u0002\u0000\u0000\r\u00004\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\u0002\u0000\u0000\r\u0000\f\u0000\u0001m\u0000\u0000\u0000\u0003\u0000\u0004\u00009\u000f\u00009\u0001\bnull\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0000\u0005:\niTunes.app0\u00000\b\u00007\u0010`\u00002\u00000$\u0000\u0000\u0000)\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000e\u0002\u0002|(\u0007 \u07c0\u0000hook\u0000\u0000\u0011\u0000alis\u0000\u0000\u0000\u0000\u0001>\u0000\u0002\u0000\u0001\u0007Saulire\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000H+\u0000\u0000\u0000\u0000\u0005:\niTunes.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001#\/\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fApplications\u0000\u0010\u0000\b\u0000\u0000M\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0005:\u0000\u0002\u0000\u001fSaulire:Applications:iTunes.app\u0000\u0000\u000e\u0000\u0016\u0000\n\u0000i\u0000T\u0000u\u0000n\u0000e\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u0010\u0000\u0007\u0000S\u0000a\u0000u\u0000l\u0000i\u0000r\u0000e\u0000\u0012\u0000\u0017Applications\/iTunes.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\r\u0000\t\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000\n\u0000\u0002r\u0000\u0000\u0000E\u0000H\u0000:\u0000;\r\u0000:\u0000\u0001m\u0000\u0000\u0000E\u0000F\u0000<\f\u0000<\u0000\n\u0000\u0004fsck\u0000\u0002\u0000\u0000\r\u0000;\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\u0001\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000=\u0000>\r\u0000=\u0000\u0002l\u0000\u0002\u0000I\u0000K\u0000?\r\u0000?\u0000\u0001L\u0000\u0000\u0000I\u0000K\u0000@\r\u0000@\u0000\u0001o\u0000\u0000\u0000I\u0000J\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\u0001\u0000\u0000\u0002\u0000>\u0000\u0002\u0000A\r\u0000A\u0000\u0002l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0003\u0000B\u0000C\u0001\u0000\u0000\u0010\u0000B\u0000\u0001\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000e\u0000C\u0000\u0007\u0010\u0000D\u0000E\u0000F\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000D\u0000\u0001k\u0000\u0000\u0000\u0000\u0000K\u0000G\u0002\u0000G\u0000\u0002\u0000\u0005\u0000H\u0002\u0000H\u0000\u0002\u0000=\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000E\u0000\u0000\u0010\u0000F\u0000\u0010\u00009\u0000\u0012\u0000<\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\n\u0000\u0004\npPla\n\u0000\u0004\npnam\u000b\u0000\u00140\u0000\balibrary\u0000\baLibrary\n\u0000\u0004\npTrk\u000b\u0000\u00100\u0000\u0006atrack\u0000\u0006aTrack\n\u0000\u0004\nnull\u000b\u0000\u001e0\u0000\ratrackartwork\u0000\raTrackArtwork\n\u0000\u0004\ncArt\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\n\u0000\u0004\npPCT\u0001\u0000\u0000\u0002\u0000\u0000\u0011\u0000L\u0014\u0000?\u0012\u00007EO*,,EO*,EOEO,j\f\u0000\u000bk\u0003\u001d\u0000\rk\/,EY\u0000\u0003hOlvEUW\u0000\nX\u0000\r\u0000\u000eEO\u000f\u000fascr\u0000\u0001\u0000\f\u07ad","new_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0003l\u0000\u0002\u0000\u0000\u0000H\u0000\u0007\r\u0000\u0007\u0000\u0003Q\u0000\u0000\u0000\u0000\u0000H\u0000\b\u0000\t\u0000\n\r\u0000\b\u0000\u0002O\u0000\u0000\u0000\u0003\u0000=\u0000\u000b\u0000\f\r\u0000\u000b\u0000\u0001k\u0000\u0000\u0000\u0007\u0000<\u0000\r\u0002\u0000\r\u0000\u0002\u0000\u000e\u0000\u000f\r\u0000\u000e\u0000\u0002r\u0000\u0000\u0000\u0007\u0000\n\u0000\u0010\u0000\u0011\r\u0000\u0010\u0000\u0001m\u0000\u0000\u0000\u0007\u0000\b\u0000\u0012\u000e\u0000\u0012\u0000\u0001\u0000\u0013\u0011\u0000\u0013\u0000\b\u0000f\u0000s\u0000c\u0000k\r\u0000\u0011\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\u0002\u0000\u000f\u0000\u0002\u0000\u0014\u0000\u0015\r\u0000\u0014\u0000\u0002r\u0000\u0000\u0000\u000b\u0000\u0012\u0000\u0016\u0000\u0017\r\u0000\u0016\u0000\u0002n\u0000\u0000\u0000\u000b\u0000\u0010\u0000\u0018\u0000\u0019\r\u0000\u0018\u0000\u00011\u0000\u0000\u0000\u000e\u0000\u0010\n\u0000\u0004\npnam\r\u0000\u0019\u0000\u00011\u0000\u0000\u0000\u000b\u0000\u000e\n\u0000\u0004\npPla\r\u0000\u0017\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00140\u0000\balibrary\u0000\baLibrary\u0002\u0000\u0015\u0000\u0002\u0000\u001a\u0000\u001b\r\u0000\u001a\u0000\u0002r\u0000\u0000\u0000\u0013\u0000\u0018\u0000\u001c\u0000\u001d\r\u0000\u001c\u0000\u00011\u0000\u0000\u0000\u0013\u0000\u0016\n\u0000\u0004\npTrk\r\u0000\u001d\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00100\u0000\u0006atrack\u0000\u0006aTrack\u0002\u0000\u001b\u0000\u0002\u0000\u001e\u0000\u001f\r\u0000\u001e\u0000\u0002r\u0000\u0000\u0000\u0019\u0000\u001c\u0000 \u0000!\r\u0000 \u0000\u0001m\u0000\u0000\u0000\u0019\u0000\u001a\n\u0000\u0004\nnull\r\u0000!\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001e0\u0000\ratrackartwork\u0000\raTrackArtwork\u0002\u0000\u001f\u0000\u0002\u0000\"\u0000#\r\u0000\"\u0000\u0004Z\u0000\u0000\u0000\u001d\u00005\u0000$\u0000%\r\u0000$\u0000\u0002@\u0000\u0000\u0000\u001d\u0000&\u0000&\u0000'\r\u0000&\u0000\u0003l\u0000\u0005\u0000\u001d\u0000$\u0000(\r\u0000(\u0000\u0003I\u0000\u0001\u0000\u001d\u0000$\u0000)\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\r\u0000)\u0000\u0002n\u0000\u0000\u0000\u001d\u0000 \u0000*\u0000+\r\u0000*\u0000\u0001m\u0000\u0000\u0000\u001e\u0000 \n\u0000\u0004\ncArt\r\u0000+\u0000\u0001o\u0000\u0000\u0000\u001d\u0000\u001e\u000b\u0000\u00100\u0000\u0006atrack\u0000\u0006aTrack\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000'\u0000\u0001m\u0000\u0000\u0000$\u0000%\u0003\u0000\u0001\r\u0000%\u0000\u0002r\u0000\u0000\u0000)\u00001\u0000,\u0000-\r\u0000,\u0000\u0002n\u0000\u0000\u0000)\u0000\/\u0000.\u0000\/\r\u0000.\u0000\u00011\u0000\u0000\u0000-\u0000\/\n\u0000\u0004\npRaw\r\u0000\/\u0000\u0002n\u0000\u0000\u0000)\u0000-\u00000\u00001\r\u00000\u0000\u00024\u0000\u0000\u0000*\u0000-\u00002\n\u0000\u0004\ncArt\r\u00002\u0000\u0001m\u0000\u0000\u0000+\u0000,\u0003\u0000\u0001\r\u00001\u0000\u0001o\u0000\u0000\u0000)\u0000*\u000b\u0000\u00100\u0000\u0006atrack\u0000\u0006aTrack\r\u0000-\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001e0\u0000\ratrackartwork\u0000\raTrackArtwork\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000#\u0000\u0002\u00003\r\u00003\u0000\u0002r\u0000\u0000\u00006\u0000<\u00004\u00005\r\u00004\u0000\u0001J\u0000\u0000\u00006\u0000:\u00006\u0002\u00006\u0000\u0002\u00007\u00008\r\u00007\u0000\u0001o\u0000\u0000\u00006\u00007\u000b\u0000\u001e0\u0000\ratrackartwork\u0000\raTrackArtwork\u0002\u00008\u0000\u0002\u00009\r\u00009\u0000\u0001o\u0000\u0000\u00007\u00008\u000b\u0000\u00140\u0000\balibrary\u0000\baLibrary\u0002\u0000\u0000\r\u00005\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\u0002\u0000\u0000\r\u0000\f\u0000\u0001m\u0000\u0000\u0000\u0003\u0000\u0004\u0000:\u000f\u0000:\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000hook\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001L\u0000\u0002\u0000\u0001\fSnow-Leopard\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u01ba8H+\u0000\u0000\u0000\u0000\u0001\niTunes.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002u\u0180*\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fApplications\u0000\u0010\u0000\b\u0000\u0000\u01bb\f\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u0181M\u0000\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0001\u0000\u0002\u0000$Snow-Leopard:Applications:iTunes.app\u0000\u000e\u0000\u0016\u0000\n\u0000i\u0000T\u0000u\u0000n\u0000e\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000S\u0000n\u0000o\u0000w\u0000-\u0000L\u0000e\u0000o\u0000p\u0000a\u0000r\u0000d\u0000\u0012\u0000\u0017Applications\/iTunes.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\r\u0000\t\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000\n\u0000\u0002r\u0000\u0000\u0000E\u0000H\u0000;\u0000<\r\u0000;\u0000\u0001m\u0000\u0000\u0000E\u0000F\u0000=\u000e\u0000=\u0000\u0001\u0000>\u0011\u0000>\u0000\b\u0000f\u0000s\u0000c\u0000k\r\u0000<\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000?\u0000@\r\u0000?\u0000\u0003l\u0000\u0002\u0000I\u0000K\u0000A\r\u0000A\u0000\u0001L\u0000\u0000\u0000I\u0000K\u0000B\r\u0000B\u0000\u0001o\u0000\u0000\u0000I\u0000J\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000@\u0000\u0002\u0000C\r\u0000C\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0003\u0000D\u0000E\u0001\u0000\u0000\u0010\u0000D\u0000\u0001\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000e\u0000E\u0000\u0007\u0010\u0000F\u0000G\u0000H\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000F\u0000\u0001k\u0000\u0000\u0000\u0000\u0000K\u0000I\u0002\u0000I\u0000\u0002\u0000\u0005\u0000J\u0002\u0000J\u0000\u0002\u0000?\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000G\u0000\u0000\u0010\u0000H\u0000\u0010\u0000:\u0000\u0012\u0000=\u000b\u0000\u001a0\u0000\u000breturnvalue\u0000\u000breturnValue\n\u0000\u0004\npPla\n\u0000\u0004\npnam\u000b\u0000\u00140\u0000\balibrary\u0000\baLibrary\n\u0000\u0004\npTrk\u000b\u0000\u00100\u0000\u0006atrack\u0000\u0006aTrack\n\u0000\u0004\nnull\u000b\u0000\u001e0\u0000\ratrackartwork\u0000\raTrackArtwork\n\u0000\u0004\ncArt\n\u0000\u0018.corecnte****\u0000\u0000\u0000\u0000\u0000\u0000\u0010\u0000****\n\u0000\u0004\npRaw\u0001\u0000\u0000\u0002\u0000\u0000\u0011\u0000L\u0014\u0000?\u0012\u00007EO*,,EO*,EOEO,j\f\u0000\u000bk\u0003\u001d\u0000\rk\/,EY\u0000\u0003hOlvEUW\u0000\nX\u0000\r\u0000\u000eEO\u000f\u000fascr\u0000\u0001\u0000\f\u07ad","subject":"Fix #114: GrowlTunes hanging if pictd has died.","message":"Fix #114: GrowlTunes hanging if pictd has died.\n\nAs noted in the ticket, the fix here is to ask for the raw data, not the PICT data, for the artwork.\n","lang":"AppleScript","license":"bsd-3-clause","repos":"doshinirav\/doshinirav-myversion,doshinirav\/doshinirav-myversion,CarlosCD\/growl,Shalaco\/shalzers-growl,doshinirav\/doshinirav-myversion,Shalaco\/shalzers-growl,Shalaco\/shalzers-growl,Shalaco\/shalzers-growl,Shalaco\/shalzers-growl,Shalaco\/shalzers-growl,Shalaco\/shalzers-growl,Shalaco\/shalzers-growl,coltonfisher\/coltonfisher-growl,CarlosCD\/growl,CarlosCD\/growl,coltonfisher\/coltonfisher-growl,CarlosCD\/growl,doshinirav\/doshinirav-myversion,Shalaco\/shalzers-growl,doshinirav\/doshinirav-myversion,Shalaco\/shalzers-growl,Shalaco\/shalzers-growl,coltonfisher\/coltonfisher-growl,doshinirav\/doshinirav-myversion,CarlosCD\/growl,coltonfisher\/coltonfisher-growl,CarlosCD\/growl,doshinirav\/doshinirav-myversion,coltonfisher\/coltonfisher-growl,coltonfisher\/coltonfisher-growl,coltonfisher\/coltonfisher-growl,CarlosCD\/growl"}
{"commit":"42da0f6e0519ede64d926ae9b809384c45e1f1b5","old_file":"QuickStats\/QuickStats.applescript","new_file":"QuickStats\/QuickStats.applescript","old_contents":"property pTitle : \"OmniFocus: Quick Stats\"\nproperty pVersion : \"2.07.brett\"\n\nproperty pstrDBPath : \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/com.omnigroup.OmniFocus\/OmniFocusDatabase2\"\nproperty pstrMinOSX : \"10.9\"\n\nproperty pTimeOut : 20\n\n-- Original version: https:\/\/github.com\/RobTrew\/tree-tools\/blob\/master\/OmniFocus%20scripts\/Statistics\/QuickStats.applescript\n\n-- Copyright  2012, 2013, 2014 Robin Trew\n-- \n-- Permission is hereby granted, free of charge, \n-- to any person obtaining a copy of this software \n-- and associated documentation files (the \"Software\"), \n-- to deal in the Software without restriction, \n-- including without limitation the rights to use, copy, \n-- modify, merge, publish, distribute, sublicense, \n-- and\/or sell copies of the Software, and to permit persons \n-- to whom the Software is furnished to do so, \n-- subject to the following conditions:\n-- \n-- *******\n-- The above copyright notice and this permission notice \n-- shall be included in ALL copies \n-- or substantial portions of the Software.\n-- *******\n-- \n-- THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, \n-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES \n-- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \n-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \n-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, \n-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE \n-- OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n-- Ver 0.8 adds clipboard option to dialogue\n-- Ver 0.9 gives an error message if the cache schema has changed, leading to an SQL error in the script\n-- Ver 1.0 slight simplification of the code\n-- Ver 1.1 added count of Pending projects\n-- Ver 1.2 added a count of available actions\n-- Ver 1.3 added a break-down of unavailable actions\n-- Ver 1.4 added count of Current projects to complement Pending projects\n-- ver 1.5 replaced Applescript time function with SQL time expression\n-- Ver 1.7 Reorganizes menu, and attempts to enable access for .macappstore installations of OF\n--Ver 1.8 Adjusts handling of variant bundle identifiers generally\n-- Ver 2.00 Redraft of task breakdown, with progressive narrowing of criteria ...\n\nproperty pToClipboard : \"Copy list to clipboard\"\n\nif not FileExists(pstrDBPath) then set pstrDBPath to GetCachePath()\n\ntell application \"Finder\"\n\tif (version < pstrMinOSX) then\n\t\tdisplay dialog \"This script requires OSX \" & pstrMinOSX & \" or higher\" buttons {\"OK\"} default button 1 with title pTitle & \"Ver. \" & pVersion\n\t\treturn\n\tend if\n\n\tset screen_resolution to bounds of window of desktop\n\tset height to item 4 of screen_resolution\n\tif height < 900 then\n\t\tset brief to true\n\telse\n\t\tset brief to false\n\tend if\nend tell\n\nif pstrDBPath  \"\" then\n\tset inbox_cmd to \"\n\tselect 'INBOX GROUPS & ACTIONS', count(*) from task where (inInbox=1);\n\tselect '    Inbox action groups', count(*) from task where (inInbox=1) and (childrenCount>0);\n\tselect '    Inbox actions', count(*) from task where (inInbox=1) and (childrenCount=0);\n\tselect null;\n\t\"\n\tset folders_cmd to \"\n\tselect 'FOLDERS'\t, count(*) from folder;\n\tselect '    Active folders', count(*) from folder where effectiveActive=1;\n\tselect '    Dropped folders', count(*) from folder where effectiveActive=0;\n\tselect null;\n\t\"\n\tset projects_cmd to \"\n\tselect 'PROJECTS', count(*) from projectInfo where containsSingletonActions=0;\n\tselect '    Active projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='active');\n\tselect '            Current projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart is null or t.dateToStart < (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '            Pending projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart > (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '    On-hold projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='inactive');\n\tselect '    Completed projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='done');\n\tselect '    Dropped projects', count(*) from projectInfo where (containsSingletonActions=0) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset lists_cmd to \"\n\tselect 'SINGLE ACTION LISTS', count(*) from projectInfo where containsSingletonActions=1;\n\tselect '    Active single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='active');\n\tselect '    On-hold single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='inactive');\n\tselect '    Completed single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='done');\n\tselect '    Dropped single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset contexts_cmd to \"\n\tselect 'CONTEXTS', count(*) from context;\n\tselect '    Active contexts', count(*) from context where (effectiveActive=1) and (allowsNextAction=1);\n\tselect '    On-hold contexts', count(*) from context where (effectiveActive=1) and allowsNextAction=0;\n\tselect '    Dropped contexts', count(*) from context where effectiveActive=0;\n\tselect null;\n\t\"\n\tset groups_cmd to \"\n\tselect 'ACTION GROUPS', count(*) from task where (projectinfo is null) and (childrenCount>0);\n\tselect '    Remaining action groups', count(*) from task where (projectinfo is null) and (dateCompleted is null) and (childrenCount>0);\n\tselect '    Completed action groups', count(dateCompleted) from task where (projectinfo is null) and (childrenCount>0);\n\tselect null;\n\t\"\n\tset tasks_cmd to \"\n\tselect 'ALL TASKS', count(*) from task;\n\tselect null;\n\t\"\n\tset actions_cmd to \"\n\tselect 'ACTIONS', count(*) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Completed actions', count(dateCompleted) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Dropped project actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp where (projectinfo is null) and (childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is not null and (tp.status='dropped' or tp.folderEffectiveActive=0));\n\tselect '    Dropped context actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand c.effectiveActive= 0;\n\tselect '    Remaining actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1);\n\tselect '        Actions in Projects on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is not null and tp.status='inactive');\n\tselect '        Actions in Contexts on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is not null and c.allowsNextAction=0);\n\tselect '        Blocked actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1;\n\tselect '        \tBlocked by future start date', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=1;\n\tselect '        \tSequentially blocked', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=0;\n\tselect '        Available actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=0;\n\tselect null;\n\t\"\n\tset summary_cmd to \"\n\tselect 'SUMMARY';\n\tselect '    Inbox available actions', count(*) from task where (inInbox=1) and (dateCompleted is null);\n\tselect '    Due in next week', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01');\n\tselect '    Flagged projects and actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand tp.effectiveFlagged;\n\tselect '    Due or Flagged', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand (tp.effectiveFlagged or (effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01')));\n\tselect null;\n\t\"\n\tif brief then\n\t\tset commands to projects_cmd & lists_cmd & contexts_cmd & groups_cmd & actions_cmd & summary_cmd\n\telse\n\t\tset commands to inbox_cmd & folders_cmd & projects_cmd & lists_cmd & contexts_cmd & groups_cmd & actions_cmd & tasks_cmd & summary_cmd\n\tend if\n\tset strCmd to \"sqlite3 -separator ': ' \\\"\" & pstrDBPath & \"\\\" \" & quoted form of (commands)\n\t\n\t-- \t\ttry\n\tset strList to do shell script strCmd\n\t-- \t\ton error\n\t-- \t\t\tdisplay dialog \"The SQL schema for the OmniFocus cache may have changed in a recent update of OF.\" & return & return & \n\t-- \t\t\t\t\"Look on the OmniFocus user forums for an updated version of this script.\" buttons {\"OK\"} with title pTitle & \"Ver. \" & pVersion\n\t-- \t\t\treturn\n\t-- \t\tend try\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tif button returned of (display dialog strList buttons {pToClipboard, \"OK\"} default button \"OK\" giving up after pTimeOut with title pTitle & \" Ver. \" & pVersion) \n\t\t\tis pToClipboard then tell application id \"com.apple.finder\" to set the clipboard to strList\n\tend tell\nelse\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tdisplay dialog \"OmniFocus cache not found ...\" buttons {\"OK\"} default button 1 with title pTitle & \" Ver. \" & pVersion\n\tend tell\nend if\n\n\non FileExists(strPath)\n\t(do shell script \"test -e \" & strPath & \" ; echo $?\") = \"0\"\nend FileExists\n\non GetCachePath()\n\ttry\n\t\ttell application \"Finder\" to tell (application file id \"OFOC\") to \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/\" & its id & \"\/OmniFocusDatabase2\"\n\ton error\n\t\terror \"OmniFocus not installed ...\"\n\tend try\nend GetCachePath\n\n","new_contents":"property pTitle : \"OmniFocus: Quick Stats\"\nproperty pVersion : \"2.07.brett\"\n\nproperty pstrDBPath : \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/com.omnigroup.OmniFocus\/OmniFocusDatabase2\"\nproperty pstrMinOSX : \"10.9\"\n\nproperty pTimeOut : 30\n\n-- Original version: https:\/\/github.com\/RobTrew\/tree-tools\/blob\/master\/OmniFocus%20scripts\/Statistics\/QuickStats.applescript\n\n-- Copyright  2012, 2013, 2014 Robin Trew\n-- \n-- Permission is hereby granted, free of charge, \n-- to any person obtaining a copy of this software \n-- and associated documentation files (the \"Software\"), \n-- to deal in the Software without restriction, \n-- including without limitation the rights to use, copy, \n-- modify, merge, publish, distribute, sublicense, \n-- and\/or sell copies of the Software, and to permit persons \n-- to whom the Software is furnished to do so, \n-- subject to the following conditions:\n-- \n-- *******\n-- The above copyright notice and this permission notice \n-- shall be included in ALL copies \n-- or substantial portions of the Software.\n-- *******\n-- \n-- THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, \n-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES \n-- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \n-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \n-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, \n-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE \n-- OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n-- Ver 0.8 adds clipboard option to dialogue\n-- Ver 0.9 gives an error message if the cache schema has changed, leading to an SQL error in the script\n-- Ver 1.0 slight simplification of the code\n-- Ver 1.1 added count of Pending projects\n-- Ver 1.2 added a count of available actions\n-- Ver 1.3 added a break-down of unavailable actions\n-- Ver 1.4 added count of Current projects to complement Pending projects\n-- ver 1.5 replaced Applescript time function with SQL time expression\n-- Ver 1.7 Reorganizes menu, and attempts to enable access for .macappstore installations of OF\n--Ver 1.8 Adjusts handling of variant bundle identifiers generally\n-- Ver 2.00 Redraft of task breakdown, with progressive narrowing of criteria ...\n\nproperty pToClipboard : \"Copy list to clipboard\"\n\nif not FileExists(pstrDBPath) then set pstrDBPath to GetCachePath()\n\ntell application \"Finder\"\n\tif (version < pstrMinOSX) then\n\t\tdisplay dialog \"This script requires OSX \" & pstrMinOSX & \" or higher\" buttons {\"OK\"} default button 1 with title pTitle & \"Ver. \" & pVersion\n\t\treturn\n\tend if\n\n\tset screen_resolution to bounds of window of desktop\n\tset height to item 4 of screen_resolution\n\tif height < 900 then\n\t\tset brief to true\n\telse\n\t\tset brief to false\n\tend if\nend tell\n\nif pstrDBPath  \"\" then\n\tset inbox_cmd to \"\n\tselect 'INBOX GROUPS & ACTIONS', count(*) from task where (inInbox=1);\n\tselect '    Inbox action groups', count(*) from task where (inInbox=1) and (childrenCount>0);\n\tselect '    Inbox actions', count(*) from task where (inInbox=1) and (childrenCount=0);\n\tselect null;\n\t\"\n\tset folders_cmd to \"\n\tselect 'FOLDERS'\t, count(*) from folder;\n\tselect '    Active folders', count(*) from folder where effectiveActive=1;\n\tselect '    Dropped folders', count(*) from folder where effectiveActive=0;\n\tselect null;\n\t\"\n\tset projects_cmd to \"\n\tselect 'PROJECTS', count(*) from projectInfo where containsSingletonActions=0;\n\tselect '    Active projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='active');\n\tselect '            Current projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart is null or t.dateToStart < (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '            Pending projects', count(*) from projectInfo p join task t on t.projectinfo=p.pk where (p.containsSingletonActions=0) and (p.folderEffectiveActive=1) and (p.status='active') and (t.dateToStart > (strftime('%s','now') - strftime('%s','2001-01-01')));\n\tselect '    On-hold projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='inactive');\n\tselect '    Completed projects', count(*) from projectInfo where (containsSingletonActions=0) and (status='done');\n\tselect '    Dropped projects', count(*) from projectInfo where (containsSingletonActions=0) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset lists_cmd to \"\n\tselect 'SINGLE ACTION LISTS', count(*) from projectInfo where containsSingletonActions=1;\n\tselect '    Active single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='active');\n\tselect '    On-hold single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='inactive');\n\tselect '    Completed single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (status='done');\n\tselect '    Dropped single action lists', count(*) from projectInfo where (containsSingletonActions=1) and (( status='dropped') or (folderEffectiveActive=0));\n\tselect null;\n\t\"\n\tset contexts_cmd to \"\n\tselect 'CONTEXTS', count(*) from context;\n\tselect '    Active contexts', count(*) from context where (effectiveActive=1) and (allowsNextAction=1);\n\tselect '    On-hold contexts', count(*) from context where (effectiveActive=1) and allowsNextAction=0;\n\tselect '    Dropped contexts', count(*) from context where effectiveActive=0;\n\tselect null;\n\t\"\n\tset groups_cmd to \"\n\tselect 'ACTION GROUPS', count(*) from task where (projectinfo is null) and (childrenCount>0);\n\tselect '    Remaining action groups', count(*) from task where (projectinfo is null) and (dateCompleted is null) and (childrenCount>0);\n\tselect '    Completed action groups', count(dateCompleted) from task where (projectinfo is null) and (childrenCount>0);\n\tselect null;\n\t\"\n\tset tasks_cmd to \"\n\tselect 'ALL TASKS', count(*) from task;\n\tselect null;\n\t\"\n\tset actions_cmd to \"\n\tselect 'ACTIONS', count(*) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Completed actions', count(dateCompleted) from task where (projectinfo is null) and (childrenCount=0);\n\tselect '    Dropped project actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp where (projectinfo is null) and (childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is not null and (tp.status='dropped' or tp.folderEffectiveActive=0));\n\tselect '    Dropped context actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand c.effectiveActive= 0;\n\tselect '    Remaining actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1);\n\tselect '        Actions in Projects on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is not null and tp.status='inactive');\n\tselect '        Actions in Contexts on hold', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is not null and c.allowsNextAction=0);\n\tselect '        Blocked actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1;\n\tselect '        \tBlocked by future start date', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=1;\n\tselect '        \tSequentially blocked', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=1\n\t\t\t\tand tp.blockedByFutureStartDate=0;\n\tselect '        Available actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (projectinfo is null) and (tp.childrenCount=0)  and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.context is null or c.effectiveActive= 1)\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand (tp.context is null or c.allowsNextAction=1)\n\t\t\t\tand tp.blocked=0;\n\tselect null;\n\t\"\n\tset summary_cmd to \"\n\tselect 'SUMMARY';\n\tselect '    Inbox available actions', count(*) from task where (inInbox=1) and (dateCompleted is null);\n\tselect '    Due in next week', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null) \n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01');\n\tselect '    Flagged projects and actions', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand tp.effectiveFlagged;\n\tselect '    Due or Flagged', count(*) from (task t left join projectinfo p on t.containingProjectinfo=p.pk) tp left join context c on tp.context=c.persistentIdentifier where (((projectinfo is null) and (tp.childrenCount=0))  or containsSingletonActions=0) and (dateCompleted is null)\n\t\t\t\tand (tp.containingProjectinfo is null or (tp.status !='dropped' and tp.folderEffectiveActive=1))\n\t\t\t\tand (tp.containingProjectInfo is null or tp.status!='inactive')\n\t\t\t\tand tp.blockedByFutureStartDate=0\n\t\t\t\tand (tp.effectiveFlagged or (effectiveDateDue <= strftime('%s','now','+7 days') - strftime('%s','2001-01-01')));\n\tselect null;\n\t\"\n\tif brief then\n\t\tset commands to projects_cmd & lists_cmd & contexts_cmd & groups_cmd & actions_cmd & summary_cmd\n\telse\n\t\tset commands to inbox_cmd & folders_cmd & projects_cmd & lists_cmd & contexts_cmd & groups_cmd & actions_cmd & tasks_cmd & summary_cmd\n\tend if\n\tset strCmd to \"sqlite3 -separator ': ' \\\"\" & pstrDBPath & \"\\\" \" & quoted form of (commands)\n\t\n\t-- \t\ttry\n\tset strList to do shell script strCmd\n\t-- \t\ton error\n\t-- \t\t\tdisplay dialog \"The SQL schema for the OmniFocus cache may have changed in a recent update of OF.\" & return & return & \n\t-- \t\t\t\t\"Look on the OmniFocus user forums for an updated version of this script.\" buttons {\"OK\"} with title pTitle & \"Ver. \" & pVersion\n\t-- \t\t\treturn\n\t-- \t\tend try\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tif button returned of (display dialog strList buttons {pToClipboard, \"OK\"} default button \"OK\" giving up after pTimeOut with title pTitle & \" Ver. \" & pVersion) \n\t\t\tis pToClipboard then tell application id \"com.apple.finder\" to set the clipboard to strList\n\tend tell\nelse\n\ttell application id \"sevs\"\n\t\tactivate\n\t\tdisplay dialog \"OmniFocus cache not found ...\" buttons {\"OK\"} default button 1 with title pTitle & \" Ver. \" & pVersion\n\tend tell\nend if\n\n\non FileExists(strPath)\n\t(do shell script \"test -e \" & strPath & \" ; echo $?\") = \"0\"\nend FileExists\n\non GetCachePath()\n\ttry\n\t\ttell application \"Finder\" to tell (application file id \"OFOC\") to \"$HOME\/Library\/Containers\/com.omnigroup.OmniFocus2\/Data\/Library\/Caches\/\" & its id & \"\/OmniFocusDatabase2\"\n\ton error\n\t\terror \"OmniFocus not installed ...\"\n\tend try\nend GetCachePath\n\n","subject":"increase the timeout","message":"increase the timeout\n","lang":"AppleScript","license":"apache-2.0","repos":"brettporter\/omnifocus-tools"}
{"commit":"8914ac0a3ccf4e16e125c534c7164e4f9ffa43fc","old_file":"dated_deleter.scpt","new_file":"dated_deleter.scpt","old_contents":"-- stolen from: https:\/\/discussions.apple.com\/thread\/3172966\nproperty keyPhrase : \"Trashed on: \"\nproperty securityLevel : 2 -- overwrites: 1=1-pass, 2=7-pass, 3=35-pass,  see man srm\nproperty daysToWait : 7\n \ntell application \"Finder\"\n  -- get files in trash that are not new, and check dates\n          set oldFiles to (every item of trash whose comment contains keyPhrase)\n          set trashmeFiles to \"\"\n          repeat with thisFile in oldFiles\n  -- extract trashed date from the spotlight comments\n                    set trashedDate to last item of my tid(comment of thisFile, keyPhrase)\n                    try\n  -- check dates in a try block in case of weirdness)\n                              if my checkDate(trashedDate) then\n                                        log thisFile\n                                        set trashmeFiles to trashmeFiles & \" \" & my makePosix(thisFile as alias)\n                              end if\n                    end try\n          end repeat\n \n  -- trash 'em in a subroutine\n          my trashEm(trashmeFiles)\n \n  -- gather new files\n          set newFiles to every item of trash whose comment does not contain keyPhrase\n  -- add the current date to the spotlight comment of the new files\n          repeat with thisFile in newFiles\n                    set c to comment of thisFile\n                    if c = \"\" then\n                              set comment of thisFile to keyPhrase & short date string of (current date)\n                    else\n                              set comment of thisFile to c & return & keyPhrase & short date string of (current date)\n                    end if\n          end repeat\nend tell\n \non trashEm(fs)\n  -- set up proper security level\n          if securityLevel = 1 then\n                    set cmd to \"srm -rfsz\"\n          else if securityLevel = 3 then\n                    set cmd to \"srm -rfz\"\n          else\n                    set cmd to \"srm -rfmz\"\n          end if\n \n  -- start a secure delete process in the background\n          do shell script cmd & fs & \" &> \/dev\/null &\"\nend trashEm\n \non tid(input, delim)\n  -- generic subroutine to handle text items\n          set {oldTID, my text item delimiters} to {my text item delimiters, delim}\n          if class of input is list then\n                    set output to input as text\n          else\n                    set output to text items of input\n          end if\n          set my text item delimiters to oldTID\n          return output\nend tid\n \non makePosix(f)\n          return quoted form of POSIX path of f\nend makePosix\n \non checkDate(d)\n\tset n to short date string of ((current date) - daysToWait * days)\n\tlog d\n\tlog n\n\tlog (date d) \u2264 (date n)\n\t-- log (date d) \u2264 short date string of ((current date) - daysToWait * days)\n\t-- return (date d) \u2264 short date string of ((current date) - daysToWait * days)\nend checkDate\n","new_contents":"-- stolen from: https:\/\/discussions.apple.com\/thread\/3172966\nproperty keyPhrase : \"Trashed on: \"\nproperty securityLevel : 2 -- overwrites: 1=1-pass, 2=7-pass, 3=35-pass,  see man srm\nproperty daysToWait : 7\n \ntell application \"Finder\"\n  -- get files in trash that are not new, and check dates\n          set oldFiles to (every item of trash whose comment contains keyPhrase)\n          set trashmeFiles to \"\"\n          repeat with thisFile in oldFiles\n  -- extract trashed date from the spotlight comments\n                    set trashedDate to last item of my tid(comment of thisFile, keyPhrase)\n                    try\n  -- check dates in a try block in case of weirdness)\n                              if my checkDate(trashedDate) then\n                                        log thisFile\n                                        set trashmeFiles to trashmeFiles & \" \" & my makePosix(thisFile as alias)\n                              end if\n                    end try\n          end repeat\n \n  -- trash 'em in a subroutine\n          my trashEm(trashmeFiles)\n \n  -- gather new files\n          set newFiles to every item of trash whose comment does not contain keyPhrase\n  -- add the current date to the spotlight comment of the new files\n          repeat with thisFile in newFiles\n                    set c to comment of thisFile\n                    if c = \"\" then\n                              set comment of thisFile to keyPhrase & short date string of (current date)\n                    else\n                              set comment of thisFile to c & return & keyPhrase & short date string of (current date)\n                    end if\n          end repeat\nend tell\n \non trashEm(fs)\n  -- set up proper security level\n          if securityLevel = 1 then\n                    set cmd to \"srm -rfsz\"\n          else if securityLevel = 3 then\n                    set cmd to \"srm -rfz\"\n          else\n                    set cmd to \"srm -rfmz\"\n          end if\n \n  -- start a secure delete process in the background\n          do shell script cmd & fs & \" &> \/dev\/null &\"\nend trashEm\n \non tid(input, delim)\n  -- generic subroutine to handle text items\n          set {oldTID, my text item delimiters} to {my text item delimiters, delim}\n          if class of input is list then\n                    set output to input as text\n          else\n                    set output to text items of input\n          end if\n          set my text item delimiters to oldTID\n          return output\nend tid\n \non makePosix(f)\n          return quoted form of POSIX path of f\nend makePosix\n \non checkDate(d)\n\tset n to short date string of ((current date) - daysToWait * days)\n\tlog d\n\tlog n\n\tlog (date d) \u2264 (date n)\n\t\n\treturn (date d) \u2264 (date n)\n\t-- log (date d) \u2264 short date string of ((current date) - daysToWait * days)\n\t-- return (date d) \u2264 short date string of ((current date) - daysToWait * days)\nend checkDate\n","subject":"allow for weird dates","message":"allow for weird dates","lang":"AppleScript","license":"mit","repos":"Mausy5043\/OSX-EmptyTrash"}
{"commit":"f8d117554804d97d9ecbac80288966974ae9f9b1","old_file":"script\/start_install.scpt","new_file":"script\/start_install.scpt","old_contents":"#!\/usr\/bin\/env osascript\n\n-- Fist: Click Install Button\ndelay 0.4\ntell application \"System Events\"\n  set installer to \"Install Command Line Developer Tools\"\n  click UI Element \"Install\" of window 1 of installer\n  click UI Element \"Agree\" of window 1 of installer\nend tell\n","new_contents":"#!\/usr\/bin\/env osascript\n\n-- Fist: Click Install Button\ndelay 0.4\ntell application \"System Events\"\n  set installer to application process \"Install Command Line Developer Tools\"\n  click UI Element \"Install\" of window 1 of installer\n  click UI Element \"Agree\" of window 1 of installer\nend tell\n","subject":"Fix fatal mistake","message":"Fix fatal mistake\n","lang":"AppleScript","license":"mit","repos":"k0kubun\/rebuild,k0kubun\/rebuild"}
{"commit":"49b3bc5a5848ffd009123afd5d7b235f11bc3018","old_file":"status.applescript","new_file":"status.applescript","old_contents":"tell application \"Finder\"\n\tset json_path to file \"json.scpt\" of folder of (path to me)\nend tell\nset json to load script (json_path as alias)\n\non is_running(appName)\n\ttell application \"System Events\" to (name of processes) contains appName\nend is_running\n\nset reply to json's createDict()\nif is_running(\"Hermes\") then\n\treply's setkv(\"running\", true)\n\tset hermesInfo to json's createDict()\n\ttell application \"Hermes\"\n\t\thermesInfo's setkv(\"state\", playback state as string)\n\t\thermesInfo's setkv(\"title\", current song's title)\n\t\thermesInfo's setkv(\"artist\", current song's artist)\n\t\thermesInfo's setkv(\"album\", current song's album)\n\t\thermesInfo's setkv(\"artwork\", current song's artwork URL)\n\t\thermesInfo's setkv(\"rating\", current song's rating)\n\t\thermesInfo's setkv(\"position\", playback position as integer)\n\t\thermesInfo's setkv(\"duration\", current song duration as integer)\n\tend tell\n\treply's setkv(\"info\", hermesInfo)\nelse\n\treply's setkv(\"running\", false)\nend if\nreturn reply's toJson()\n","new_contents":"tell application \"Finder\"\n\tset json_path to file \"json.scpt\" of folder of (path to me)\nend tell\nset json to load script (json_path as alias)\n\non is_running(appName)\n\ttell application \"System Events\" to (name of processes) contains appName\nend is_running\n\nset reply to json's createDict()\nif is_running(\"Hermes\") then\n\treply's setkv(\"running\", true)\n\tset hermesInfo to json's createDict()\n\tset hermesStations to json's createDict()\n\ttell application \"Hermes\"\n\t\thermesInfo's setkv(\"state\", playback state as string)\n\t\thermesInfo's setkv(\"volume\", playback volume)\n\n-- XXX: execution error: Hermes got an error: every station doesn\u2019t understand the \u201ccount\u201d message. (-1708)\n--\t\trepeat with theStation in stations\n--\t\t\thermesStations's setkv(\"name\", theStation's name)\n--\t\t\thermesStations's setkv(\"id\", theStation's station ID)\n--\t\tend repeat\n\n\t\thermesInfo's setkv(\"title\", current song's title)\n\t\thermesInfo's setkv(\"artist\", current song's artist)\n\t\thermesInfo's setkv(\"album\", current song's album)\n\t\thermesInfo's setkv(\"artwork\", current song's artwork URL)\n\t\thermesInfo's setkv(\"rating\", current song's rating)\n\t\thermesInfo's setkv(\"position\", playback position as integer)\n\t\thermesInfo's setkv(\"duration\", current song duration as integer)\n\t\thermesInfo's setkv(\"station_name\", current station's name)\n\t\thermesInfo's setkv(\"station_id\", current station's station ID)\n\tend tell\n\thermesInfo's setkv(\"stations\", hermesStations)\n\treply's setkv(\"info\", hermesInfo)\nelse\n\treply's setkv(\"running\", false)\nend if\nreturn reply's toJson()\n","subject":"add volume and stations framework for when i fix it","message":"add volume and stations framework for when i fix it\n","lang":"AppleScript","license":"mit","repos":"winny-\/HermesRemote,winny-\/HermesRemote"}
{"commit":"d97b50320a0634e02f139c1218508ffd07b17894","old_file":"applescripts\/open_vagrant.applescript","new_file":"applescripts\/open_vagrant.applescript","old_contents":"set open_vagrant to \"z puppet; vagrant up;\"\n\ntell application \"iTerm\"\n\tactivate\n\ttry\n\t\tset mysession to current session of current terminal\n\ton error\n\t\tset myterm to (make new terminal)\n\t\ttell myterm\n\t\t\tlaunch session \"Default\"\n\t\t\tset mysession to current session\n\t\tend tell\n\tend try\n\t\n\ttell mysession\n\t\twrite text open_vagrant\n\tend tell\nend tell","new_contents":"set open_vagrant to \"z puppet; vagrant up;\"\nset update_master to \"\/Users\/alex\/.homesick\/repos\/palcu\/dotfiles\/scripts\/update_master.sh;\"\n\ntell application \"iTerm\"\n\tactivate\n\ttry\n\t\tset mysession to current session of current terminal\n\ton error\n\t\tset myterm to (make new terminal)\n\t\ttell myterm\n\t\t\tlaunch session \"Default\"\n\t\t\tset mysession to current session\n\t\tend tell\n\tend try\n\t\n\ttell mysession\n        write text update_master\n\t\twrite text open_vagrant\n\tend tell\nend tell\n","subject":"Add update script to open vagrant applescript","message":"Add update script to open vagrant applescript\n","lang":"AppleScript","license":"mit","repos":"smathson\/dotfiles"}
{"commit":"29a1d2caf39696e1074d80add85903fbef9aa63a","old_file":"lib\/scripts\/get_track.applescript","new_file":"lib\/scripts\/get_track.applescript","old_contents":"on escape_quotes(string_to_escape)\n  set AppleScript's text item delimiters to the \"\\\"\"\n  set the item_list to every text item of string_to_escape\n  set AppleScript's text item delimiters to the \"\\\\\\\"\"\n  set string_to_escape to the item_list as string\n  set AppleScript's text item delimiters to \"\"\n  return string_to_escape\nend escape_quotes\n\ntell application \"Spotify\"\n  set ctrack to \"{\"\n  set ctrack to ctrack & \"\\\"artist\\\": \\\"\" & my escape_quotes(current track's artist) & \"\\\"\"\n  set ctrack to ctrack & \",\\\"album\\\": \\\"\" & my escape_quotes(current track's album) & \"\\\"\"\n  set ctrack to ctrack & \",\\\"disc_number\\\": \" & current track's disc number\n  set ctrack to ctrack & \",\\\"duration\\\": \" & current track's duration\n  set ctrack to ctrack & \",\\\"played_count\\\": \" & current track's played count\n  set ctrack to ctrack & \",\\\"track_number\\\": \" & current track's track number\n  set ctrack to ctrack & \",\\\"popularity\\\": \" & current track's popularity\n  set ctrack to ctrack & \",\\\"id\\\": \\\"\" & current track's id & \"\\\"\"\n  set ctrack to ctrack & \",\\\"name\\\": \\\"\" & my escape_quotes(current track's name) & \"\\\"\"\n  set ctrack to ctrack & \",\\\"album_artist\\\": \\\"\" & my escape_quotes(current track's album artist) & \"\\\"\"\n  set ctrack to ctrack & \",\\\"spotify_url\\\": \\\"\" & current track's spotify url & \"\\\"\"\n  set ctrack to ctrack & \"}\"\nend tell\n","new_contents":"on escape_quotes(string_to_escape)\n\tset AppleScript's text item delimiters to the \"\\\"\"\n\tset the item_list to every text item of string_to_escape\n\tset AppleScript's text item delimiters to the \"\\\\\\\"\"\n\tset string_to_escape to the item_list as string\n\tset AppleScript's text item delimiters to \"\"\n\treturn string_to_escape\nend escape_quotes\n\ntell application \"Spotify\"\n\tset ctrack to \"{\"\n\tset ctrack to ctrack & \"\\\"artist\\\": \\\"\" & my escape_quotes(current track's artist) & \"\\\"\"\n\tset ctrack to ctrack & \",\\\"album\\\": \\\"\" & my escape_quotes(current track's album) & \"\\\"\"\n\tset ctrack to ctrack & \",\\\"disc_number\\\": \" & current track's disc number\n\tset ctrack to ctrack & \",\\\"duration\\\": \" & current track's duration\n\tset ctrack to ctrack & \",\\\"played_count\\\": \" & current track's played count\n\tset ctrack to ctrack & \",\\\"track_number\\\": \" & current track's track number\n\tset ctrack to ctrack & \",\\\"popularity\\\": \" & current track's popularity\n\tset ctrack to ctrack & \",\\\"id\\\": \\\"\" & current track's id & \"\\\"\"\n\tset ctrack to ctrack & \",\\\"name\\\": \\\"\" & my escape_quotes(current track's name) & \"\\\"\"\n\tset ctrack to ctrack & \",\\\"album_artist\\\": \\\"\" & my escape_quotes(current track's album artist) & \"\\\"\"\n\tset ctrack to ctrack & \",\\\"artwork_url\\\": \\\"\" & current track's artwork url & \"\\\"\"\n\tset ctrack to ctrack & \",\\\"spotify_url\\\": \\\"\" & current track's spotify url & \"\\\"\"\n\tset ctrack to ctrack & \"}\"\nend tell\n","subject":"add album artwork url to get_track","message":"add album artwork url to get_track\n","lang":"AppleScript","license":"mit","repos":"andrehaveman\/spotify-node-applescript"}
{"commit":"b9c9aeda0352a18ff8db1d4f9cfd5a32004f1198","old_file":"packages\/react-dev-utils\/openChrome.applescript","new_file":"packages\/react-dev-utils\/openChrome.applescript","old_contents":"(*\nCopyright (c) 2015-present, Facebook, Inc.\nAll rights reserved.\n\nThis source code is licensed under the BSD-style license found in the\n-- LICENSE file in the root directory of this source tree. An additional grant\nof patent rights can be found in the PATENTS file in the same directory.\n*)\n\non run argv\n  set theURL to item 1 of argv\n\n  tell application \"Chrome\"\n\n    if (count every window) = 0 then\n      make new window\n    end if\n\n    -- Find a tab currently running the debugger\n    set found to false\n    set theTabIndex to -1\n    repeat with theWindow in every window\n      set theTabIndex to 0\n      repeat with theTab in every tab of theWindow\n        set theTabIndex to theTabIndex + 1\n        if theTab's URL is theURL then\n          set found to true\n          exit repeat\n        end if\n      end repeat\n\n      if found then\n        exit repeat\n      end if\n    end repeat\n\n    if found then\n      tell theTab to reload\n      set index of theWindow to 1\n      set theWindow's active tab index to theTabIndex\n    else\n      tell window 1\n        activate\n        make new tab with properties {URL:theURL}\n      end tell\n    end if\n  end tell\nend run\n","new_contents":"(*\nCopyright (c) 2015-present, Facebook, Inc.\nAll rights reserved.\n\nThis source code is licensed under the BSD-style license found in the\n-- LICENSE file in the root directory of this source tree. An additional grant\nof patent rights can be found in the PATENTS file in the same directory.\n*)\n\non run argv\n  set theURL to item 1 of argv\n\n  tell application \"Chrome\"\n\n    if (count every window) = 0 then\n      make new window\n    end if\n\n    -- Find a tab currently running the debugger\n    set found to false\n    set theTabIndex to -1\n    repeat with theWindow in every window\n      set theTabIndex to 0\n      repeat with theTab in every tab of theWindow\n        set theTabIndex to theTabIndex + 1\n        if theTab's URL as string contains theURL then\n          set found to true\n          exit repeat\n        end if\n      end repeat\n\n      if found then\n        exit repeat\n      end if\n    end repeat\n\n    if found then\n      tell theTab to reload\n      set index of theWindow to 1\n      set theWindow's active tab index to theTabIndex\n      tell theWindow to activate\n    else\n      tell window 1\n        activate\n        make new tab with properties {URL:theURL}\n      end tell\n    end if\n  end tell\nend run\n","subject":"Fix chrome tab reuse (#1035)","message":"Fix chrome tab reuse (#1035)\n\n* Correctly checks site url to tab url in reuse check\r\n\r\n* Bring chrome to foreground focused after tab reuse\r\n","lang":"AppleScript","license":"bsd-3-clause","repos":"DivineGod\/create-react-app,Bogala\/create-react-app-awesome-ts,Timer\/create-react-app,just-boris\/create-preact-app,TondaHack\/create-react-app,reedsa\/create-react-app,Psychwire\/create-react-app,shrynx\/react-super-scripts,xiaohu-developer\/create-react-app,digitalorigin\/create-react-app,jayphelps\/create-react-app,IamJoseph\/create-react-app,dsopel94\/create-react-app,xiaohu-developer\/create-react-app,romaindso\/create-react-app,brysgo\/create-react-app,cr101\/create-react-app,ontruck\/create-react-app,ConnectedHomes\/create-react-web-app,in2core\/create-react-app,facebookincubator\/create-react-app,mangomint\/create-react-app,emvu\/create-react-app,devex-web-frontend\/create-react-app-dx,matart15\/create-react-app,Exocortex\/create-react-app,Sonu-sj\/cardMatcher,accurat\/accurapp,Clearcover\/web-build,1Body\/prayer-app,romaindso\/create-react-app,infernojs\/create-inferno-app,jayphelps\/create-react-app,just-boris\/create-preact-app,kst404\/e8e-react-scripts,powerreviews\/create-react-app,christiantinauer\/create-react-app,kst404\/e8e-react-scripts,accurat\/accurapp,IamJoseph\/create-react-app,devex-web-frontend\/create-react-app-dx,mangomint\/create-react-app,paweljedrzejczyk\/create-react-app,lopezator\/create-react-app,ro-savage\/create-react-app,josephfinlayson\/create-react-app,picter\/create-react-app,shrynx\/react-super-scripts,picter\/create-react-app,1Body\/prayer-app,ontruck\/create-react-app,Bogala\/create-react-app-awesome-ts,digitalorigin\/create-react-app,jdcrensh\/create-react-app,Place1\/create-react-app-typescript,andrewmaudsley\/create-react-app,GreenGremlin\/create-react-app,lopezator\/create-react-app,christiantinauer\/create-react-app,mikechau\/create-react-app,maletor\/create-react-app,ro-savage\/create-react-app,christiantinauer\/create-react-app,yosharepoint\/react-scripts-ts-sp,peopleticker\/create-react-app,svrcekmichal\/react-scripts,timlogemann\/create-react-app,DivineGod\/create-react-app,IamJoseph\/create-react-app,timlogemann\/create-react-app,whobutsb\/create-redux-app,RobzDoom\/frame_trap,1Body\/prayer-app,Timer\/create-react-app,timlogemann\/create-react-app,iamdoron\/create-react-app,iamdoron\/create-react-app,viankakrisna\/create-react-app,brysgo\/create-react-app,in2core\/create-react-app,cr101\/create-react-app,Clearcover\/web-build,appier\/create-react-app,paweljedrzejczyk\/create-react-app,johnslay\/create-react-app,andrewmaudsley\/create-react-app,Timer\/create-react-app,jdcrensh\/create-react-app,0xaio\/create-react-app,RobzDoom\/frame_trap,dpoineau\/create-react-app,bttf\/create-react-app,powerreviews\/create-react-app,devex-web-frontend\/create-react-app-dx,ConnectedHomes\/create-react-web-app,emvu\/create-react-app,facebookincubator\/create-react-app,kst404\/e8e-react-scripts,DivineGod\/create-react-app,whobutsb\/create-redux-app,TryKickoff\/create-kickoff-app,josephfinlayson\/create-react-app,in2core\/create-react-app,maletor\/create-react-app,liamhu\/create-react-app,emvu\/create-react-app,yosharepoint\/react-scripts-ts-sp,lolaent\/create-react-app,ConnectedHomes\/create-react-web-app,flybayer\/create-react-webextension,christiantinauer\/create-react-app,prontotools\/create-react-app,sigmacomputing\/create-react-app,GreenGremlin\/create-react-app,mangomint\/create-react-app,timlogemann\/create-react-app,HelpfulHuman\/helpful-react-scripts,svrcekmichal\/react-scripts,paweljedrzejczyk\/create-react-app,0xaio\/create-react-app,d3ce1t\/create-react-app,gutenye\/create-react-app,TryKickoff\/create-kickoff-app,Sonu-sj\/cardMatcher,ontruck\/create-react-app,matart15\/create-react-app,Place1\/create-react-app-typescript,bttf\/create-react-app,lopezator\/create-react-app,appier\/create-react-app,Clearcover\/web-build,CodingZeal\/create-react-app,devex-web-frontend\/create-react-app-dx,TondaHack\/create-react-app,lolaent\/create-react-app,mikechau\/create-react-app,g3r4n\/create-esri-react-app,dpoineau\/create-react-app,g3r4n\/create-esri-react-app,Place1\/create-react-app-typescript,digitalorigin\/create-react-app,josephfinlayson\/create-react-app,TryKickoff\/create-kickoff-app,1Body\/prayer-app,lolaent\/create-react-app,accurat\/accurapp,jdcrensh\/create-react-app,Sonu-sj\/cardMatcher,viankakrisna\/create-react-app,ConnectedHomes\/create-react-web-app,Exocortex\/create-react-app,dpoineau\/create-react-app,Psychwire\/create-react-app,xiaohu-developer\/create-react-app,dsopel94\/create-react-app,bttf\/create-react-app,infernojs\/create-inferno-app,powerreviews\/create-react-app,andrewmaudsley\/create-react-app,stockspiking\/create-react-app,tharakawj\/create-react-app,Exocortex\/create-react-app,flybayer\/create-react-webextension,amido\/create-react-app,peopleticker\/create-react-app,johnslay\/create-react-app,d3ce1t\/create-react-app,prometheusresearch\/create-react-app,prontotools\/create-react-app,svrcekmichal\/react-scripts,peopleticker\/create-react-app,iamdoron\/create-react-app,picter\/create-react-app,tharakawj\/create-react-app,stockspiking\/create-react-app,scyankai\/create-react-app,0xaio\/create-react-app,prometheusresearch\/create-react-app,amido\/create-react-app,jdcrensh\/create-react-app,HelpfulHuman\/helpful-react-scripts,reedsa\/create-react-app,Bogala\/create-react-app-awesome-ts,Bogala\/create-react-app-awesome-ts,CodingZeal\/create-react-app,sigmacomputing\/create-react-app,johnslay\/create-react-app,accurat\/accurapp,maletor\/create-react-app,reedsa\/create-react-app,sigmacomputing\/create-react-app,stockspiking\/create-react-app,amido\/create-react-app,cr101\/create-react-app,scyankai\/create-react-app,prontotools\/create-react-app,tharakawj\/create-react-app,romaindso\/create-react-app,HelpfulHuman\/helpful-react-scripts,appier\/create-react-app,d3ce1t\/create-react-app,yosharepoint\/react-scripts-ts-sp,igetgames\/spectacle-create-react-app,matart15\/create-react-app,mangomint\/create-react-app,prometheusresearch\/create-react-app,igetgames\/spectacle-create-react-app,CodingZeal\/create-react-app,facebookincubator\/create-react-app,Place1\/create-react-app-typescript,dsopel94\/create-react-app,ro-savage\/create-react-app,flybayer\/create-react-webextension,liamhu\/create-react-app,TondaHack\/create-react-app,yosharepoint\/react-scripts-ts-sp,viankakrisna\/create-react-app,liamhu\/create-react-app,gutenye\/create-react-app,shrynx\/react-super-scripts,brysgo\/create-react-app,scyankai\/create-react-app,infernojs\/create-inferno-app,Timer\/create-react-app,RobzDoom\/frame_trap,igetgames\/spectacle-create-react-app,jayphelps\/create-react-app,just-boris\/create-preact-app,Psychwire\/create-react-app,gutenye\/create-react-app,mikechau\/create-react-app,g3r4n\/create-esri-react-app,GreenGremlin\/create-react-app,d3ce1t\/create-react-app,GreenGremlin\/create-react-app"}
{"commit":"7d3ecb535f3f0cc64047d63fef34b80aed30cda7","old_file":"macosx\/scripts\/iTunes\/mobile-speakers.applescript","new_file":"macosx\/scripts\/iTunes\/mobile-speakers.applescript","old_contents":"(*\n  Script object to make calling a defined function easier while in the\n  iTunes and System Events name space.\n*)\nscript remoteSpeakerFinder\n\tglobal the_bwindow, the_state\n\t\n\t-- Given a list of buttons, find the remote speakers button\n\t-- by finding the first button with a name that isn't in a \n\t-- rejection list.\n\ton findCorrectButton(in_buttons)\n\t\tset buttons_to_skip to {\"Burn Disc\"}\n\t\t\n\t\trepeat with a_button in in_buttons\n\t\t\ttry -- some buttons don't have names\n\t\t\t\tset the_name to name of a_button\n\t\t\t\tif buttons_to_skip does not contain {the_name} then\n\t\t\t\t\treturn the_name\n\t\t\t\tend if\n\t\t\tend try\n\t\tend repeat\n\t\t\n\t\treturn 16 -- default response\n\tend findCorrectButton\n\t\n\ton setRemoteSpeakersTo(item_index)\n\t\ttell application \"System Events\"\n\t\t\ttell process \"iTunes\"\n\t\t\t\t\n\t\t\t\tset the_buttons to (get buttons of window 1)\n\t\t\t\tset the_speaker_button to (remoteSpeakerFinder's findCorrectButton(the_buttons))\n\t\t\t\t\n\t\t\t\t-- Switch to the speakers in my bedroom\n\t\t\t\tset frontmost to true\n\t\t\t\tclick button the_speaker_button of window 1\n\t\t\t\tkey code 115 -- Home Key (first speaker in list)\n\t\t\t\t\n\t\t\t\trepeat item_index times\n\t\t\t\t\tkey code 125 -- Down Arrow\n\t\t\t\tend repeat\n\t\t\t\t\n\t\t\t\tkey code 36 -- Return Key\n\t\t\t\t\n\t\t\t\t-- Wait for iTunes to connect to the speakers\n\t\t\t\tdelay 5\n\t\t\tend tell\n\t\tend tell\n\tend setRemoteSpeakersTo\n\t\n\ton prepareWindow()\n\t\ttell application \"iTunes\"\n\t\t\tset the_bwindow to (get first browser window)\n\t\t\tset the_state to (get minimized of the_bwindow)\n\t\t\tset visible of the_bwindow to true\n\t\t\tset minimized of the_bwindow to false\n\t\tend tell\n\tend prepareWindow\n\t\n\ton resetWindow()\n\t\ttell application \"iTunes\"\n\t\t\t-- Return window to previous state\n\t\t\tset minimized of the_bwindow to the_state\n\t\tend tell\n\tend resetWindow\nend script\n\non handle_string(s)\n\tremoteSpeakerFinder's prepareWindow()\n\tremoteSpeakerFinder's setRemoteSpeakersTo(s)\n\tremoteSpeakerFinder's resetWindow()\n\tset volume 1\n\ttell application \"iTunes\"\n\t\tplay (get the first item of (get every track where database ID is 24759))\n\tend tell\nend handle_string\n\non run\n\tremoteSpeakerFinder's prepareWindow()\n\tremoteSpeakerFinder's setRemoteSpeakersTo(2)\n\tremoteSpeakerFinder's resetWindow()\nend run\n","new_contents":"(*\n  Script object to make calling a defined function easier while in the\n  iTunes and System Events name space.\n*)\nscript remoteSpeakerFinder\n\tglobal the_bwindow, the_state\n\t\n\t-- Find the remote speakers button\n\ton findCorrectButton()\n\t\ttell application \"System Events\"\n\t\t\ttell process \"iTunes\"\n\t\t\t\tset in_buttons to (get buttons of window 1)\n\t\t\t\t\n\t\t\t\trepeat with a_button in in_buttons\n\t\t\t\t\tset the_desc to (get description of a_button)\n\t\t\t\t\tif the_desc is equal to \"remote speakers\" then\n\t\t\t\t\t\treturn a_button\n\t\t\t\t\tend if\n\t\t\t\tend repeat\n\t\t\tend tell\n\t\tend tell\n\tend findCorrectButton\n\t\n\ton setRemoteSpeakersTo(item_index)\n\t\ttell application \"System Events\"\n\t\t\ttell process \"iTunes\"\n\t\t\t\t\n\t\t\t\tset the_speaker_button to (remoteSpeakerFinder's findCorrectButton())\n\t\t\t\t\n\t\t\t\t-- Switch to the speakers in my bedroom\n\t\t\t\tset frontmost to true\n\t\t\t\tclick the_speaker_button\n\t\t\t\tkey code 115 -- Home Key (first speaker in list)\n\t\t\t\t\n\t\t\t\trepeat item_index times\n\t\t\t\t\tkey code 125 -- Down Arrow\n\t\t\t\tend repeat\n\t\t\t\t\n\t\t\t\tkey code 36 -- Return Key\n\t\t\t\t\n\t\t\t\t-- Wait for iTunes to connect to the speakers\n\t\t\t\tdelay 5\n\t\t\tend tell\n\t\tend tell\n\tend setRemoteSpeakersTo\n\t\n\ton prepareWindow()\n\t\ttell application \"iTunes\"\n\t\t\tset the_bwindow to (get first browser window)\n\t\t\tset the_state to (get minimized of the_bwindow)\n\t\t\tset visible of the_bwindow to true\n\t\t\tset minimized of the_bwindow to false\n\t\tend tell\n\tend prepareWindow\n\t\n\ton resetWindow()\n\t\ttell application \"iTunes\"\n\t\t\t-- Return window to previous state\n\t\t\tset minimized of the_bwindow to the_state\n\t\tend tell\n\tend resetWindow\nend script\n\non handle_string(s)\n\ttell application \"iTunes\" to stop\n\tremoteSpeakerFinder's prepareWindow()\n\tremoteSpeakerFinder's setRemoteSpeakersTo(s)\n\tremoteSpeakerFinder's resetWindow()\n\tset volume 1\n\ttell application \"iTunes\" to play (get the first item of (get every track where database ID is 24759))\nend handle_string\n\non run\n\tremoteSpeakerFinder's prepareWindow()\n\tremoteSpeakerFinder's setRemoteSpeakersTo(2)\n\tremoteSpeakerFinder's resetWindow()\nend run\n","subject":"Update for iTunes 10","message":"Update for iTunes 10\n","lang":"AppleScript","license":"bsd-3-clause","repos":"pjones\/emacsrc"}
{"commit":"f6180b96943b077d88e7eb218831e7a37a8a7790","old_file":"bin\/PrintSafari.scpt","new_file":"bin\/PrintSafari.scpt","old_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0003l\u0000\u0002\u0000\u0000\u0000>\u0000\u0007\r\u0000\u0007\u0000\u0002O\u0000\u0000\u0000\u0000\u0000>\u0000\b\u0000\t\r\u0000\b\u0000\u0001k\u0000\u0000\u0000\u0004\u0000=\u0000\n\u0002\u0000\n\u0000\u0002\u0000\u000b\u0000\f\r\u0000\u000b\u0000\u0003I\u0000\u0002\u0000\u0004\u0000\t\n\u0000\u0018.miscactvnull\u0000\u0000null\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000\f\u0000\u0002\u0000\r\u0000\u000e\r\u0000\r\u0000\u0002O\u0000\u0000\u0000\n\u0000*\u0000\u000f\u0000\u0010\r\u0000\u000f\u0000\u0001k\u0000\u0000\u0000\u000e\u0000)\u0000\u0011\u0002\u0000\u0011\u0000\u0002\u0000\u0012\u0000\u0013\r\u0000\u0012\u0000\u0003l\u0000\u0001\u0000\u000e\u0000\u0017\u0000\u0014\u0000\u0015\u0000\u0016\r\u0000\u0014\u0000\u0003I\u0000\u0002\u0000\u000e\u0000\u0017\u0000\u0017\u0000\u0018\n\u0000\u0018.prcskprsnull\u0000\u0000\u0000\u0000\u0000ctxt\r\u0000\u0017\u0000\u0001m\u0000\u0000\u0000\u000e\u0000\u000f\u0000\u0019\u000e\u0000\u0019\u0000\u0001\u0000\u001a\u0011\u0000\u001a\u0000\u0002\u0000p\u0006\u0000\u0018\u0000\u0003\u0000\u001b\n\u0000\u0004\nfaal\r\u0000\u001b\u0000\u0001J\u0000\u0000\u0000\u0010\u0000\u0013\u0000\u001c\u0002\u0000\u001c\u0000\u0002\u0000\u001d\r\u0000\u001d\u0000\u0001m\u0000\u0000\u0000\u0010\u0000\u0011\n\u0000\b\u000beMdsKcmd\u0002\u0000\u0000\u0006\u0000\u0000\f\u0000\u0015\u0000\u001f\u0000\u0019 activate print menu item\u0000\u0002\u0000\u0000\u000e\u0000\u0016\u0000\u0001\u0000\u001e\u0011\u0000\u001e\u00002\u0000 \u0000a\u0000c\u0000t\u0000i\u0000v\u0000a\u0000t\u0000e\u0000 \u0000p\u0000r\u0000i\u0000n\u0000t\u0000 \u0000m\u0000e\u0000n\u0000u\u0000 \u0000i\u0000t\u0000e\u0000m\u0002\u0000\u0013\u0000\u0002\u0000\u001f\u0000 \r\u0000\u001f\u0000\u0003I\u0000\u0002\u0000\u0018\u0000\u001d\u0000!\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\r\u0000!\u0000\u0001m\u0000\u0000\u0000\u0018\u0000\u0019\u0000\"\b\u0000\"\u0000\b?\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000 \u0000\u0002\u0000#\u0000$\r\u0000#\u0000\u0003l\u0000\u0001\u0000\u001e\u0000#\u0000%\u0000&\u0000'\r\u0000%\u0000\u0003I\u0000\u0002\u0000\u001e\u0000#\u0000(\n\u0000\u0018.prcskprsnull\u0000\u0000\u0000\u0000\u0000ctxt\r\u0000(\u0000\u0001o\u0000\u0000\u0000\u001e\u0000\u001f\n\u0000\u0004\nret \u0002\u0000\u0000\f\u0000&\u0000\f\u0000\u0006 print\u0000\u0002\u0000\u0000\u000e\u0000'\u0000\u0001\u0000)\u0011\u0000)\u0000\f\u0000 \u0000p\u0000r\u0000i\u0000n\u0000t\u0002\u0000$\u0000\u0002\u0000*\r\u0000*\u0000\u0003I\u0000\u0002\u0000$\u0000)\u0000+\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\r\u0000+\u0000\u0001m\u0000\u0000\u0000$\u0000%\u0000,\b\u0000,\u0000\b@\u0014\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0010\u0000\u0001m\u0000\u0000\u0000\n\u0000\u000b\u0000-\u000f\u0000-\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sevs\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0398*SH+\u0000\u0000\u0000\u0000\u0000-\u0011System Events.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0003jX|\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u0000\u0397\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000X\r\u0000\u0000\u0000\u0001\u0000\f\u0000\u0000\u0000-\u0000\u0000\u0000*\u0000\u0000\u0000)\u0000\u0002\u0000=Macintosh HD:System:\u0000Library:\u0000CoreServices:\u0000System Events.app\u0000\u0000\u000e\u0000$\u0000\u0011\u0000S\u0000y\u0000s\u0000t\u0000e\u0000m\u0000 \u0000E\u0000v\u0000e\u0000n\u0000t\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000-System\/Library\/CoreServices\/System Events.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u0000\u000e\u0000\u0002\u0000.\u0000\/\r\u0000.\u0000\u0003l\u0000\u0002\u0000+\u0000+\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\/\u0000\u0002\u00000\u00001\r\u00000\u0000\u0002r\u0000\u0000\u0000+\u00001\u00002\u00003\r\u00002\u0000\u00024\u0000\u0001\u0000+\u0000\/\u00004\n\u0000\u0004\ncwin\r\u00004\u0000\u0001m\u0000\u0000\u0000-\u0000.\u0003\u0000\u0001\r\u00003\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00050\u0000\u0001w\u0000\u0000\u0002\u00001\u0000\u0002\u00005\u00006\r\u00005\u0000\u0002r\u0000\u0000\u00002\u00007\u00007\u00008\r\u00007\u0000\u0002n\u0000\u0000\u00002\u00005\u00009\u0000:\r\u00009\u0000\u00011\u0000\u0000\u00003\u00005\n\u0000\u0004\ncTab\r\u0000:\u0000\u0001o\u0000\u0000\u00002\u00003\u000b\u0000\u00050\u0000\u0001w\u0000\u0000\r\u00008\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00050\u0000\u0001t\u0000\u0000\u0002\u00006\u0000\u0002\u0000;\r\u0000;\u0000\u0003I\u0000\u0002\u00008\u0000=\u0000<\n\u0000\u0018.coreclosnull\u0000\u0000\u0000\u0010\u0000obj \r\u0000<\u0000\u0001o\u0000\u0000\u00008\u00009\u000b\u0000\u00050\u0000\u0001t\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\t\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0000=\u000f\u0000=\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sfri\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001N\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0398*SH+\u0000\u0000\u0000\u0000\u0000O\nSafari.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000!G\u035d\rr\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fApplications\u0000\u0010\u0000\b\u0000\u0000\u0397\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u035c\u0000\u0000\u0000\u0001\u0000\u0004\u0000\u0000\u0000O\u0000\u0002\u0000%Macintosh HD:Applications:\u0000Safari.app\u0000\u0000\u000e\u0000\u0016\u0000\n\u0000S\u0000a\u0000f\u0000a\u0000r\u0000i\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000\u0017Applications\/Safari.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000>\r\u0000>\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0006\u0000?\u0000@\u0000A\u0000B\u0001\u0000\u0000\u0010\u0000?\u0000\u0004\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000b\u0000\u00050\u0000\u0001w\u0000\u0000\u000b\u0000\u00050\u0000\u0001t\u0000\u0000\u0001\u0000\u0000\u000e\u0000@\u0000\u0007\u0010\u0000C\u0000D\u0000E\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000C\u0000\u0001k\u0000\u0000\u0000\u0000\u0000>\u0000F\u0002\u0000F\u0000\u0002\u0000\u0005\u0002\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0010\u0000D\u0000\u0000\u0010\u0000E\u0000\u0010\u0000=\u0000-\u0000\u0019\u0000\"\u0000,\n\u0000\u0018.miscactvnull\u0000\u0000null\n\u0000\u0004\nfaal\n\u0000\b\u000beMdsKcmd\n\u0000\u0018.prcskprsnull\u0000\u0000\u0000\u0000\u0000ctxt\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\n\u0000\u0004\nret \n\u0000\u0004\ncwin\u000b\u0000\u00050\u0000\u0001w\u0000\u0000\n\u0000\u0004\ncTab\u000b\u0000\u00050\u0000\u0001t\u0000\u0000\n\u0000\u0018.coreclosnull\u0000\u0000\u0000\u0010\u0000obj \u0011\u0000?\u0012\u0000;*j\f\u0000\u0001O\u0012\u0000\u001dkvl\f\u0000\u0006Oj\f\u0000\bOj\f\u0000\u0006Oj\f\u0000\bUO*k\/EO,EOj\f\u0000\u000fU\u000f\u000e\u0000A\u0000\u0001\u0014\u0000G\u000e\u0000G\u0000\u0004\u0019\u0000=\n\u0000\u0004\ncwin\u0007\u0000\u0004\u0000\u0000\u05a1\n\u0000\b\u000bkfrmID  \u000e\u0000B\u0000\u0001\u0014\u0000H\u000e\u0000H\u0000\u0003\u0018\u0000I\u000e\u0000I\u0000\u0004\u0019\u0000=\n\u0000\u0004\ncwin\u0007\u0000\u0004\u0000\u0000\u05a1\n\u0000\b\u000bkfrmID  \n\u0000\u0004\nbTab\u0003\u0000\u0001\u0001\u0000\u0000\u0000ascr\u0000\u0001\u0000\r\u07ad","new_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0002i\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0007\u0000\b\r\u0000\u0007\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0000\u0000\t\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\r\u0000\t\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\b0\u0000\u0004argv\u0000\u0000\u0002\u0000\u0000\r\u0000\b\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\n\u0002\u0000\n\u0000\u0002\u0000\u000b\u0000\f\r\u0000\u000b\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u0000\r\u0000\u000e\u0001\u0000\u0000\f\u0000\r\u0000\u0015\u0000\u000f printer ??????\u0000\u0002\u0000\u0000\u000e\u0000\u000e\u0000\u0001\u0000\u000f\u0011\u0000\u000f\u0000\u001e\u0000 \u0000p\u0000r\u0000i\u0000n\u0000t\u0000e\u0000r\u0000 0o_\u0015ep0gn!0Y\u0002\u0000\f\u0000\u0002\u0000\u0010\u0000\u0011\r\u0000\u0010\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0012\u0000\u0013\u0001\u0000\u0000\f\u0000\u0012\u0000\u001a\u0000\u0014 1. last use printer\u0000\u0002\u0000\u0000\u000e\u0000\u0013\u0000\u0001\u0000\u0014\u0011\u0000\u0014\u0000(\u0000 \u00001\u0000.\u0000 \u0000l\u0000a\u0000s\u0000t\u0000 \u0000u\u0000s\u0000e\u0000 \u0000p\u0000r\u0000i\u0000n\u0000t\u0000e\u0000r\u0002\u0000\u0011\u0000\u0002\u0000\u0015\u0000\u0016\r\u0000\u0015\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0017\u0000\u0018\u0001\u0000\u0000\f\u0000\u0017\u0000\u000e\u0000\b 2. none\u0000\u0002\u0000\u0000\u000e\u0000\u0018\u0000\u0001\u0000\u0019\u0011\u0000\u0019\u0000\u0010\u0000 \u00002\u0000.\u0000 \u0000n\u0000o\u0000n\u0000e\u0002\u0000\u0016\u0000\u0002\u0000\u001a\u0000\u001b\r\u0000\u001a\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u001c\u0000\u001d\u0001\u0000\u0000\f\u0000\u001c\u0000\u0018\u0000\u0012 3. your printer 1\u0000\u0002\u0000\u0000\u000e\u0000\u001d\u0000\u0001\u0000\u001e\u0011\u0000\u001e\u0000$\u0000 \u00003\u0000.\u0000 \u0000y\u0000o\u0000u\u0000r\u0000 \u0000p\u0000r\u0000i\u0000n\u0000t\u0000e\u0000r\u0000 \u00001\u0002\u0000\u001b\u0000\u0002\u0000\u001f\u0000 \r\u0000\u001f\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u0000!\u0000\"\u0001\u0000\u0000\f\u0000!\u0000\u0018\u0000\u0012 4. your printer 2\u0000\u0002\u0000\u0000\u000e\u0000\"\u0000\u0001\u0000#\u0011\u0000#\u0000$\u0000 \u00004\u0000.\u0000 \u0000y\u0000o\u0000u\u0000r\u0000 \u0000p\u0000r\u0000i\u0000n\u0000t\u0000e\u0000r\u0000 \u00002\u0002\u0000 \u0000\u0002\u0000$\u0000%\r\u0000$\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u0000&\u0000'\u0001\u0000\u0000\f\u0000&\u0000\u0010\u0000\n and so on\u0000\u0002\u0000\u0000\u000e\u0000'\u0000\u0001\u0000(\u0011\u0000(\u0000\u0014\u0000 \u0000a\u0000n\u0000d\u0000 \u0000s\u0000o\u0000 \u0000o\u0000n\u0002\u0000%\u0000\u0002\u0000)\u0000*\r\u0000)\u0000\u0002r\u0000\u0000\u0000\u0000\u0000\b\u0000+\u0000,\r\u0000+\u0000\u0002[\u0000\u0000\u0000\u0000\u0000\u0006\u0000-\u0000.\r\u0000-\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0003\u0000\u0000\r\u0000.\u0000\u0003l\u0000\u0005\u0000\u0001\u0000\u0005\u0000\/\r\u0000\/\u0000\u0002n\u0000\u0000\u0000\u0001\u0000\u0005\u00000\u00001\r\u00000\u0000\u00024\u0000\u0000\u0000\u0002\u0000\u0005\u00002\n\u0000\u0004\ncobj\r\u00002\u0000\u0001m\u0000\u0000\u0000\u0003\u0000\u0004\u0003\u0000\u0001\r\u00001\u0000\u0001o\u0000\u0000\u0000\u0001\u0000\u0002\u000b\u0000\b0\u0000\u0004argv\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000,\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u000b0\u0000\u0007printer\u0000\u0000\u0002\u0000*\u0000\u0002\u00003\u00004\r\u00003\u0000\u0003l\u0000\u0002\u0000\t\u0000\t\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u00004\u0000\u0002\u00005\u00006\r\u00005\u0000\u0002O\u0000\u0000\u0000\t\u0000`\u00007\u00008\r\u00007\u0000\u0001k\u0000\u0000\u0000\r\u0000_\u00009\u0002\u00009\u0000\u0002\u0000:\u0000;\r\u0000:\u0000\u0003I\u0000\u0002\u0000\r\u0000\u0012\n\u0000\u0018.miscactvnull\u0000\u0000null\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000;\u0000\u0002\u0000<\u0000=\r\u0000<\u0000\u0002r\u0000\u0000\u0000\u0013\u0000\u001c\u0000>\u0000?\r\u0000>\u0000\u00035\u0000\u0000\u0000\u0013\u0000\u0018\u0000@\n\u0000\u0004\nxppb\r\u0000@\u0000\u0001m\u0000\u0000\u0000\u0015\u0000\u0016\u0000A\u000e\u0000A\u0000\u0001\u0000B\u0011\u0000B\u0000:\u0000c\u0000o\u0000m\u0000.\u0000a\u0000p\u0000p\u0000l\u0000e\u0000.\u0000p\u0000r\u0000e\u0000f\u0000e\u0000r\u0000e\u0000n\u0000c\u0000e\u0000.\u0000p\u0000r\u0000i\u0000n\u0000t\u0000f\u0000a\u0000x\n\u0000\b\u000bkfrmID  \r\u0000?\u0000\u00011\u0000\u0000\u0000\u0018\u0000\u001b\n\u0000\u0004\nxpcp\u0002\u0000=\u0000\u0002\u0000C\u0000D\r\u0000C\u0000\u0003I\u0000\u0002\u0000\u001d\u0000\"\u0000E\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\r\u0000E\u0000\u0001m\u0000\u0000\u0000\u001d\u0000\u001e\u0000F\b\u0000F\u0000\b?\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000D\u0000\u0002\u0000G\u0000H\r\u0000G\u0000\u0003l\u0000\u0002\u0000#\u0000#\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000H\u0000\u0002\u0000I\u0000J\r\u0000I\u0000\u0002O\u0000\u0000\u0000#\u0000]\u0000K\u0000L\r\u0000K\u0000\u0002O\u0000\u0000\u0000'\u0000\\\u0000M\u0000N\r\u0000M\u0000\u0001k\u0000\u0000\u0000.\u0000[\u0000O\u0002\u0000O\u0000\u0002\u0000P\u0000Q\r\u0000P\u0000\u0003I\u0000\u0002\u0000.\u00009\u0000R\n\u0000\u0018.prcsclicnull\u0000\u0000uiel\r\u0000R\u0000\u0002n\u0000\u0000\u0000.\u00005\u0000S\u0000T\r\u0000S\u0000\u00024\u0000\u0000\u00002\u00005\u0000U\n\u0000\u0004\npopB\r\u0000U\u0000\u0001m\u0000\u0000\u00003\u00004\u0003\u0000\u0001\r\u0000T\u0000\u00024\u0000\u0000\u0000.\u00002\u0000V\n\u0000\u0004\ncwin\r\u0000V\u0000\u0001m\u0000\u0000\u00000\u00001\u0003\u0000\u0001\u0002\u0000\u0000\u0002\u0000Q\u0000\u0002\u0000W\u0000X\r\u0000W\u0000\u0003I\u0000\u0002\u0000:\u0000?\u0000Y\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\r\u0000Y\u0000\u0001m\u0000\u0000\u0000:\u0000;\u0000Z\b\u0000Z\u0000\b?\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000X\u0000\u0002\u0000[\u0000\\\r\u0000[\u0000\u0003l\u0000\u0001\u0000@\u0000@\u0000]\u0000^\u0001\u0000\u0000\f\u0000]\u0000\u0011\u0000\u000b 1????????3\u0000\u0002\u0000\u0000\u000e\u0000^\u0000\u0001\u0000_\u0011\u0000_\u0000\u0016\u0000 \u000010dv0n00000o\u00003\u0002\u0000\\\u0000\u0002\u0000`\u0000a\r\u0000`\u0000\u0003l\u0000\u0001\u0000@\u0000@\u0000b\u0000c\u0001\u0000\u0000\f\u0000b\u0000\u001d\u0000\u0017 2????????4 ????2??????\u0000\u0002\u0000\u0000\u000e\u0000c\u0000\u0001\u0000d\u0011\u0000d\u0000.\u0000 \u000020dv0n00000o\u00004\u0000 0n00F0k\u000020d0Z0d0Z00\u0002\u0000a\u0000\u0002\u0000e\u0000f\r\u0000e\u0000\u0003I\u0000\u0002\u0000@\u0000U\u0000g\n\u0000\u0018.prcsclicnull\u0000\u0000uiel\r\u0000g\u0000\u0002n\u0000\u0000\u0000@\u0000Q\u0000h\u0000i\r\u0000h\u0000\u00024\u0000\u0000\u0000L\u0000Q\u0000j\n\u0000\u0004\nmenI\r\u0000j\u0000\u0001o\u0000\u0000\u0000O\u0000P\u000b\u0000\u000b0\u0000\u0007printer\u0000\u0000\r\u0000i\u0000\u0002n\u0000\u0000\u0000@\u0000L\u0000k\u0000l\r\u0000k\u0000\u00024\u0000\u0000\u0000G\u0000L\u0000m\n\u0000\u0004\nmenE\r\u0000m\u0000\u0001m\u0000\u0000\u0000J\u0000K\u0003\u0000\u0001\r\u0000l\u0000\u0002n\u0000\u0000\u0000@\u0000G\u0000n\u0000o\r\u0000n\u0000\u00024\u0000\u0000\u0000D\u0000G\u0000p\n\u0000\u0004\npopB\r\u0000p\u0000\u0001m\u0000\u0000\u0000E\u0000F\u0003\u0000\u0001\r\u0000o\u0000\u00024\u0000\u0000\u0000@\u0000D\u0000q\n\u0000\u0004\ncwin\r\u0000q\u0000\u0001m\u0000\u0000\u0000B\u0000C\u0003\u0000\u0001\u0002\u0000\u0000\u0002\u0000f\u0000\u0002\u0000r\r\u0000r\u0000\u0003I\u0000\u0002\u0000V\u0000[\u0000s\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\r\u0000s\u0000\u0001m\u0000\u0000\u0000V\u0000W\u0000t\b\u0000t\u0000\b?\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000N\u0000\u00024\u0000\u0000\u0000'\u0000+\u0000u\n\u0000\u0004\nprcs\r\u0000u\u0000\u0001m\u0000\u0000\u0000)\u0000*\u0000v\u000e\u0000v\u0000\u0001\u0000w\u0011\u0000w\u0000$\u0000S\u0000y\u0000s\u0000t\u0000e\u0000m\u0000 \u0000P\u0000r\u0000e\u0000f\u0000e\u0000r\u0000e\u0000n\u0000c\u0000e\u0000s\r\u0000L\u0000\u0001m\u0000\u0000\u0000#\u0000$\u0000x\u000f\u0000x\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sevs\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0398*SH+\u0000\u0000\u0001li\u0011System Events.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001p5-\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u0000\u0397\u0000\u0000\u0000\u0011\u0000\b\u0000\u00005\"\u0000\u0000\u0000\u0001\u0000\f\u0001li\u0001liz\u0001liy\u0000\u0002\u0000=Macintosh HD:System:\u0000Library:\u0000CoreServices:\u0000System Events.app\u0000\u0000\u000e\u0000$\u0000\u0011\u0000S\u0000y\u0000s\u0000t\u0000e\u0000m\u0000 \u0000E\u0000v\u0000e\u0000n\u0000t\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000-System\/Library\/CoreServices\/System Events.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u0000J\u0000\u0002\u0000y\r\u0000y\u0000\u0003l\u0000\u0002\u0000^\u0000^\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\r\u00008\u0000\u0001m\u0000\u0000\u0000\t\u0000\n\u0000z\u000f\u0000z\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sprf\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001~\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0398*SH+\u0000\u0000\u0001li\u0016System Preferences.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001pAF\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fApplications\u0000\u0010\u0000\b\u0000\u0000\u0397\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000A=\u0000\u0000\u0000\u0001\u0000\u0004\u0001li\u0000\u0002\u00001Macintosh HD:Applications:\u0000System Preferences.app\u0000\u0000\u000e\u0000.\u0000\u0016\u0000S\u0000y\u0000s\u0000t\u0000e\u0000m\u0000 \u0000P\u0000r\u0000e\u0000f\u0000e\u0000r\u0000e\u0000n\u0000c\u0000e\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000#Applications\/System Preferences.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u00006\u0000\u0002\u0000{\u0000|\r\u0000{\u0000\u0003l\u0000\u0002\u0000a\u0000a\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000|\u0000\u0002\u0000}\u0000~\r\u0000}\u0000\u0003I\u0000\u0002\u0000a\u0000f\u0000\n\u0000\u0018.aevtquitnull\u0000\u0000null\r\u0000\u0000\u0001m\u0000\u0000\u0000a\u0000b\u0000\u000f\u0000\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sprf\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001~\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0398*SH+\u0000\u0000\u0001li\u0016System Preferences.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001pAF\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fApplications\u0000\u0010\u0000\b\u0000\u0000\u0397\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000A=\u0000\u0000\u0000\u0001\u0000\u0004\u0001li\u0000\u0002\u00001Macintosh HD:Applications:\u0000System Preferences.app\u0000\u0000\u000e\u0000.\u0000\u0016\u0000S\u0000y\u0000s\u0000t\u0000e\u0000m\u0000 \u0000P\u0000r\u0000e\u0000f\u0000e\u0000r\u0000e\u0000n\u0000c\u0000e\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000#Applications\/System Preferences.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000~\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000g\u0000l\u0000\n\u0000\u0018.aevtquitnull\u0000\u0000null\r\u0000\u0000\u0001m\u0000\u0000\u0000g\u0000h\u0000\u000f\u0000\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sevs\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0398*SH+\u0000\u0000\u0001li\u0011System Events.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001p5-\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u0000\u0397\u0000\u0000\u0000\u0011\u0000\b\u0000\u00005\"\u0000\u0000\u0000\u0001\u0000\f\u0001li\u0001liz\u0001liy\u0000\u0002\u0000=Macintosh HD:System:\u0000Library:\u0000CoreServices:\u0000System Events.app\u0000\u0000\u000e\u0000$\u0000\u0011\u0000S\u0000y\u0000s\u0000t\u0000e\u0000m\u0000 \u0000E\u0000v\u0000e\u0000n\u0000t\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000-System\/Library\/CoreServices\/System Events.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000m\u0000m\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0002O\u0000\u0000\u0000m\u0000\u0000\u0000\r\u0000\u0000\u0001k\u0000\u0000\u0000s\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000s\u0000x\n\u0000\u0018.miscactvnull\u0000\u0000null\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000y\u0000y\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0002O\u0000\u0000\u0000y\u0000\u0000\u0000\r\u0000\u0000\u0001k\u0000\u0000\u0000}\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000}\u0000\u0000\u0000\n\u0000\u0018.prcskprsnull\u0000\u0000\u0000\u0000\u0000ctxt\r\u0000\u0000\u0001m\u0000\u0000\u0000}\u0000\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0002\u0000p\u0006\u0000\u0000\u0003\u0000\n\u0000\u0004\nfaal\r\u0000\u0000\u0001J\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0000\n\u0000\b\u000beMdsKcmd\u0002\u0000\u0000\u0006\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\b\u0000\u0000\b?\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\n\u0000\u0018.prcskprsnull\u0000\u0000\u0000\u0000\u0000ctxt\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\n\u0000\u0004\nret \u0002\u0000\u0000\f\u0000\u0000\f\u0000\u0006 print\u0000\u0002\u0000\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\f\u0000 \u0000p\u0000r\u0000i\u0000n\u0000t\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\b\u0000\u0000\b@\u0014\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0001m\u0000\u0000\u0000y\u0000z\u0000\u000f\u0000\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sevs\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0398*SH+\u0000\u0000\u0001li\u0011System Events.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001p5-\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u0000\u0397\u0000\u0000\u0000\u0011\u0000\b\u0000\u00005\"\u0000\u0000\u0000\u0001\u0000\f\u0001li\u0001liz\u0001liy\u0000\u0002\u0000=Macintosh HD:System:\u0000Library:\u0000CoreServices:\u0000System Events.app\u0000\u0000\u000e\u0000$\u0000\u0011\u0000S\u0000y\u0000s\u0000t\u0000e\u0000m\u0000 \u0000E\u0000v\u0000e\u0000n\u0000t\u0000s\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000-System\/Library\/CoreServices\/System Events.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0002r\u0000\u0000\u0000\u0000\u0000\u0000\r\u0000\u0000\u00024\u0000\u0001\u0000\u0000\u0000\n\u0000\u0004\ncwin\r\u0000\u0000\u0001m\u0000\u0000\u0000\u0000\u0003\u0000\u0001\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00050\u0000\u0001w\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0002r\u0000\u0000\u0000\u0000\u0000\u0000\r\u0000\u0000\u0002n\u0000\u0000\u0000\u0000\u0000\u0000\r\u0000\u0000\u00011\u0000\u0000\u0000\u0000\n\u0000\u0004\ncTab\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u00050\u0000\u0001w\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00050\u0000\u0001t\u0000\u0000\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\n\u0000\u0018.coreclosnull\u0000\u0000\u0000\u0010\u0000obj \r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u000b\u0000\u00050\u0000\u0001t\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0001m\u0000\u0000\u0000m\u0000p\u0000\u000f\u0000\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000sfri\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001N\u0000\u0002\u0000\u0001\fMacintosh HD\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0398*SH+\u0000\u0000\u0001li\nSafari.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001lR\b_\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fApplications\u0000\u0010\u0000\b\u0000\u0000\u0397\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\by\u0000\u0000\u0000\u0001\u0000\u0004\u0001li\u0000\u0002\u0000%Macintosh HD:Applications:\u0000Safari.app\u0000\u0000\u000e\u0000\u0016\u0000\n\u0000S\u0000a\u0000f\u0000a\u0000r\u0000i\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\u001a\u0000\f\u0000M\u0000a\u0000c\u0000i\u0000n\u0000t\u0000o\u0000s\u0000h\u0000 \u0000H\u0000D\u0000\u0012\u0000\u0017Applications\/Safari.app\u0000\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0003\u0000\u0000\u0001\u0000\u0000\u0010\u0000\u0000\u0001\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000e\u0000\u0000\u0007\u0010\u0000\b\u0000\u0000\n\u0000\u0018.aevtoappnull\u0000\u0000\u0000\u0000\u0000\u0000****\u000b\u0000\b0\u0000\u0004argv\u0000\u0000\u0002\u0000\u0000\u0010\u0000\u0000\u0001\u000b\u0000\b0\u0000\u0004argv\u0000\u0000\u0010\u0000\u0000\u001e\u0000z\u0000A\u0000F\u0000x\u0000v~\u0000\u0000}|{z\u0000yxwv\n\u0000\u0004\ncobj\u000b\u0000\u000b0\u0000\u0007printer\u0000\u0000\n\u0000\u0018.miscactvnull\u0000\u0000null\n\u0000\u0004\nxppb\n\u0000\b\u000bkfrmID  \n\u0000\u0004\nxpcp\n\u0000\u0018.sysodelanull\u0000\u0000nmbr\n\u0000\u0004\nprcs\n\u0000\u0004\ncwin\n\u0000\u0004\npopB\n\u0000\u0018.prcsclicnull\u0000\u0000uiel\n\u0000\u0004\nmenE\n\u0000\u0004\nmenI\n~\u0000\u0018.aevtquitnull\u0000\u0000null\n}\u0000\u0004\nfaal\n|\u0000\b\u000beMdsKcmd\n{\u0000\u0018.prcskprsnull\u0000\u0000\u0000\u0000\u0000ctxt\nz\u0000\u0004\nret \u000by\u0000\u00050\u0000\u0001w\u0000\u0000\nx\u0000\u0004\ncTab\u000bw\u0000\u00050\u0000\u0001t\u0000\u0000\nv\u0000\u0018.coreclosnull\u0000\u0000\u0000\u0010\u0000obj \u0011\u0000jk\/\u001eEO\u0012\u0000T*j\f\u0000\u0003O*0*,FOj\f\u0000\tO\u0012\u00007*\/\u0012\u0000\/*k\/k\/j\f\u0000\u000fOj\f\u0000\tO*k\/k\/a\u0000\u0010k\/a\u0000\u0011\/j\f\u0000\u000fOj\f\u0000\tUUOPUOj\f\u0000\u0012Oj\f\u0000\u0012Oa\u0000\u0013\u0012\u0000O*j\f\u0000\u0003O\u0012\u0000'a\u0000\u0014a\u0000\u0015a\u0000\u0016kvl\f\u0000\u0017Oj\f\u0000\tO_\u0000\u0018j\f\u0000\u0017Oa\u0000\u0019j\f\u0000\tUO*k\/E`\u0000\u001aO_\u0000\u001aa\u0000\u001b,E`\u0000\u001cO_\u0000\u001cj\f\u0000\u001dUOP\u000f\u0000ascr\u0000\u0001\u0000\r\u07ad","subject":"Add printer select feature","message":"Add printer select feature\n","lang":"AppleScript","license":"mit","repos":"sumipan\/safari-print.rb"}
{"commit":"cf9d22b99459c0e19fab3510845486d509cd19ef","old_file":"itunes-concatenator\/itunes-concatenator\/DASAppDelegate.applescript","new_file":"itunes-concatenator\/itunes-concatenator\/DASAppDelegate.applescript","old_contents":"--\n--  DASAppDelegate.applescript\n--  itunes-concatenator\n--\n--  Created by David Schlachter on 2014-08-26.\n--  Copyright (c) 2014 Red Eft Software. All rights reserved.\n--\n\n-- via http:\/\/macscripter.net\/viewtopic.php?pid=173787 ; apparently needed for using arrays\n\nscript DASAppDelegate\n\tproperty parent : class \"NSObject\"\n\t\n    global these_files, these_times, these_titles, the_index, the_pipes, theCounter, cmdPrefix\n    \n\t-- IBOutlets\n\tproperty window : missing value\n    property trackTable : missing value\n    property catName : missing value\n    property catArtist : missing value\n    property catAlbum : missing value\n    property catComposer : missing value\n    property catGenre : missing value\n    property catTrack : missing value\n    property catTracks : missing value\n    property catDisc : missing value\n    property catDiscs : missing value\n    property catAlbumArtist : missing value\n    property catYear : missing value\n    \n    -- Again, per macscripter, we'll set up bindings for the options\n    property pcatName : \"\"\n    property pcatArtist : \"\"\n    property pcatAlbum : \"\"\n    property pcatComposer : \"\"\n    property pcatGenre : \"\"\n    property pcatTrack : \"\"\n    property pcatTracks : \"\"\n    property pcatDisc : \"\"\n    property pcatDiscs : \"\"\n    property pcatAlbumArtist : \"\"\n    property pcatYear : \"\"\n    \n    -- Empty strings for each file name and location\n    property pEachName : \"\"\n    property pEachLocation : \"\"\n    \n    property these_titles : {}\n    property these_files : {}\n    property these_times: {}\n    property the_index: {}\n    property the_pipes: {}\n    \n    property theCounter : \"\"\n    property cmdPrefix : \"if [[ -r \/etc\/profile ]];then . \/etc\/profile;fi;if [[ -r ~\/.bashrc ]];then . ~\/.bashrc;fi;if [[ -r ~\/.bash_profile ]];then . ~\/.bash_profile;fi;\"\n    \n    on awakeFromNib()\n        --\n        -- Check for FFMPEG and MP4v2\n        --\n        -- (This works, but it's ugly!)\n        --\n        --\n        try\n            do shell script cmdPrefix & \" if [ -x \\\"`\/usr\/bin\/which ffmpeg`\\\" ];then exit 0;else exit 1;fi\"\n        on error number error_number\n            display dialog \"You must install FFMPEG and MP4v2 to continue. \\n\\nYou may have to install Xcode Command Line Tools and Homebrew first. If you continue, we'll attempt to install them for you if they are not already present. \\n\\nIf you have already installed FFMPEG and MP4v2, ensure that they are in your bash path.\" buttons {\"Quit\",\"Install\"} default button 2\n            If button returned of result is \"Install\" then\n                try\n                    tell application \"Terminal\"\n                        -- TODO: This should be cleaner -- Terminal in front, only one window, focus back to the cat'er afterwards\n                        set newTab to do script cmdPrefix & \"if [[ -x `which brew` ]];then brew install ffmpeg;else \/usr\/bin\/ruby -e \\\"$(\/usr\/bin\/curl -fsSL https:\/\/raw.github.com\/Homebrew\/homebrew\/go\/install)\\\";brew install ffmpeg mp4v2;fi\"\n                        delay 4\n                        repeat\n                            delay 0.1\n                            if not busy of newTab then exit repeat\n                        end repeat\n                    end tell\n                     -- TODO: This needs a better test, i.e., check if ffmpeg is actually accessible on the path\n                    display dialog \"FFMPEG was successfully installed\"\n                    -- TODO: This should actually work! (Bring us back to the foreground)\n                    activate current application\n                on error number error_number\n                    display dialog \"FFMPEG did not successfully install\"\n                end try\n            end If\n            If button returned of result is \"Quit\" then\n                -- Fix!\n                current application's NSApp's terminate()\n            end If\n        end try\n    end awakeFromNib\n\n\n    on btnGetTracks_(sender)\n        -- Code to add iTunes tracks to our list\n        -- via http:\/\/dougscripts.com\/itunes\/itinfo\/info02.php and http:\/\/www.randomsequence.com\/articles\/applescript-to-send-selected-itunes-tracks-using-mail\/\n        tell application \"iTunes\"\n            set these_titles to {}\n            set these_times to {}\n            set these_files to {}\n            set the_index to {}\n            if selection is not {} then -- there ARE tracks selected...\n                set mySelection to selection\n                set i to 1\n                repeat with aTrack in mySelection\n                    if class of aTrack is file track then\n                        set end of these_titles to ((name of aTrack) as string)\n                        set end of these_times to ((time of aTrack) as string)\n                        set end of these_files to (posix path of (get location of aTrack))\n                        set end of the_index to (count of these_titles)\n                        -- Get metadata from the first track\n                        if i is 1 then\n                            set pcatArtist to ((artist of aTrack) as string)\n                            set pcatAlbum to ((album of aTrack) as string)\n                            set pcatComposer to ((composer of aTrack) as string)\n                            set pcatGenre to ((genre of aTrack) as string)\n                            set pcatDisc to ((disc number of aTrack) as string)\n                            set pcatDiscs to ((disc count of aTrack) as string)\n                            set pcatAlbumArtist to ((album artist of aTrack) as string)\n                            set pcatYear to ((year of aTrack) as string)\n                        end if\n                        set i to (i + 1)\n                    end if\n                end repeat\n            end if\n        end tell\n        -- Display the songs to be concatenated\n        -- via http:\/\/stackoverflow.com\/questions\/25537750\/setstringvalue-with-applescript-list\n        set olddelimeters to AppleScript's text item delimiters\n        set AppleScript's text item delimiters to \"\\n\"\n        set disp_titles to these_titles as string\n        trackTable's setStringValue_(disp_titles)\n        set AppleScript's text item delimiters to olddelimeters\n        -- Update the default metadata\n        catArtist's setStringValue_(pcatArtist)\n        catAlbum's setStringValue_(pcatAlbum)\n        catComposer's setStringValue_(pcatComposer)\n        catGenre's setStringValue_(pcatGenre)\n        catDisc's setStringValue_(pcatDisc)\n        catDiscs's setStringValue_(pcatDiscs)\n        catAlbumArtist's setStringValue_(pcatAlbumArtist)\n        catYear's setStringValue_(pcatYear)\n    end btnGetTracks_\n\n    on btnConcatenate_(sender)\n        -- Update the metadata variables with the user's input\n        set pcatName to catName's stringValue()\n        set pcatArtist to catArtist's stringValue()\n        set pcatAlbum to catAlbum's stringValue()\n        set pcatComposer to catComposer's stringValue()\n        set pcatGenre to catGenre's stringValue()\n        set pcatTrack to catTrack's stringValue()\n        set pcatTracks to catTracks's stringValue()\n        set pcatDisc to catDisc's stringValue()\n        set pcatDiscs to catDiscs's stringValue()\n        set pcatAlbumArtist to catAlbumArtist's stringValue()\n        set pcatYear to catYear's stringValue()\n        set the_pipes to {}\n        repeat with theIndex in the_index\n            -- TODO: Needs error checking!\n            -- TODO: We need to check what kind of audio files we have, then adjust accordingly\n            do shell script (cmdPrefix & \"ffmpeg -i \\\"\" & (item theIndex of these_files as text) & \"\\\" -c copy -bsf:v h264_mp4toannexb -f mpegts \/private\/tmp\/concat\" & theIndex & \".ts 2> \/dev\/null\" as text)\n            log (\"Processed file number\" & theIndex) as text\n            set end of the_pipes to (\"\/private\/tmp\/concat\" & theIndex & \".ts\" as text)\n        end repeat\n        -- Run the actual concatenation command in ffmpeg (for mp4\/AAC files only!)\n        -- via https:\/\/trac.ffmpeg.org\/wiki\/How%20to%20concatenate%20(join,%20merge)%20media%20files\n        set olddelimeters to AppleScript's text item delimiters\n        set AppleScript's text item delimiters to \"|\"\n        set disp_thepipes to the_pipes as string\n        do shell script (cmdPrefix & \"ffmpeg -f mpegts -i \\\"concat:\" & (disp_thepipes as text) & \"\\\" -c copy -bsf:a aac_adtstoasc \/private\/tmp\/cat.mp4\")\n        set AppleScript's text item delimiters to olddelimeters\n        -- Now let's create the chapter file\n        repeat with theIndex in the_index\n            if theIndex < 2 then\n                do shell script (\"\/bin\/echo \\\"00:00:00.000 \" & (item theIndex of these_titles as text) & \"\\\" > \/private\/tmp\/cat.chapters.txt\" as text)\n                set theCounter to (do shell script (cmdPrefix & \"ffprobe -loglevel panic -show_streams \/private\/tmp\/concat\" & (theIndex as text) & \".ts | egrep -m 1 'duration=[0-9]+\\\\.' | sed 's\/duration=\\\\([0-9]*[0-9]\\\\.[0-9]*\\\\)\/\\\\1\/'\" as text) as string)\n                set theCounter to (do shell script (\"\/bin\/echo $(\/usr\/bin\/printf %.$2f $(\/bin\/echo \\\"`\/usr\/bin\/printf %.3f \" & theCounter & \"` * 1000\\\" | \/usr\/bin\/bc))\") as string)\n            else\n                set theDateStamp to do shell script (cmdPrefix & \"t=\"& (theCounter as text) & \";((msec=t%1000, t\/=1000, sec=t%60, t\/=60, min=t%60, hrs=t\/60));timestamp=$(printf \\\"%02d:%02d:%02d.%03d\\\" $hrs $min $sec $msec);\/bin\/echo $timestamp\" as text)\n                do shell script (\"\/bin\/echo \\\"\" & (theDateStamp as text) & \" \" & (item theIndex of these_titles as text) & \"\\\" >> \/private\/tmp\/cat.chapters.txt\" as text)\n                set theNewCounter to do shell script ((cmdPrefix & \"ffprobe -loglevel panic -show_streams \/private\/tmp\/concat\" & (theIndex as text) & \".ts | egrep -m 1 'duration=[0-9]+\\\\.' | sed 's\/duration=\\\\([0-9]*[0-9]\\\\.[0-9]*\\\\)\/\\\\1\/'\" as text) as string)\n                set theNewCounter to do shell script (\"\/bin\/echo $(\/usr\/bin\/printf %.$2f $(\/bin\/echo \\\"`\/usr\/bin\/printf %.3f \" & theNewCounter & \"` * 1000\\\" | \/usr\/bin\/bc))\") as string\n                log \"theNewCounter is \" & theNewCounter\n                set theCounter to (theCounter + theNewCounter)\n                log (\"Post-addition, theCounter is \" & theCounter) as text\n            end if\n        end repeat\n        -- Chapterize cat.mp4\n        do shell script (cmdPrefix & \"mp4chaps -i \/private\/tmp\/cat.mp4\" as text)\n        -- Add tags\n        do shell script (cmdPrefix & \"mp4tags -song \\\"\" & pcatName & \"\\\" -album \\\"\" &  pcatAlbum & \"\\\" -artist \\\"\" &  pcatArtist & \"\\\" -writer \\\"\" &  pcatComposer & \"\\\" -genre \\\"\" &  pcatGenre & \"\\\" -track \\\"\" &  pcatTrack & \"\\\" -tracks \\\"\" &  pcatTracks & \"\\\" -disk \\\"\" &  pcatDisc & \"\\\" -disks \\\"\" &  pcatDiscs & \"\\\" -albumartist \\\"\" & pcatAlbumArtist & \"\\\" -year \\\"\" & pcatYear & \"\\\" \/private\/tmp\/cat.mp4\" as text)\n        -- Clean up\n        do shell script \"\/bin\/rm \/private\/tmp\/concat* \/private\/tmp\/cat.chapters.txt #\/private\/tmp\/cat.mp4\"\n        set theCounter to \"\"\n    end btnConcatenate_\n\n\n\ton applicationWillFinishLaunching_(aNotification)\n\t\t-- Insert code here to initialize your application before any files are opened\n\tend applicationWillFinishLaunching_\n\n\ton applicationShouldTerminate_(sender)\n\t\t-- Insert code here to do any housekeeping before your application quits\n\t\treturn current application's NSTerminateNow\n\tend applicationShouldTerminate_\n\nend script","new_contents":"--\n--  DASAppDelegate.applescript\n--  itunes-concatenator\n--\n--  Created by David Schlachter on 2014-08-26.\n--  Copyright (c) 2014 Red Eft Software. All rights reserved.\n--\n\n-- via http:\/\/macscripter.net\/viewtopic.php?pid=173787 ; apparently needed for using arrays\n\nscript DASAppDelegate\n\tproperty parent : class \"NSObject\"\n\t\n    global these_files, these_times, these_titles, the_index, the_pipes, theCounter, cmdPrefix\n    \n\t-- IBOutlets\n\tproperty window : missing value\n    property trackTable : missing value\n    property catName : missing value\n    property catArtist : missing value\n    property catAlbum : missing value\n    property catComposer : missing value\n    property catGenre : missing value\n    property catTrack : missing value\n    property catTracks : missing value\n    property catDisc : missing value\n    property catDiscs : missing value\n    property catAlbumArtist : missing value\n    property catYear : missing value\n    \n    -- Again, per macscripter, we'll set up bindings for the options\n    property pcatName : \"\"\n    property pcatArtist : \"\"\n    property pcatAlbum : \"\"\n    property pcatComposer : \"\"\n    property pcatGenre : \"\"\n    property pcatTrack : \"\"\n    property pcatTracks : \"\"\n    property pcatDisc : \"\"\n    property pcatDiscs : \"\"\n    property pcatAlbumArtist : \"\"\n    property pcatYear : \"\"\n    \n    -- Empty strings for each file name and location\n    property pEachName : \"\"\n    property pEachLocation : \"\"\n    \n    property these_titles : {}\n    property these_files : {}\n    property these_times: {}\n    property the_index: {}\n    property the_pipes: {}\n    \n    property theCounter : \"\"\n    property cmdPrefix : \"if [[ -r \/etc\/profile ]];then . \/etc\/profile;fi;if [[ -r ~\/.bashrc ]];then . ~\/.bashrc;fi;if [[ -r ~\/.bash_profile ]];then . ~\/.bash_profile;fi;\"\n    \n    on awakeFromNib()\n        --\n        -- Check for FFMPEG and MP4v2\n        --\n        -- (This works, but it's ugly!)\n        --\n        --\n        try\n            do shell script cmdPrefix & \" if [ -x \\\"`\/usr\/bin\/which ffmpeg`\\\" ];then exit 0;else exit 1;fi\"\n        on error number error_number\n            display dialog \"You must install FFMPEG and MP4v2 to continue. \\n\\nYou may have to install Xcode Command Line Tools and Homebrew first. If you continue, we'll attempt to install them for you if they are not already present. \\n\\nIf you have already installed FFMPEG and MP4v2, ensure that they are in your bash path.\" buttons {\"Quit\",\"Install\"} default button 2\n            If button returned of result is \"Install\" then\n                try\n                    tell application \"Terminal\"\n                        -- TODO: This should be cleaner -- Terminal in front, only one window, focus back to the cat'er afterwards\n                        set newTab to do script cmdPrefix & \"if [[ -x `which brew` ]];then brew install ffmpeg;else \/usr\/bin\/ruby -e \\\"$(\/usr\/bin\/curl -fsSL https:\/\/raw.github.com\/Homebrew\/homebrew\/go\/install)\\\";brew install ffmpeg mp4v2;fi\"\n                        delay 4\n                        repeat\n                            delay 0.1\n                            if not busy of newTab then exit repeat\n                        end repeat\n                    end tell\n                     -- TODO: This needs a better test, i.e., check if ffmpeg is actually accessible on the path\n                    display dialog \"FFMPEG was successfully installed\"\n                    -- TODO: This should actually work! (Bring us back to the foreground)\n                    activate current application\n                on error number error_number\n                    display dialog \"FFMPEG did not successfully install\"\n                end try\n            end If\n            If button returned of result is \"Quit\" then\n                -- Fix!\n                current application's NSApp's terminate()\n            end If\n        end try\n    end awakeFromNib\n\n\n    on btnGetTracks_(sender)\n        -- Code to add iTunes tracks to our list\n        -- via http:\/\/dougscripts.com\/itunes\/itinfo\/info02.php and http:\/\/www.randomsequence.com\/articles\/applescript-to-send-selected-itunes-tracks-using-mail\/\n        tell application \"iTunes\"\n            set these_titles to {}\n            set these_times to {}\n            set these_files to {}\n            set the_index to {}\n            if selection is not {} then -- there ARE tracks selected...\n                set mySelection to selection\n                set i to 1\n                repeat with aTrack in mySelection\n                    if class of aTrack is file track then\n                        set end of these_titles to ((name of aTrack) as string)\n                        set end of these_times to ((time of aTrack) as string)\n                        set end of these_files to (posix path of (get location of aTrack))\n                        set end of the_index to (count of these_titles)\n                        -- Get metadata from the first track\n                        if i is 1 then\n                            set pcatArtist to ((artist of aTrack) as string)\n                            set pcatAlbum to ((album of aTrack) as string)\n                            set pcatComposer to ((composer of aTrack) as string)\n                            set pcatGenre to ((genre of aTrack) as string)\n                            set pcatDisc to ((disc number of aTrack) as string)\n                            set pcatDiscs to ((disc count of aTrack) as string)\n                            set pcatAlbumArtist to ((album artist of aTrack) as string)\n                            set pcatYear to ((year of aTrack) as string)\n                        end if\n                        set i to (i + 1)\n                    end if\n                end repeat\n            end if\n        end tell\n        -- Display the songs to be concatenated\n        -- via http:\/\/stackoverflow.com\/questions\/25537750\/setstringvalue-with-applescript-list\n        set olddelimeters to AppleScript's text item delimiters\n        set AppleScript's text item delimiters to \"\\n\"\n        set disp_titles to these_titles as string\n        trackTable's setStringValue_(disp_titles)\n        set AppleScript's text item delimiters to olddelimeters\n        -- Update the default metadata\n        catArtist's setStringValue_(pcatArtist)\n        catAlbum's setStringValue_(pcatAlbum)\n        catComposer's setStringValue_(pcatComposer)\n        catGenre's setStringValue_(pcatGenre)\n        catDisc's setStringValue_(pcatDisc)\n        catDiscs's setStringValue_(pcatDiscs)\n        catAlbumArtist's setStringValue_(pcatAlbumArtist)\n        catYear's setStringValue_(pcatYear)\n    end btnGetTracks_\n\n    on btnConcatenate_(sender)\n        -- Update the metadata variables with the user's input\n        set pcatName to catName's stringValue()\n        set pcatArtist to catArtist's stringValue()\n        set pcatAlbum to catAlbum's stringValue()\n        set pcatComposer to catComposer's stringValue()\n        set pcatGenre to catGenre's stringValue()\n        set pcatTrack to catTrack's stringValue()\n        set pcatTracks to catTracks's stringValue()\n        set pcatDisc to catDisc's stringValue()\n        set pcatDiscs to catDiscs's stringValue()\n        set pcatAlbumArtist to catAlbumArtist's stringValue()\n        set pcatYear to catYear's stringValue()\n        set the_pipes to {}\n        repeat with theIndex in the_index\n            -- TODO: Needs error checking!\n            -- TODO: We need to check what kind of audio files we have, then adjust accordingly\n            do shell script (cmdPrefix & \"ffmpeg -i \\\"\" & (item theIndex of these_files as text) & \"\\\" -c copy -bsf:v h264_mp4toannexb -f mpegts \/private\/tmp\/concat\" & theIndex & \".ts 2> \/dev\/null\" as text)\n            log (\"Processed file number\" & theIndex) as text\n            set end of the_pipes to (\"\/private\/tmp\/concat\" & theIndex & \".ts\" as text)\n        end repeat\n        -- Run the actual concatenation command in ffmpeg (for mp4\/AAC files only!)\n        -- via https:\/\/trac.ffmpeg.org\/wiki\/How%20to%20concatenate%20(join,%20merge)%20media%20files\n        set olddelimeters to AppleScript's text item delimiters\n        set AppleScript's text item delimiters to \"|\"\n        set disp_thepipes to the_pipes as string\n        do shell script (cmdPrefix & \"ffmpeg -f mpegts -i \\\"concat:\" & (disp_thepipes as text) & \"\\\" -c copy -bsf:a aac_adtstoasc \/private\/tmp\/cat.mp4\")\n        set AppleScript's text item delimiters to olddelimeters\n        -- Now let's create the chapter file\n        repeat with theIndex in the_index\n            if theIndex < 2 then\n                do shell script (\"\/bin\/echo \\\"00:00:00.000 \" & (item theIndex of these_titles as text) & \"\\\" > \/private\/tmp\/cat.chapters.txt\" as text)\n                set theCounter to (do shell script (cmdPrefix & \"ffprobe -loglevel panic -show_streams \/private\/tmp\/concat\" & (theIndex as text) & \".ts | egrep -m 1 'duration=[0-9]+\\\\.' | sed 's\/duration=\\\\([0-9]*[0-9]\\\\.[0-9]*\\\\)\/\\\\1\/'\" as text) as string)\n                set theCounter to (do shell script (\"\/bin\/echo $(\/usr\/bin\/printf %.$2f $(\/bin\/echo \\\"`\/usr\/bin\/printf %.3f \" & theCounter & \"` * 1000\\\" | \/usr\/bin\/bc))\") as string)\n            else\n                set theDateStamp to do shell script (cmdPrefix & \"t=\"& (theCounter as text) & \";((msec=t%1000, t\/=1000, sec=t%60, t\/=60, min=t%60, hrs=t\/60));timestamp=$(printf \\\"%02d:%02d:%02d.%03d\\\" $hrs $min $sec $msec);\/bin\/echo $timestamp\" as text)\n                do shell script (\"\/bin\/echo \\\"\" & (theDateStamp as text) & \" \" & (item theIndex of these_titles as text) & \"\\\" >> \/private\/tmp\/cat.chapters.txt\" as text)\n                set theNewCounter to do shell script ((cmdPrefix & \"ffprobe -loglevel panic -show_streams \/private\/tmp\/concat\" & (theIndex as text) & \".ts | egrep -m 1 'duration=[0-9]+\\\\.' | sed 's\/duration=\\\\([0-9]*[0-9]\\\\.[0-9]*\\\\)\/\\\\1\/'\" as text) as string)\n                set theNewCounter to do shell script (\"\/bin\/echo $(\/usr\/bin\/printf %.$2f $(\/bin\/echo \\\"`\/usr\/bin\/printf %.3f \" & theNewCounter & \"` * 1000\\\" | \/usr\/bin\/bc))\") as string\n                log \"theNewCounter is \" & theNewCounter\n                set theCounter to (theCounter + theNewCounter)\n                log (\"Post-addition, theCounter is \" & theCounter) as text\n            end if\n        end repeat\n        -- Chapterize cat.mp4\n        do shell script (cmdPrefix & \"mp4chaps -i \/private\/tmp\/cat.mp4\" as text)\n        -- Add tags\n        do shell script (cmdPrefix & \"mp4tags -song \\\"\" & pcatName & \"\\\" -album \\\"\" &  pcatAlbum & \"\\\" -artist \\\"\" &  pcatArtist & \"\\\" -writer \\\"\" &  pcatComposer & \"\\\" -genre \\\"\" &  pcatGenre & \"\\\" -track \\\"\" &  pcatTrack & \"\\\" -tracks \\\"\" &  pcatTracks & \"\\\" -disk \\\"\" &  pcatDisc & \"\\\" -disks \\\"\" &  pcatDiscs & \"\\\" -albumartist \\\"\" & pcatAlbumArtist & \"\\\" -year \\\"\" & pcatYear & \"\\\" \/private\/tmp\/cat.mp4\" as text)\n        -- Add the finished track to iTunes\n        do shell script \"\/bin\/mv \/private\/tmp\/cat.mp4 \/private\/tmp\/cat.m4a\"\n        tell application \"iTunes\"\n            try\n                add \"\/private\/tmp\/cat.mp4\"\n            end try\n        end tell\n        -- Clean up\n        do shell script \"\/bin\/rm \/private\/tmp\/concat* \/private\/tmp\/cat.chapters.txt \/private\/tmp\/cat.mp4\"\n        set theCounter to \"\"\n    end btnConcatenate_\n\n\n\ton applicationWillFinishLaunching_(aNotification)\n\t\t-- Insert code here to initialize your application before any files are opened\n\tend applicationWillFinishLaunching_\n\n\ton applicationShouldTerminate_(sender)\n\t\t-- Insert code here to do any housekeeping before your application quits\n\t\treturn current application's NSTerminateNow\n\tend applicationShouldTerminate_\n\nend script","subject":"Add track to iTunes","message":"Add track to iTunes\n","lang":"AppleScript","license":"bsd-2-clause","repos":"davidschlachter\/itunes-concatenator,davidschlachter\/itunes-concatenator"}
{"commit":"a49fa74918e96daff665a11b12a8b55fac3f2da5","old_file":"tools\/slauncher\/slauncher_helper.app\/Contents\/Resources\/Scripts\/main.scpt","new_file":"tools\/slauncher\/slauncher_helper.app\/Contents\/Resources\/Scripts\/main.scpt","old_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0002i\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0007\u0000\b\r\u0000\u0007\u0000\u0003I\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u000b\u0000\u001e0\u0000\rgetparentpath\u0000\rGetParentPath\u0002\u0000\t\u0000\u0002\u0000\n\r\u0000\n\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00120\u0000\u0007thefile\u0000\u0007theFile\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\b\u0000\u0002O\u0000\u0001\u0000\u0000\u0000\n\u0000\u000b\u0000\f\r\u0000\u000b\u0000\u0001L\u0000\u0000\u0000\u0004\u0000\t\u0000\r\r\u0000\r\u0000\u0002n\u0000\u0000\u0000\u0004\u0000\b\u0000\u000e\u0000\u000f\r\u0000\u000e\u0000\u0001m\u0000\u0000\u0000\u0005\u0000\u0007\n\u0000\u0004\nctnr\r\u0000\u000f\u0000\u0001o\u0000\u0000\u0000\u0004\u0000\u0005\u000b\u0000\u00120\u0000\u0007thefile\u0000\u0007theFile\r\u0000\f\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0010\u000f\u0000\u0010\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000MACS\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001Z\u0000\u0002\u0000\u0001\u0004Home\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000<\u063fH+\u0000\u0000\u0000\u0000\u0001-\nFinder.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u01df1t\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u0000=I?\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u01df\u0000\u0000\u0000\u0001\u0000\f\u0000\u0000\u0001-\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000+Home:System:Library:CoreServices:Finder.app\u0000\u0000\u000e\u0000\u0016\u0000\n\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\n\u0000\u0004\u0000H\u0000o\u0000m\u0000e\u0000\u0012\u0000&System\/Library\/CoreServices\/Finder.app\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000\u0011\u0000\u0012\r\u0000\u0011\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0012\u0000\u0002\u0000\u0013\u0000\u0014\r\u0000\u0013\u0000\u0002i\u0000\u0000\u0000\u0004\u0000\u0007\u0000\u0015\u0000\u0016\r\u0000\u0015\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0017\n\u0000\u0018.GURLGURLnull\u0000\u0000TEXT\r\u0000\u0017\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00140\u0000\bthis_url\u0000\bthis_URL\u0002\u0000\u0000\r\u0000\u0016\u0000\u0001k\u0000\u0000\u0000\u0000\u0000^\u0000\u0018\u0002\u0000\u0018\u0000\u0002\u0000\u0019\u0000\u001a\r\u0000\u0019\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u001b\u0000\u001c\u0001\u0000\u0000\f\u0000\u001b\u00000\u0000* display dialog \"handling url \" & this_URL\u0000\u0002\u0000\u0000\u000e\u0000\u001c\u0000\u0001\u0000\u001d\u0011\u0000\u001d\u0000T\u0000 \u0000d\u0000i\u0000s\u0000p\u0000l\u0000a\u0000y\u0000 \u0000d\u0000i\u0000a\u0000l\u0000o\u0000g\u0000 \u0000\"\u0000h\u0000a\u0000n\u0000d\u0000l\u0000i\u0000n\u0000g\u0000 \u0000u\u0000r\u0000l\u0000 \u0000\"\u0000 \u0000&\u0000 \u0000t\u0000h\u0000i\u0000s\u0000_\u0000U\u0000R\u0000L\u0002\u0000\u001a\u0000\u0002\u0000\u001e\u0000\u001f\r\u0000\u001e\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u0000 \u0000!\u0001\u0000\u0000\f\u0000 \u00000\u0000* try running with release mode, then debug\u0000\u0002\u0000\u0000\u000e\u0000!\u0000\u0001\u0000\"\u0011\u0000\"\u0000T\u0000 \u0000t\u0000r\u0000y\u0000 \u0000r\u0000u\u0000n\u0000n\u0000i\u0000n\u0000g\u0000 \u0000w\u0000i\u0000t\u0000h\u0000 \u0000r\u0000e\u0000l\u0000e\u0000a\u0000s\u0000e\u0000 \u0000m\u0000o\u0000d\u0000e\u0000,\u0000 \u0000t\u0000h\u0000e\u0000n\u0000 \u0000d\u0000e\u0000b\u0000u\u0000g\u0002\u0000\u001f\u0000\u0002\u0000#\u0000$\r\u0000#\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u0000%\u0000&\u0001\u0000\u0000\f\u0000%\u00009\u00003 the installed path for the slauncher_helper.app is\u0000\u0002\u0000\u0000\u000e\u0000&\u0000\u0001\u0000'\u0011\u0000'\u0000f\u0000 \u0000t\u0000h\u0000e\u0000 \u0000i\u0000n\u0000s\u0000t\u0000a\u0000l\u0000l\u0000e\u0000d\u0000 \u0000p\u0000a\u0000t\u0000h\u0000 \u0000f\u0000o\u0000r\u0000 \u0000t\u0000h\u0000e\u0000 \u0000s\u0000l\u0000a\u0000u\u0000n\u0000c\u0000h\u0000e\u0000r\u0000_\u0000h\u0000e\u0000l\u0000p\u0000e\u0000r\u0000.\u0000a\u0000p\u0000p\u0000 \u0000i\u0000s\u0002\u0000$\u0000\u0002\u0000(\u0000)\r\u0000(\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u0000*\u0000+\u0001\u0000\u0000\f\u0000*\u00002\u0000,  base_dir\/lib\/sirikata\/slauncher_helper.app\u0000\u0002\u0000\u0000\u000e\u0000+\u0000\u0001\u0000,\u0011\u0000,\u0000X\u0000 \u0000 \u0000b\u0000a\u0000s\u0000e\u0000_\u0000d\u0000i\u0000r\u0000\/\u0000l\u0000i\u0000b\u0000\/\u0000s\u0000i\u0000r\u0000i\u0000k\u0000a\u0000t\u0000a\u0000\/\u0000s\u0000l\u0000a\u0000u\u0000n\u0000c\u0000h\u0000e\u0000r\u0000_\u0000h\u0000e\u0000l\u0000p\u0000e\u0000r\u0000.\u0000a\u0000p\u0000p\u0002\u0000)\u0000\u0002\u0000-\u0000.\r\u0000-\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u0000\/\u00000\u0001\u0000\u0000\f\u0000\/\u0000,\u0000& but we need to run the wrapper binary\u0000\u0002\u0000\u0000\u000e\u00000\u0000\u0001\u00001\u0011\u00001\u0000L\u0000 \u0000b\u0000u\u0000t\u0000 \u0000w\u0000e\u0000 \u0000n\u0000e\u0000e\u0000d\u0000 \u0000t\u0000o\u0000 \u0000r\u0000u\u0000n\u0000 \u0000t\u0000h\u0000e\u0000 \u0000w\u0000r\u0000a\u0000p\u0000p\u0000e\u0000r\u0000 \u0000b\u0000i\u0000n\u0000a\u0000r\u0000y\u0002\u0000.\u0000\u0002\u00002\u00003\r\u00002\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u00004\u00005\u0001\u0000\u0000\f\u00004\u0000\u001d\u0000\u0017  basedir\/bin\/slauncher\u0000\u0002\u0000\u0000\u000e\u00005\u0000\u0001\u00006\u0011\u00006\u0000.\u0000 \u0000 \u0000b\u0000a\u0000s\u0000e\u0000d\u0000i\u0000r\u0000\/\u0000b\u0000i\u0000n\u0000\/\u0000s\u0000l\u0000a\u0000u\u0000n\u0000c\u0000h\u0000e\u0000r\u0002\u00003\u0000\u0002\u00007\u00008\r\u00007\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u00009\u0000:\u0001\u0000\u0000\f\u00009\u00007\u00001 so we get a base path, then construct full paths\u0000\u0002\u0000\u0000\u000e\u0000:\u0000\u0001\u0000;\u0011\u0000;\u0000b\u0000 \u0000s\u0000o\u0000 \u0000w\u0000e\u0000 \u0000g\u0000e\u0000t\u0000 \u0000a\u0000 \u0000b\u0000a\u0000s\u0000e\u0000 \u0000p\u0000a\u0000t\u0000h\u0000,\u0000 \u0000t\u0000h\u0000e\u0000n\u0000 \u0000c\u0000o\u0000n\u0000s\u0000t\u0000r\u0000u\u0000c\u0000t\u0000 \u0000f\u0000u\u0000l\u0000l\u0000 \u0000p\u0000a\u0000t\u0000h\u0000s\u0002\u00008\u0000\u0002\u0000<\u0000=\r\u0000<\u0000\u0002r\u0000\u0000\u0000\u0000\u0000\u0007\u0000>\u0000?\r\u0000>\u0000\u0003l\u0000\u0005\u0000\u0000\u0000\u0005\u0000@\r\u0000@\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0005\u0000A\n\u0000\u0018.earsffdralis\u0000\u0000\u0000\u0000\u0000\u0000 \u0000afdr\r\u0000A\u0000\u0000f\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000?\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u000b0\u0000\u0007my_path\u0000\u0000\u0002\u0000=\u0000\u0002\u0000B\u0000C\r\u0000B\u0000\u0002r\u0000\u0000\u0000\b\u0000\u0010\u0000D\u0000E\r\u0000D\u0000\u0003I\u0000\u0000\u0000\b\u0000\u000e\u0000F\u000b\u0000\u001e0\u0000\rgetparentpath\u0000\rGetParentPath\u0002\u0000F\u0000\u0002\u0000G\r\u0000G\u0000\u0001o\u0000\u0000\u0000\t\u0000\n\u000b\u0000\u000b0\u0000\u0007my_path\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000E\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00150\u0000\u0011lib_sirikata_path\u0000\u0000\u0002\u0000C\u0000\u0002\u0000H\u0000I\r\u0000H\u0000\u0002r\u0000\u0000\u0000\u0011\u0000\u0019\u0000J\u0000K\r\u0000J\u0000\u0003I\u0000\u0000\u0000\u0011\u0000\u0017\u0000L\u000b\u0000\u001e0\u0000\rgetparentpath\u0000\rGetParentPath\u0002\u0000L\u0000\u0002\u0000M\r\u0000M\u0000\u0001o\u0000\u0000\u0000\u0012\u0000\u0013\u000b\u0000\u00150\u0000\u0011lib_sirikata_path\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000K\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\f0\u0000\blib_path\u0000\u0000\u0002\u0000I\u0000\u0002\u0000N\u0000O\r\u0000N\u0000\u0002r\u0000\u0000\u0000\u001a\u0000\"\u0000P\u0000Q\r\u0000P\u0000\u0003I\u0000\u0000\u0000\u001a\u0000 \u0000R\u000b\u0000\u001e0\u0000\rgetparentpath\u0000\rGetParentPath\u0002\u0000R\u0000\u0002\u0000S\r\u0000S\u0000\u0001o\u0000\u0000\u0000\u001b\u0000\u001c\u000b\u0000\f0\u0000\blib_path\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000Q\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\r0\u0000\tbase_path\u0000\u0000\u0002\u0000O\u0000\u0002\u0000T\u0000U\r\u0000T\u0000\u0002r\u0000\u0000\u0000#\u0000,\u0000V\u0000W\r\u0000V\u0000\u0003l\u0000\u0005\u0000#\u0000*\u0000X\r\u0000X\u0000\u0002n\u0000\u0000\u0000#\u0000*\u0000Y\u0000Z\r\u0000Y\u0000\u00011\u0000\u0000\u0000(\u0000*\n\u0000\u0004\npsxp\r\u0000Z\u0000\u0003l\u0000\u0005\u0000#\u0000(\u0000[\r\u0000[\u0000\u0002b\u0000\u0000\u0000#\u0000(\u0000\\\u0000]\r\u0000\\\u0000\u0003l\u0000\u0005\u0000#\u0000&\u0000^\r\u0000^\u0000\u0002c\u0000\u0000\u0000#\u0000&\u0000_\u0000`\r\u0000_\u0000\u0001o\u0000\u0000\u0000#\u0000$\u000b\u0000\r0\u0000\tbase_path\u0000\u0000\r\u0000`\u0000\u0001m\u0000\u0000\u0000$\u0000%\n\u0000\u0004\nctxt\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000]\u0000\u0001m\u0000\u0000\u0000&\u0000'\u0000a\u000e\u0000a\u0000\u0001\u0000b\u0011\u0000b\u0000\b\u0000b\u0000i\u0000n\u0000:\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000W\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\u0012installed_bin_path\u0000\u0000\u0002\u0000U\u0000\u0002\u0000c\r\u0000c\u0000\u0003Q\u0000\u0000\u0000-\u0000^\u0000d\u0000e\u0000f\r\u0000d\u0000\u0001k\u0000\u0000\u00000\u0000;\u0000g\u0002\u0000g\u0000\u0002\u0000h\u0000i\r\u0000h\u0000\u0003l\u0000\u0001\u00000\u00000\u0000j\u0000k\u0001\u0000\u0000\f\u0000j\u0000B\u0000< installed version: slauncher_helper.app is in lib\/sirikata\/\u0000\u0002\u0000\u0000\u000e\u0000k\u0000\u0001\u0000l\u0011\u0000l\u0000x\u0000 \u0000i\u0000n\u0000s\u0000t\u0000a\u0000l\u0000l\u0000e\u0000d\u0000 \u0000v\u0000e\u0000r\u0000s\u0000i\u0000o\u0000n\u0000:\u0000 \u0000s\u0000l\u0000a\u0000u\u0000n\u0000c\u0000h\u0000e\u0000r\u0000_\u0000h\u0000e\u0000l\u0000p\u0000e\u0000r\u0000.\u0000a\u0000p\u0000p\u0000 \u0000i\u0000s\u0000 \u0000i\u0000n\u0000 \u0000l\u0000i\u0000b\u0000\/\u0000s\u0000i\u0000r\u0000i\u0000k\u0000a\u0000t\u0000a\u0000\/\u0002\u0000i\u0000\u0002\u0000m\u0000n\r\u0000m\u0000\u0003l\u0000\u0001\u00000\u00000\u0000o\u0000p\u0001\u0000\u0000\f\u0000o\u0000C\u0000= and the wrapper for slauncher that sets up DYLD_LIBRARY_PATH\u0000\u0002\u0000\u0000\u000e\u0000p\u0000\u0001\u0000q\u0011\u0000q\u0000z\u0000 \u0000a\u0000n\u0000d\u0000 \u0000t\u0000h\u0000e\u0000 \u0000w\u0000r\u0000a\u0000p\u0000p\u0000e\u0000r\u0000 \u0000f\u0000o\u0000r\u0000 \u0000s\u0000l\u0000a\u0000u\u0000n\u0000c\u0000h\u0000e\u0000r\u0000 \u0000t\u0000h\u0000a\u0000t\u0000 \u0000s\u0000e\u0000t\u0000s\u0000 \u0000u\u0000p\u0000 \u0000D\u0000Y\u0000L\u0000D\u0000_\u0000L\u0000I\u0000B\u0000R\u0000A\u0000R\u0000Y\u0000_\u0000P\u0000A\u0000T\u0000H\u0002\u0000n\u0000\u0002\u0000r\u0000s\r\u0000r\u0000\u0003l\u0000\u0001\u00000\u00000\u0000t\u0000u\u0001\u0000\u0000\f\u0000t\u0000\u0011\u0000\u000b is in bin\/\u0000\u0002\u0000\u0000\u000e\u0000u\u0000\u0001\u0000v\u0011\u0000v\u0000\u0016\u0000 \u0000i\u0000s\u0000 \u0000i\u0000n\u0000 \u0000b\u0000i\u0000n\u0000\/\u0002\u0000s\u0000\u0002\u0000w\r\u0000w\u0000\u0002r\u0000\u0000\u00000\u0000;\u0000x\u0000y\r\u0000x\u0000\u0003I\u0000\u0002\u00000\u00009\u0000z\n\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\r\u0000z\u0000\u0002b\u0000\u0000\u00000\u00005\u0000{\u0000|\r\u0000{\u0000\u0002b\u0000\u0000\u00000\u00003\u0000}\u0000~\r\u0000}\u0000\u0001o\u0000\u0000\u00000\u00001\u000b\u0000\u00160\u0000\u0012installed_bin_path\u0000\u0000\r\u0000~\u0000\u0001m\u0000\u0000\u00001\u00002\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000 \u0000s\u0000l\u0000a\u0000u\u0000n\u0000c\u0000h\u0000e\u0000r\u0000 \u0000-\u0000-\u0000u\u0000r\u0000i\u0000=\r\u0000|\u0000\u0001o\u0000\u0000\u00003\u00004\u000b\u0000\u00140\u0000\bthis_url\u0000\bthis_URL\u0002\u0000\u0000\r\u0000y\u0000\u00011\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0004\nrslt\u0002\u0000\u0000\r\u0000e\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000f\u0000\u0003Q\u0000\u0000\u0000C\u0000^\u0000\u0000\u0000\r\u0000\u0000\u0002r\u0000\u0000\u0000F\u0000Q\u0000\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000F\u0000O\u0000\n\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\r\u0000\u0000\u0002b\u0000\u0000\u0000F\u0000K\u0000\u0000\r\u0000\u0000\u0002b\u0000\u0000\u0000F\u0000I\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000F\u0000G\u000b\u0000\u00160\u0000\u0012installed_bin_path\u0000\u0000\r\u0000\u0000\u0001m\u0000\u0000\u0000G\u0000H\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000$\u0000s\u0000l\u0000a\u0000u\u0000n\u0000c\u0000h\u0000e\u0000r\u0000_\u0000d\u0000 \u0000-\u0000-\u0000u\u0000r\u0000i\u0000=\r\u0000\u0000\u0001o\u0000\u0000\u0000I\u0000J\u000b\u0000\u00140\u0000\bthis_url\u0000\bthis_URL\u0002\u0000\u0000\r\u0000\u0000\u00011\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0004\nrslt\r\u0000\u0000\u0003R\u0000\u0000\u0000\u0000\u0000\u0000\n\u0000\u0018.ascrerr ****\u0000\u0000\u0000\u0000\u0000\u0000\u0000****\u0001\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000Y\u0000^\u0000\n\u0000\u0018.sysodlogaskr\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000TEXT\r\u0000\u0000\u0001m\u0000\u0000\u0000Y\u0000Z\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000<\u0000C\u0000o\u0000u\u0000l\u0000d\u0000n\u0000'\u0000t\u0000 \u0000r\u0000u\u0000n\u0000 \u0000s\u0000l\u0000a\u0000u\u0000n\u0000c\u0000h\u0000e\u0000r\u0000 \u0000b\u0000i\u0000n\u0000a\u0000r\u0000y\u0000.\u0002\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0014\u0000\u0002\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0004\u0000\u0000\u0000\u0001\u0000\u0000\u0010\u0000\u0000\u0002\u000b\u0000\u001e0\u0000\rgetparentpath\u0000\rGetParentPath\n\u0000\u0018.GURLGURLnull\u0000\u0000TEXT\u000e\u0000\u0000\u0007\u0010\u0000\b\u0000\u0000\u000b\u0000\u001e0\u0000\rgetparentpath\u0000\rGetParentPath\u000e\u0000\u0002\u0004\u0000\u0003\u0000\u0001\u000e\u0000\u0000\u0001\u0000\u000b\u0000\u00120\u0000\u0007thefile\u0000\u0007theFile\u0002\u0000\u0000\u0010\u0000\u0000\u0001\u000b\u0000\u00120\u0000\u0007thefile\u0000\u0007theFile\u0010\u0000\u0000\u0002\u0000\u0010\n\u0000\u0004\nctnr\u0011\u0000\u000b\u0012\u0000\u0007,E\u000fU\u000f\u000e\u0000\u0000\u0007\u0010\u0000\u0016\u0000\u0000\n\u0000\u0018.GURLGURLnull\u0000\u0000TEXT\u000b\u0000\u00140\u0000\bthis_url\u0000\bthis_URL\u0002\u0000\u0000\u0010\u0000\u0000\u0006\u000b\u0000\u00140\u0000\bthis_url\u0000\bthis_URL\u000b\u0000\u000b0\u0000\u0007my_path\u0000\u0000\u000b\u0000\u00150\u0000\u0011lib_sirikata_path\u0000\u0000\u000b\u0000\f0\u0000\blib_path\u0000\u0000\u000b\u0000\r0\u0000\tbase_path\u0000\u0000\u000b\u0000\u00160\u0000\u0012installed_bin_path\u0000\u0000\u0010\u0000\u0000\r\u0000a\u0000\u0000\u0000\n\u0000\u0018.earsffdralis\u0000\u0000\u0000\u0000\u0000\u0000 \u0000afdr\u000b\u0000\u001e0\u0000\rgetparentpath\u0000\rGetParentPath\n\u0000\u0004\nctxt\n\u0000\u0004\npsxp\n\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\n\u0000\u0004\nrslt\u0001\u0000\u0000\u0002\u0000\u0000\n\u0000\u0018.sysodlogaskr\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000TEXT\u0011\u0000_)j\f\u0000\u0000EO*k+\u0000\u0001EO*k+\u0000\u0001EO*k+\u0000\u0001EO&%,EO\u0014\u0000\u0010%%j\f\u0000\u0006EW\u0000\"X\u0000\b\u0000\t\u0014\u0000\u0010%%j\f\u0000\u0006EW\u0000\fX\u0000\b\u0000\tj\f\u0000\f\u000fascr\u0000\u0001\u0000\f\u07ad","new_contents":"FasdUAS 1.101.10\u000e\u0000\u0000\u0000\u0004\u000f\u0000\u0001\u0000\u0002\u0000\u0003\u0001\u0000\u0000\r\u0000\u0001\u0000\u0001k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0004\u0002\u0000\u0004\u0000\u0002\u0000\u0005\u0000\u0006\r\u0000\u0005\u0000\u0002i\u0000\u0000\u0000\u0000\u0000\u0003\u0000\u0007\u0000\b\r\u0000\u0007\u0000\u0003I\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t\u000b\u0000\u001e0\u0000\rgetparentpath\u0000\rGetParentPath\u0002\u0000\t\u0000\u0002\u0000\n\r\u0000\n\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00120\u0000\u0007thefile\u0000\u0007theFile\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\b\u0000\u0002O\u0000\u0001\u0000\u0000\u0000\n\u0000\u000b\u0000\f\r\u0000\u000b\u0000\u0001L\u0000\u0000\u0000\u0004\u0000\t\u0000\r\r\u0000\r\u0000\u0002n\u0000\u0000\u0000\u0004\u0000\b\u0000\u000e\u0000\u000f\r\u0000\u000e\u0000\u0001m\u0000\u0000\u0000\u0005\u0000\u0007\n\u0000\u0004\nctnr\r\u0000\u000f\u0000\u0001o\u0000\u0000\u0000\u0004\u0000\u0005\u000b\u0000\u00120\u0000\u0007thefile\u0000\u0007theFile\r\u0000\f\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u0010\u000f\u0000\u0010\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000MACS\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001Z\u0000\u0002\u0000\u0001\u0004Home\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000<\u063fH+\u0000\u0000\u0000\u0000\u0001-\nFinder.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u01df1t\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u0000=I?\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u01df\u0000\u0000\u0000\u0001\u0000\f\u0000\u0000\u0001-\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000+Home:System:Library:CoreServices:Finder.app\u0000\u0000\u000e\u0000\u0016\u0000\n\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\n\u0000\u0004\u0000H\u0000o\u0000m\u0000e\u0000\u0012\u0000&System\/Library\/CoreServices\/Finder.app\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u0000\u0006\u0000\u0002\u0000\u0011\u0000\u0012\r\u0000\u0011\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0012\u0000\u0002\u0000\u0013\u0000\u0014\r\u0000\u0013\u0000\u0002i\u0000\u0000\u0000\u0004\u0000\u0007\u0000\u0015\u0000\u0016\r\u0000\u0015\u0000\u0003I\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0017\u000b\u0000\u001a0\u0000\u000bcheckexists\u0000\u000bCheckExists\u0002\u0000\u0017\u0000\u0002\u0000\u0018\r\u0000\u0018\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00120\u0000\u0007thefile\u0000\u0007theFile\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0016\u0000\u0002O\u0000\u0001\u0000\u0000\u0000\u000b\u0000\u0019\u0000\u001a\r\u0000\u0019\u0000\u0001L\u0000\u0000\u0000\u0004\u0000\n\u0000\u001b\r\u0000\u001b\u0000\u0003I\u0000\u0002\u0000\u0004\u0000\t\u0000\u001c\n\u0000\u0018.coredoexbool\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000obj \r\u0000\u001c\u0000\u0001o\u0000\u0000\u0000\u0004\u0000\u0005\u000b\u0000\u00120\u0000\u0007thefile\u0000\u0007theFile\u0002\u0000\u0000\r\u0000\u001a\u0000\u0001m\u0000\u0000\u0000\u0000\u0000\u0001\u0000\u001d\u000f\u0000\u001d\u0001\b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000MACS\u0000\u0002\u0001\u0000alis\u0000\u0000\u0000\u0000\u0001Z\u0000\u0002\u0000\u0001\u0004Home\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000<\u063fH+\u0000\u0000\u0000\u0000\u0001-\nFinder.app\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u01df1t\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\t \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\fCoreServices\u0000\u0010\u0000\b\u0000\u0000=I?\u0000\u0000\u0000\u0011\u0000\b\u0000\u0000\u01df\u0000\u0000\u0000\u0001\u0000\f\u0000\u0000\u0001-\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0002\u0000+Home:System:Library:CoreServices:Finder.app\u0000\u0000\u000e\u0000\u0016\u0000\n\u0000F\u0000i\u0000n\u0000d\u0000e\u0000r\u0000.\u0000a\u0000p\u0000p\u0000\u000f\u0000\n\u0000\u0004\u0000H\u0000o\u0000m\u0000e\u0000\u0012\u0000&System\/Library\/CoreServices\/Finder.app\u0000\u0013\u0000\u0001\/\u0000\u0000\u0000\u0002\u0000\u0014\u0000\u0002\u0000\u001e\u0000\u001f\r\u0000\u001e\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u001f\u0000\u0002\u0000 \u0000!\r\u0000 \u0000\u0002i\u0000\u0000\u0000\b\u0000\u000b\u0000\"\u0000#\r\u0000\"\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0000\u0000$\n\u0000\u0018.GURLGURLnull\u0000\u0000TEXT\r\u0000$\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00140\u0000\bthis_url\u0000\bthis_URL\u0002\u0000\u0000\r\u0000#\u0000\u0001k\u0000\u0000\u0000\u0000\u0000j\u0000%\u0002\u0000%\u0000\u0002\u0000&\u0000'\r\u0000&\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u0000(\u0000)\u0001\u0000\u0000\f\u0000(\u00000\u0000* display dialog \"handling url \" & this_URL\u0000\u0002\u0000\u0000\u000e\u0000)\u0000\u0001\u0000*\u0011\u0000*\u0000T\u0000 \u0000d\u0000i\u0000s\u0000p\u0000l\u0000a\u0000y\u0000 \u0000d\u0000i\u0000a\u0000l\u0000o\u0000g\u0000 \u0000\"\u0000h\u0000a\u0000n\u0000d\u0000l\u0000i\u0000n\u0000g\u0000 \u0000u\u0000r\u0000l\u0000 \u0000\"\u0000 \u0000&\u0000 \u0000t\u0000h\u0000i\u0000s\u0000_\u0000U\u0000R\u0000L\u0002\u0000'\u0000\u0002\u0000+\u0000,\r\u0000+\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u0000-\u0000.\u0001\u0000\u0000\f\u0000-\u00000\u0000* try running with release mode, then debug\u0000\u0002\u0000\u0000\u000e\u0000.\u0000\u0001\u0000\/\u0011\u0000\/\u0000T\u0000 \u0000t\u0000r\u0000y\u0000 \u0000r\u0000u\u0000n\u0000n\u0000i\u0000n\u0000g\u0000 \u0000w\u0000i\u0000t\u0000h\u0000 \u0000r\u0000e\u0000l\u0000e\u0000a\u0000s\u0000e\u0000 \u0000m\u0000o\u0000d\u0000e\u0000,\u0000 \u0000t\u0000h\u0000e\u0000n\u0000 \u0000d\u0000e\u0000b\u0000u\u0000g\u0002\u0000,\u0000\u0002\u00000\u00001\r\u00000\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u00002\u00003\u0001\u0000\u0000\f\u00002\u00009\u00003 the installed path for the slauncher_helper.app is\u0000\u0002\u0000\u0000\u000e\u00003\u0000\u0001\u00004\u0011\u00004\u0000f\u0000 \u0000t\u0000h\u0000e\u0000 \u0000i\u0000n\u0000s\u0000t\u0000a\u0000l\u0000l\u0000e\u0000d\u0000 \u0000p\u0000a\u0000t\u0000h\u0000 \u0000f\u0000o\u0000r\u0000 \u0000t\u0000h\u0000e\u0000 \u0000s\u0000l\u0000a\u0000u\u0000n\u0000c\u0000h\u0000e\u0000r\u0000_\u0000h\u0000e\u0000l\u0000p\u0000e\u0000r\u0000.\u0000a\u0000p\u0000p\u0000 \u0000i\u0000s\u0002\u00001\u0000\u0002\u00005\u00006\r\u00005\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u00007\u00008\u0001\u0000\u0000\f\u00007\u00002\u0000,  base_dir\/lib\/sirikata\/slauncher_helper.app\u0000\u0002\u0000\u0000\u000e\u00008\u0000\u0001\u00009\u0011\u00009\u0000X\u0000 \u0000 \u0000b\u0000a\u0000s\u0000e\u0000_\u0000d\u0000i\u0000r\u0000\/\u0000l\u0000i\u0000b\u0000\/\u0000s\u0000i\u0000r\u0000i\u0000k\u0000a\u0000t\u0000a\u0000\/\u0000s\u0000l\u0000a\u0000u\u0000n\u0000c\u0000h\u0000e\u0000r\u0000_\u0000h\u0000e\u0000l\u0000p\u0000e\u0000r\u0000.\u0000a\u0000p\u0000p\u0002\u00006\u0000\u0002\u0000:\u0000;\r\u0000:\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u0000<\u0000=\u0001\u0000\u0000\f\u0000<\u0000,\u0000& but we need to run the wrapper binary\u0000\u0002\u0000\u0000\u000e\u0000=\u0000\u0001\u0000>\u0011\u0000>\u0000L\u0000 \u0000b\u0000u\u0000t\u0000 \u0000w\u0000e\u0000 \u0000n\u0000e\u0000e\u0000d\u0000 \u0000t\u0000o\u0000 \u0000r\u0000u\u0000n\u0000 \u0000t\u0000h\u0000e\u0000 \u0000w\u0000r\u0000a\u0000p\u0000p\u0000e\u0000r\u0000 \u0000b\u0000i\u0000n\u0000a\u0000r\u0000y\u0002\u0000;\u0000\u0002\u0000?\u0000@\r\u0000?\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u0000A\u0000B\u0001\u0000\u0000\f\u0000A\u0000\u001d\u0000\u0017  basedir\/bin\/slauncher\u0000\u0002\u0000\u0000\u000e\u0000B\u0000\u0001\u0000C\u0011\u0000C\u0000.\u0000 \u0000 \u0000b\u0000a\u0000s\u0000e\u0000d\u0000i\u0000r\u0000\/\u0000b\u0000i\u0000n\u0000\/\u0000s\u0000l\u0000a\u0000u\u0000n\u0000c\u0000h\u0000e\u0000r\u0002\u0000@\u0000\u0002\u0000D\u0000E\r\u0000D\u0000\u0003l\u0000\u0001\u0000\u0000\u0000\u0000\u0000F\u0000G\u0001\u0000\u0000\f\u0000F\u00007\u00001 so we get a base path, then construct full paths\u0000\u0002\u0000\u0000\u000e\u0000G\u0000\u0001\u0000H\u0011\u0000H\u0000b\u0000 \u0000s\u0000o\u0000 \u0000w\u0000e\u0000 \u0000g\u0000e\u0000t\u0000 \u0000a\u0000 \u0000b\u0000a\u0000s\u0000e\u0000 \u0000p\u0000a\u0000t\u0000h\u0000,\u0000 \u0000t\u0000h\u0000e\u0000n\u0000 \u0000c\u0000o\u0000n\u0000s\u0000t\u0000r\u0000u\u0000c\u0000t\u0000 \u0000f\u0000u\u0000l\u0000l\u0000 \u0000p\u0000a\u0000t\u0000h\u0000s\u0002\u0000E\u0000\u0002\u0000I\u0000J\r\u0000I\u0000\u0002r\u0000\u0000\u0000\u0000\u0000\u0007\u0000K\u0000L\r\u0000K\u0000\u0003l\u0000\u0005\u0000\u0000\u0000\u0005\u0000M\r\u0000M\u0000\u0003I\u0000\u0002\u0000\u0000\u0000\u0005\u0000N\n\u0000\u0018.earsffdralis\u0000\u0000\u0000\u0000\u0000\u0000 \u0000afdr\r\u0000N\u0000\u0000f\u0000\u0000\u0000\u0000\u0000\u0001\u0002\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000L\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u000b0\u0000\u0007my_path\u0000\u0000\u0002\u0000J\u0000\u0002\u0000O\u0000P\r\u0000O\u0000\u0002r\u0000\u0000\u0000\b\u0000\u0010\u0000Q\u0000R\r\u0000Q\u0000\u0003I\u0000\u0000\u0000\b\u0000\u000e\u0000S\u000b\u0000\u001e0\u0000\rgetparentpath\u0000\rGetParentPath\u0002\u0000S\u0000\u0002\u0000T\r\u0000T\u0000\u0001o\u0000\u0000\u0000\t\u0000\n\u000b\u0000\u000b0\u0000\u0007my_path\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000R\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00150\u0000\u0011lib_sirikata_path\u0000\u0000\u0002\u0000P\u0000\u0002\u0000U\u0000V\r\u0000U\u0000\u0002r\u0000\u0000\u0000\u0011\u0000\u0019\u0000W\u0000X\r\u0000W\u0000\u0003I\u0000\u0000\u0000\u0011\u0000\u0017\u0000Y\u000b\u0000\u001e0\u0000\rgetparentpath\u0000\rGetParentPath\u0002\u0000Y\u0000\u0002\u0000Z\r\u0000Z\u0000\u0001o\u0000\u0000\u0000\u0012\u0000\u0013\u000b\u0000\u00150\u0000\u0011lib_sirikata_path\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000X\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\f0\u0000\blib_path\u0000\u0000\u0002\u0000V\u0000\u0002\u0000[\u0000\\\r\u0000[\u0000\u0002r\u0000\u0000\u0000\u001a\u0000\"\u0000]\u0000^\r\u0000]\u0000\u0003I\u0000\u0000\u0000\u001a\u0000 \u0000_\u000b\u0000\u001e0\u0000\rgetparentpath\u0000\rGetParentPath\u0002\u0000_\u0000\u0002\u0000`\r\u0000`\u0000\u0001o\u0000\u0000\u0000\u001b\u0000\u001c\u000b\u0000\f0\u0000\blib_path\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000^\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\r0\u0000\tbase_path\u0000\u0000\u0002\u0000\\\u0000\u0002\u0000a\u0000b\r\u0000a\u0000\u0002r\u0000\u0000\u0000#\u0000*\u0000c\u0000d\r\u0000c\u0000\u0003l\u0000\u0005\u0000#\u0000(\u0000e\r\u0000e\u0000\u0002b\u0000\u0000\u0000#\u0000(\u0000f\u0000g\r\u0000f\u0000\u0003l\u0000\u0005\u0000#\u0000&\u0000h\r\u0000h\u0000\u0002c\u0000\u0000\u0000#\u0000&\u0000i\u0000j\r\u0000i\u0000\u0001o\u0000\u0000\u0000#\u0000$\u000b\u0000\r0\u0000\tbase_path\u0000\u0000\r\u0000j\u0000\u0001m\u0000\u0000\u0000$\u0000%\n\u0000\u0004\nctxt\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000g\u0000\u0001m\u0000\u0000\u0000&\u0000'\u0000k\u000e\u0000k\u0000\u0001\u0000l\u0011\u0000l\u0000\b\u0000b\u0000i\u0000n\u0000:\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000d\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\u0012installed_bin_path\u0000\u0000\u0002\u0000b\u0000\u0002\u0000m\u0000n\r\u0000m\u0000\u0003l\u0000\u0001\u0000+\u0000+\u0000o\u0000p\u0001\u0000\u0000\f\u0000o\u0000>\u00008 You need to be careful to get all the settings right to\u0000\u0002\u0000\u0000\u000e\u0000p\u0000\u0001\u0000q\u0011\u0000q\u0000p\u0000 \u0000Y\u0000o\u0000u\u0000 \u0000n\u0000e\u0000e\u0000d\u0000 \u0000t\u0000o\u0000 \u0000b\u0000e\u0000 \u0000c\u0000a\u0000r\u0000e\u0000f\u0000u\u0000l\u0000 \u0000t\u0000o\u0000 \u0000g\u0000e\u0000t\u0000 \u0000a\u0000l\u0000l\u0000 \u0000t\u0000h\u0000e\u0000 \u0000s\u0000e\u0000t\u0000t\u0000i\u0000n\u0000g\u0000s\u0000 \u0000r\u0000i\u0000g\u0000h\u0000t\u0000 \u0000t\u0000o\u0002\u0000n\u0000\u0002\u0000r\u0000s\r\u0000r\u0000\u0003l\u0000\u0001\u0000+\u0000+\u0000t\u0000u\u0001\u0000\u0000\f\u0000t\u0000?\u00009 make the shell script run in the background and let this\u0000\u0002\u0000\u0000\u000e\u0000u\u0000\u0001\u0000v\u0011\u0000v\u0000r\u0000 \u0000m\u0000a\u0000k\u0000e\u0000 \u0000t\u0000h\u0000e\u0000 \u0000s\u0000h\u0000e\u0000l\u0000l\u0000 \u0000s\u0000c\u0000r\u0000i\u0000p\u0000t\u0000 \u0000r\u0000u\u0000n\u0000 \u0000i\u0000n\u0000 \u0000t\u0000h\u0000e\u0000 \u0000b\u0000a\u0000c\u0000k\u0000g\u0000r\u0000o\u0000u\u0000n\u0000d\u0000 \u0000a\u0000n\u0000d\u0000 \u0000l\u0000e\u0000t\u0000 \u0000t\u0000h\u0000i\u0000s\u0002\u0000s\u0000\u0002\u0000w\u0000x\r\u0000w\u0000\u0003l\u0000\u0001\u0000+\u0000+\u0000y\u0000z\u0001\u0000\u0000\f\u0000y\u0000 \u0000\u001a script finish up and exit\u0000\u0002\u0000\u0000\u000e\u0000z\u0000\u0001\u0000{\u0011\u0000{\u00004\u0000 \u0000s\u0000c\u0000r\u0000i\u0000p\u0000t\u0000 \u0000f\u0000i\u0000n\u0000i\u0000s\u0000h\u0000 \u0000u\u0000p\u0000 \u0000a\u0000n\u0000d\u0000 \u0000e\u0000x\u0000i\u0000t\u0002\u0000x\u0000\u0002\u0000|\u0000}\r\u0000|\u0000\u0002r\u0000\u0000\u0000+\u0000.\u0000~\u0000\r\u0000~\u0000\u0001m\u0000\u0000\u0000+\u0000,\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000(\u0000 \u0000>\u0000 \u0000\/\u0000d\u0000e\u0000v\u0000\/\u0000n\u0000u\u0000l\u0000l\u0000 \u00002\u0000>\u0000&\u00001\u0000 \u0000&\u0000 \r\u0000\u0000\u0001o\u0000\u0000\u0000\u0000\u0000\u0000\u000b\u0000\u00160\u0000\u0012background_process\u0000\u0000\u0002\u0000}\u0000\u0002\u0000\r\u0000\u0000\u0004Z\u0000\u0000\u0000\/\u0000j\u0000\u0000\u0000\r\u0000\u0000\u0003I\u0000\u0000\u0000\/\u00007\u0000\u000b\u0000\u001a0\u0000\u000bcheckexists\u0000\u000bCheckExists\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0002b\u0000\u0000\u00000\u00003\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u00000\u00001\u000b\u0000\u00160\u0000\u0012installed_bin_path\u0000\u0000\r\u0000\u0000\u0001m\u0000\u0000\u00001\u00002\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0012\u0000s\u0000l\u0000a\u0000u\u0000n\u0000c\u0000h\u0000e\u0000r\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000:\u0000G\u0000\n\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\r\u0000\u0000\u0002b\u0000\u0000\u0000:\u0000C\u0000\u0000\r\u0000\u0000\u0002b\u0000\u0000\u0000:\u0000A\u0000\u0000\r\u0000\u0000\u0002b\u0000\u0000\u0000:\u0000?\u0000\u0000\r\u0000\u0000\u0003l\u0000\u0005\u0000:\u0000=\u0000\r\u0000\u0000\u0002n\u0000\u0000\u0000:\u0000=\u0000\u0000\r\u0000\u0000\u00011\u0000\u0000\u0000;\u0000=\n\u0000\u0004\npsxp\r\u0000\u0000\u0001o\u0000\u0000\u0000:\u0000;\u000b\u0000\u00160\u0000\u0012installed_bin_path\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000\u0000\u0001m\u0000\u0000\u0000=\u0000>\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000 \u0000s\u0000l\u0000a\u0000u\u0000n\u0000c\u0000h\u0000e\u0000r\u0000 \u0000-\u0000-\u0000u\u0000r\u0000i\u0000=\r\u0000\u0000\u0001o\u0000\u0000\u0000?\u0000@\u000b\u0000\u00140\u0000\bthis_url\u0000\bthis_URL\r\u0000\u0000\u0001o\u0000\u0000\u0000A\u0000B\u000b\u0000\u00160\u0000\u0012background_process\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0004Z\u0000\u0000\u0000J\u0000j\u0000\u0000\u0000\r\u0000\u0000\u0003I\u0000\u0000\u0000J\u0000R\u0000\u000b\u0000\u001a0\u0000\u000bcheckexists\u0000\u000bCheckExists\u0002\u0000\u0000\u0002\u0000\r\u0000\u0000\u0002b\u0000\u0000\u0000K\u0000N\u0000\u0000\r\u0000\u0000\u0001o\u0000\u0000\u0000K\u0000L\u000b\u0000\u00160\u0000\u0012installed_bin_path\u0000\u0000\r\u0000\u0000\u0001m\u0000\u0000\u0000L\u0000M\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000\u0016\u0000s\u0000l\u0000a\u0000u\u0000n\u0000c\u0000h\u0000e\u0000r\u0000_\u0000d\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000U\u0000b\u0000\n\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\r\u0000\u0000\u0002b\u0000\u0000\u0000U\u0000^\u0000\u0000\r\u0000\u0000\u0002b\u0000\u0000\u0000U\u0000\\\u0000\u0000\r\u0000\u0000\u0002b\u0000\u0000\u0000U\u0000Z\u0000\u0000\r\u0000\u0000\u0003l\u0000\u0005\u0000U\u0000X\u0000\r\u0000\u0000\u0002n\u0000\u0000\u0000U\u0000X\u0000\u0000\r\u0000\u0000\u00011\u0000\u0000\u0000V\u0000X\n\u0000\u0004\npsxp\r\u0000\u0000\u0001o\u0000\u0000\u0000U\u0000V\u000b\u0000\u00160\u0000\u0012installed_bin_path\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\r\u0000\u0000\u0001m\u0000\u0000\u0000X\u0000Y\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000$\u0000s\u0000l\u0000a\u0000u\u0000n\u0000c\u0000h\u0000e\u0000r\u0000_\u0000d\u0000 \u0000-\u0000-\u0000u\u0000r\u0000i\u0000=\r\u0000\u0000\u0001o\u0000\u0000\u0000Z\u0000[\u000b\u0000\u00140\u0000\bthis_url\u0000\bthis_URL\r\u0000\u0000\u0001o\u0000\u0000\u0000\\\u0000]\u000b\u0000\u00160\u0000\u0012background_process\u0000\u0000\u0002\u0000\u0000\u0002\u0000\u0000\r\u0000\u0000\u0003I\u0000\u0002\u0000e\u0000j\u0000\n\u0000\u0018.sysodlogaskr\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000TEXT\r\u0000\u0000\u0001m\u0000\u0000\u0000e\u0000f\u0000\u000e\u0000\u0000\u0001\u0000\u0011\u0000\u0000>\u0000C\u0000o\u0000u\u0000l\u0000d\u0000n\u0000'\u0000t\u0000 \u0000f\u0000i\u0000n\u0000d\u0000 \u0000s\u0000l\u0000a\u0000u\u0000n\u0000c\u0000h\u0000e\u0000r\u0000 \u0000b\u0000i\u0000n\u0000a\u0000r\u0000y\u0000.\u0002\u0000\u0000\u0002\u0000\u0000\u0002\u0000!\u0000\u0002\u0000\r\u0000\u0000\u0003l\u0000\u0002\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0001\u0000\u0000\u0002\u0000\u0000\u000e\u0000\u0002\u0000\u0000\u000f\u0010\u0000\u0003\u0000\u0005\u0000\u0000\u0000\u0000\u0001\u0000\u0000\u0010\u0000\u0000\u0003\u000b\u0000\u001e0\u0000\rgetparentpath\u0000\rGetParentPath\u000b\u0000\u001a0\u0000\u000bcheckexists\u0000\u000bCheckExists\n\u0000\u0018.GURLGURLnull\u0000\u0000TEXT\u000e\u0000\u0000\u0007\u0010\u0000\b\u0000\u0000\u000b\u0000\u001e0\u0000\rgetparentpath\u0000\rGetParentPath\u000e\u0000\u0002\u0004\u0000\u0003\u0000\u0001\u000e\u0000\u0000\u0001\u0000\u000b\u0000\u00120\u0000\u0007thefile\u0000\u0007theFile\u0002\u0000\u0000\u0010\u0000\u0000\u0001\u000b\u0000\u00120\u0000\u0007thefile\u0000\u0007theFile\u0010\u0000\u0000\u0002\u0000\u0010\n\u0000\u0004\nctnr\u0011\u0000\u000b\u0012\u0000\u0007,E\u000fU\u000f\u000e\u0000\u0000\u0007\u0010\u0000\u0016\u0000\u0000\u000b\u0000\u001a0\u0000\u000bcheckexists\u0000\u000bCheckExists\u000e\u0000\u0002\u0004\u0000\u0003\u0000\u0001\u000e\u0000\u0000\u0001\u0000\u000b\u0000\u00120\u0000\u0007thefile\u0000\u0007theFile\u0002\u0000\u0000\u0010\u0000\u0000\u0001\u000b\u0000\u00120\u0000\u0007thefile\u0000\u0007theFile\u0010\u0000\u0000\u0002\u0000\u001d\n\u0000\u0018.coredoexbool\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000obj \u0011\u0000\f\u0012\u0000\bj\f\u0000\u0001\u000fU\u000f\u000e\u0000\u0000\u0007\u0010\u0000#\u0000\u0000\n\u0000\u0018.GURLGURLnull\u0000\u0000TEXT\u000b\u0000\u00140\u0000\bthis_url\u0000\bthis_URL\u0002\u0000\u0000\u0010\u0000\u0000\u0007\u000b\u0000\u00140\u0000\bthis_url\u0000\bthis_URL\u000b\u0000\u000b0\u0000\u0007my_path\u0000\u0000\u000b\u0000\u00150\u0000\u0011lib_sirikata_path\u0000\u0000\u000b\u0000\f0\u0000\blib_path\u0000\u0000\u000b\u0000\r0\u0000\tbase_path\u0000\u0000\u000b\u0000\u00160\u0000\u0012installed_bin_path\u0000\u0000\u000b\u0000\u00160\u0000\u0012background_process\u0000\u0000\u0010\u0000\u0000\u000e\u0000k\u0000\u0000~\u0000}\u0000\u0000\u0000|\n\u0000\u0018.earsffdralis\u0000\u0000\u0000\u0000\u0000\u0000 \u0000afdr\u000b\u0000\u001e0\u0000\rgetparentpath\u0000\rGetParentPath\n\u0000\u0004\nctxt\u000b\u0000\u001a0\u0000\u000bcheckexists\u0000\u000bCheckExists\n~\u0000\u0004\npsxp\n}\u0000\u0018.sysoexecTEXT\u0000\u0000\u0000\u0000\u0000TEXT\n|\u0000\u0018.sysodlogaskr\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000TEXT\u0011\u0000k)j\f\u0000\u0000EO*k+\u0000\u0001EO*k+\u0000\u0001EO*k+\u0000\u0001EO&%EOEO*%k+\u0000\u0006\u001d\u0000\u0012,%%%j\f\u0000\tY\u0000\"*%k+\u0000\u0006\u001d\u0000\u0012,%%%j\f\u0000\tY\u0000\u0007j\f\u0000\r\u000f\u0000ascr\u0000\u0001\u0000\r\u07ad","subject":"Make slauncher_helper.app able to exit before the process it launches finishes.","message":"Make slauncher_helper.app able to exit before the process it launches finishes.\n\nslauncher_helper.app was relying on the 'do shell script'\nfunctionality to detect errors when launching slauncher. Instead, just\nfind the slauncher binary manually and assume we can get it to\nrun. Run the binary in the background so we don't tie the lifetimes of\nthe two apps.\n","lang":"AppleScript","license":"bsd-3-clause","repos":"sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata,sirikata\/sirikata"}
{"commit":"bef957feea5aa401f934bcc82e8227c010fc2e77","old_file":"Uninstall.applescript","new_file":"Uninstall.applescript","old_contents":"property stdout : \"\"\non run\n\tset newline to ASCII character 10\n\t\n\tset stdout to stdout & \"  shutdown TotalFinderCrashWatcher ...\" & newline\n\ttry\n\t\tdo shell script \"killall -SIGINT TotalFinderCrashWatcher\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    TotalFinderCrashWatcher was not running\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  shutdown Finder ...\" & newline\n\ttry\n\t\ttell application \"Finder\" to quit\n\ton error\n\t\tset stdout to stdout & \"    Finder was not running prior uninstallation\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.app from login items ...\" & newline\n\ttry\n\t\ttell application \"System Events\"\n\t\t\tget the name of every login item\n\t\t\tif login item \"TotalFinder.app\" exists then\n\t\t\t\tdelete login item \"TotalFinder.app\"\n\t\t\tend if\n\t\tend tell\n\ton error\n\t\tset stdout to stdout & \"    Encountered problems when removing TotalFinder.app from login items\"\n\tend try\n\t\n\t-- old version\n\tset stdout to stdout & \"  removing the old TotalFinder files (0.8.2 and earlier) ...\" & newline\n\ttry\n\t\tdo shell script \"sudo launchctl unload -w \\\"\/Library\/LaunchDaemons\/com.binaryage.echelon.launcher.plist\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -f \\\"\/Library\/LaunchDaemons\/com.binaryage.echelon.launcher.plist\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo kextunload \\\"\/System\/Library\/Extensions\/echelon.kext\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/System\/Library\/Extensions\/echelon.kext\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Library\/Application Support\/SIMBL\/Plugins\/TotalFinder.bundle\\\"\" with administrator privileges\n\tend try\n\t\n\t\n\t-- new version\n\tset stdout to stdout & \"  unload TotalFinder.kext ...\" & newline\n\ttry\n\t\tdo shell script \"sudo kextunload \\\"\/System\/Library\/Extensions\/TotalFinder.kext\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    TotalFinder.kext not loaded\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.app ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Applications\/TotalFinder.app\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Applications\/TotalFinder.app\" & newline\n\tend try\n\t\n\t\n\tset stdout to stdout & \"  remove TotalFinder.kext ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/System\/Library\/Extensions\/TotalFinder.kext\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/System\/Library\/Extensions\/TotalFinder.kext\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.osax ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Library\/ScriptingAdditions\/TotalFinder.osax\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Library\/ScriptingAdditions\/TotalFinder.osax\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  enable Finder animations again ...\" & newline\n\ttry\n\t\tdo shell script \"defaults write com.apple.finder DisableAllAnimations -bool false\" with administrator privileges\n\t\tdo shell script \"defaults write com.apple.finder AnimateWindowZoom -bool true\" with administrator privileges\n\t\tdo shell script \"defaults write com.apple.finder FXDisableFancyWindowTransition -bool false\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to enable animations back\" & newline\n\tend try\n\n\tset stdout to stdout & \"  hide system files in Finder again ...\" & newline\n\ttry\n\t\tdo shell script \"defaults write com.apple.finder AppleShowAllFiles -bool false\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    hide system files in Finder back\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  relaunch Finder ...\" & newline\n\ttry\n\t\ttell application \"Finder\" to launch\n\ton error\n\t\tset stdout to stdout & \"    failed to relaunch Finder\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"TotalFinder uninstallation done\" & newline\n\t\n\t-- at this point Finder should start cleanly and with no signs of TotalFinder\n\t-- you may check Events\/Replies tab to see if there were no issues with uninstallation\n\t\n\tstdout -- this is needed for platypus to display output in details window\nend run","new_contents":"property stdout : \"\"\non run\n\tset newline to ASCII character 10\n\t\n\tset stdout to stdout & \"  shutdown TotalFinderCrashWatcher ...\" & newline\n\ttry\n\t\tdo shell script \"killall -SIGINT TotalFinderCrashWatcher\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    TotalFinderCrashWatcher was not running\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  shutdown Finder ...\" & newline\n\ttry\n\t\ttell application \"Finder\" to quit\n\ton error\n\t\tset stdout to stdout & \"    Finder was not running prior uninstallation\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.app from login items ...\" & newline\n\ttry\n\t\ttell application \"System Events\"\n\t\t\t-- we created unnamed login item up to version 1.4.18 (TotalFinder.app is filename)\n\t\t\tif login item \"TotalFinder.app\" exists then\n\t\t\t\tdelete login item \"TotalFinder.app\"\n\t\t\tend if\n\t\t\t-- since 1.4.19 we are creating named login item \"TotalFinder\"\n\t\t\tif login item \"TotalFinder\" exists then\n\t\t\t\tdelete login item \"TotalFinder\"\n\t\t\tend if\n\t\tend tell\t\n\ton error\n\t\tset stdout to stdout & \"    Encountered problems when removing TotalFinder.app from login items\"\n\tend try\n\t\n\t-- old version\n\tset stdout to stdout & \"  removing the old TotalFinder files (0.8.2 and earlier) ...\" & newline\n\ttry\n\t\tdo shell script \"sudo launchctl unload -w \\\"\/Library\/LaunchDaemons\/com.binaryage.echelon.launcher.plist\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -f \\\"\/Library\/LaunchDaemons\/com.binaryage.echelon.launcher.plist\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo kextunload \\\"\/System\/Library\/Extensions\/echelon.kext\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/System\/Library\/Extensions\/echelon.kext\\\"\" with administrator privileges\n\tend try\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Library\/Application Support\/SIMBL\/Plugins\/TotalFinder.bundle\\\"\" with administrator privileges\n\tend try\n\t\n\t\n\t-- new version\n\tset stdout to stdout & \"  unload TotalFinder.kext ...\" & newline\n\ttry\n\t\tdo shell script \"sudo kextunload \\\"\/System\/Library\/Extensions\/TotalFinder.kext\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    TotalFinder.kext not loaded\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.app ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Applications\/TotalFinder.app\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Applications\/TotalFinder.app\" & newline\n\tend try\n\t\n\t\n\tset stdout to stdout & \"  remove TotalFinder.kext ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/System\/Library\/Extensions\/TotalFinder.kext\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/System\/Library\/Extensions\/TotalFinder.kext\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  remove TotalFinder.osax ...\" & newline\n\ttry\n\t\tdo shell script \"sudo rm -rf \\\"\/Library\/ScriptingAdditions\/TotalFinder.osax\\\"\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to remove \/Library\/ScriptingAdditions\/TotalFinder.osax\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  enable Finder animations again ...\" & newline\n\ttry\n\t\tdo shell script \"defaults write com.apple.finder DisableAllAnimations -bool false\" with administrator privileges\n\t\tdo shell script \"defaults write com.apple.finder AnimateWindowZoom -bool true\" with administrator privileges\n\t\tdo shell script \"defaults write com.apple.finder FXDisableFancyWindowTransition -bool false\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    unable to enable animations back\" & newline\n\tend try\n\n\tset stdout to stdout & \"  hide system files in Finder again ...\" & newline\n\ttry\n\t\tdo shell script \"defaults write com.apple.finder AppleShowAllFiles -bool false\" with administrator privileges\n\ton error\n\t\tset stdout to stdout & \"    hide system files in Finder back\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"  relaunch Finder ...\" & newline\n\ttry\n\t\ttell application \"Finder\" to launch\n\ton error\n\t\tset stdout to stdout & \"    failed to relaunch Finder\" & newline\n\tend try\n\t\n\tset stdout to stdout & \"TotalFinder uninstallation done\" & newline\n\t\n\t-- at this point Finder should start cleanly and with no signs of TotalFinder\n\t-- you may check Events\/Replies tab to see if there were no issues with uninstallation\n\t\n\tstdout -- this is needed for platypus to display output in details window\nend run","subject":"extend uninstaller to also remove named login item \"TotalFinder\"","message":"extend uninstaller to also remove named login item \"TotalFinder\"\n","lang":"AppleScript","license":"bsd-3-clause","repos":"binaryage\/totalfinder-installer"}
