New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Terminal Command to open most recently modified .Numbers file ???


Post Reply New Thread Subscribe

 
Thread Tools
RiDE

 
RiDE's Avatar
 
Member Since: Sep 13, 2006
Location: Deep in the heart of Texas!
Posts: 3,559
RiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond repute
Mac Specs: Mac's

RiDE is offline
Anyone know a Terminal Command to open the most recently modified .Numbers file in a particular directory?
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,686
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is online now
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
Personal Twitter
QUOTE Thanks
McYukon

 
McYukon's Avatar
 
Member Since: May 14, 2009
Location: Near Whitehorse, Yukon
Posts: 2,053
McYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to beholdMcYukon is a splendid one to behold
Mac Specs: 2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9

McYukon is offline
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.
QUOTE Thanks
RiDE

 
RiDE's Avatar
 
Member Since: Sep 13, 2006
Location: Deep in the heart of Texas!
Posts: 3,559
RiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond reputeRiDE has a reputation beyond repute
Mac Specs: Mac's

RiDE is offline
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!!!
QUOTE Thanks

Post Reply New Thread Subscribe


« help needed to link up buttons on HUD Window to Applescript | Adding a fullscreen window from another project and customising »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Can't open Comic Life file Puffetta OS X - Apps and Games 2 11-12-2009 06:51 AM
open a terminal with top on startup HogsPogs OS X - Development and Darwin 1 07-24-2009 04:32 AM
iWeb cannot open file m.watson OS X - Apps and Games 0 07-07-2009 10:49 PM
Info.plist to *open* a file gamblor01 OS X - Development and Darwin 2 03-22-2009 11:00 PM
Not too pleased with new iMac JunMacTech Apple Desktops 14 12-05-2005 07:13 PM

All times are GMT -4. The time now is 09:49 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?