Skip to content

Instantly share code, notes, and snippets.

@clooth
Created July 9, 2013 09:27
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save clooth/5955973 to your computer and use it in GitHub Desktop.
Applescript to display real date of selected timestamp
on run {input, parameters}
tell application "System Events"
set activeApp to name of first process whose frontmost is true
end tell
set _timestamp to (input as string)
tell application activeApp
set realDate to ((do shell script "date -r " & _timestamp) as string)
display dialog realDate
end tell
return realDate
end run
@danharper
Copy link

To use with a keyboard shortcut:

  1. Open Automator
  2. Create a new 'Service', which "receives selected text in any application"
  3. Drag 'Run Applescript' into the Workflow window, paste in the code
  4. Save as 'Unix Timestamp' (or something else unique)
  5. System Preferences > Keyboard > Keyboard Shortcuts > Services
  6. Find the service in the list (under 'Text') and add a shortcut for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment