Skip to content

Instantly share code, notes, and snippets.

@danharper
Forked from clooth/TimestampToDate.scpt
Last active October 8, 2015 10:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save danharper/e54ed4a9290265779b72 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 buttons { "Ok" } default button 1
end tell
return realDate
end run
@danharper
Copy link
Author

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