Skip to content

Instantly share code, notes, and snippets.

@skibitsky
Created June 28, 2019 10:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skibitsky/262f01a068d9447b0157cd15849731c8 to your computer and use it in GitHub Desktop.
Save skibitsky/262f01a068d9447b0157cd15849731c8 to your computer and use it in GitHub Desktop.
Hyper Terminal in Alfred
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