Results 1 to 4 of 4
  1. #1

    RiDE's Avatar
    Member Since
    Sep 13, 2006
    Location
    Colorado
    Posts
    3,570
    Specs:
    Mac's
    Terminal Command to open most recently modified .Numbers file ???
    Anyone know a Terminal Command to open the most recently modified .Numbers file in a particular directory?

  2. #2

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    I can't help you right now but have you considered writing an applescript to do this? There may be something available if you look in the Numbers dictionary (I don't have Numbers so I can't look).

    EDIT: Don't listen to myself of about ten minutes ago.

    The ls command lists the files in a directory. According to the man page, the t switch will "sort by modification time" (man page). If you then used grep, you could probably limit the results to .Numbers files and have them print in order of last edited. So, something similar to:
    Code:
    ls -t | grep ".Numbers"
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  3. #3

    McYukon's Avatar
    Member Since
    May 14, 2009
    Location
    Near Whitehorse, Yukon
    Posts
    2,052
    Specs:
    2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
    I'm amazed, didn't think that I would manage it but I figured it out in about 30 minutes of trial and error.
    And believe me, there were lots of errors

    Code:
    cd ~/Desktop; open "`ls -t | grep .Numbers | head -1`"
    It's a bit picky about the file ending, the file extension needs to be visible in the finder and capitalization matters.
    Use the reputation system if a post helps you!
    Mac Forums IRC Channel - Help build it by hanging out with us
    The next sentence is true. The previous sentence is false.

  4. #4

    RiDE's Avatar
    Member Since
    Sep 13, 2006
    Location
    Colorado
    Posts
    3,570
    Specs:
    Mac's
    Quote Originally Posted by McYukon View Post
    I'm amazed, didn't think that I would manage it but I figured it out in about 30 minutes of trial and error.
    And believe me, there were lots of errors

    Code:
    cd ~/Desktop; open "`ls -t | grep .Numbers | head -1`"
    It's a bit picky about the file ending, the file extension needs to be visible in the finder and capitalization matters.
    That's perfect!!! the only tiny adjustment is Numbers.app extensions are lower-case (.numbers)

    Thank you both very much!!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Please Help! How to open my jar file without a terminal!?
    By System Networks in forum OS X - Operating System
    Replies: 0
    Last Post: 09-25-2012, 05:13 AM
  2. numbers :: open an existing file upon launch...
    By bacaandrew in forum OS X - Apps and Games
    Replies: 0
    Last Post: 03-16-2012, 12:29 PM
  3. How to add a user in file permission using terminal command?
    By iVega in forum OS X - Operating System
    Replies: 0
    Last Post: 01-06-2010, 12:14 PM
  4. open new terminal from command line
    By drjimmy42 in forum OS X - Operating System
    Replies: 0
    Last Post: 03-03-2009, 12:06 AM
  5. how to open eml file from terminal?
    By erv2 in forum OS X - Development and Darwin
    Replies: 3
    Last Post: 02-17-2006, 06:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •