Created
June 28, 2019 10:52
-
-
Save skibitsky/262f01a068d9447b0157cd15849731c8 to your computer and use it in GitHub Desktop.
Hyper Terminal in Alfred
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on alfred_script(q) | |
write_to_file(q, "/Users/gleb/.hyper_plugins/hyperalfred.txt", false) | |
tell application "Hyper" to activate | |
end alfred_script | |
on write_to_file(this_data, target_file, append_data) | |
try | |
tell application "System Events" to exists file target_file | |
if not the result then do shell script "> " & quoted form of target_file | |
set the open_target_file to open for access target_file with write permission | |
if append_data is false then set eof of the open_target_file to 0 | |
write this_data to the open_target_file starting at eof | |
close access the open_target_file | |
return true | |
on error e | |
try | |
display dialog e | |
close access target_file | |
end try | |
return false | |
end try | |
end write_to_file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment