Skip to content

Instantly share code, notes, and snippets.

View zsszatmari's full-sized avatar

Zsolt Szatmári zsszatmari

View GitHub Profile
@zsszatmari
zsszatmari / CreateNewFile.scpt
Created May 13, 2018 13:59
AppleScript for creating new file in Finder via right click menu
# intended for creating a new Service via Automator to create a new file in Finder
# fixed handling of already existing file
# borrowed from http://hints.macworld.com/article.php?story=20100509134904820, user mihassan
property defaultFileName : "newTextFile"
on run {input, parameters}
try
tell application "Finder" to set the sourceFolder to (folder of the front window) as alias
-- Instructions:
--
-- open Script Editor.app
-- paste this code
-- go to File > Export... File Format: Application, Options: Stay open after run handler.
-- Now you can just open the application you created
--
-- Code originally borrowed from http://forums.macrumors.com/threads/get-current-track-from-spotify-in-messages-status-applescript.1418925/
on idle