Jump to content

subsmile

Member
  • Posts

    1
  • Joined

  • Last visited

Everything posted by subsmile

  1. I'm just getting started with Alfred and scripting so please bear with me! The creator of Drafts has made an Alfred script to append to a file in Dropbox. I'm trying to figure out how to change the timestamp to the 24 hour format. I'd be very grateful if anyone would be kind enough to assist or point me in the right direction. Many thanks! EDIT: Apologies, I've just realised I've posted this in the wrong section... Here is the current script: # grab input text s = "{query}" # create insert value in template with timestamp tmp = "#{Time.now.strftime('%m-%d-%Y %I:%M %p')}\n#{s}" # path to file you wish to append... # folder path must exist, file will be created if it doesn't f = File.expand_path("~/Dropbox/Journal.txt") # open file in append mode and add the string open(f, 'a') do |f| f.puts tmp f.puts "\n" end
×
×
  • Create New...