Select most recent file and display

I've been considerig this and I am closer to how I expect it to work
This is what I have so far but can't peice together just yet.
Get the current open folder window look for the last item if shot within the last 30 secs of the creation date, if shot within 30 secs then select/highlight the file and use system events to press keystroke y using cmd and option down.(to put it on the screen in full screen) Display for 15 secs, or if esc hit then wait for next file to arrive and so on.
If the window is closed of the current open folder then end applescript.
This is how far I have got but can't link the ideas together well.
set theWindow to name of front window of application "Finder"
set theWindow to name of front window of application "Finder"
set theFldr to path of theWindow
tell application "Finder"
          set theContents to sort items of theFldr by creation date
          set theLastimage to (contents of item 1 of theContents) as text
  --is it within the last 30 seconds?
  -- yes, then
          tell application "System Events"
  keystroke "y" using {command down, option down}
                    delay 15
  key code 53
  --then wait for arrival of next image. and repeat.
  --if theWindow is close end applescript.
          end tell
end tell

Hi,
If you don't want to use a folder action, try this :
try
      tell application "Finder" to set currFolder to name of front Finder window
on error
      return -- no Finder window
end try
set tDate to (current date) - 30
repeat
      set b to false
      tell application "Finder"
            set fWindows to Finder windows whose it's name is currFolder
            if (fWindows is not {}) then
                  set tWind to item 1 of fWindows
                  set nFiles to document files of tWind whose creation date > tDate -- get newer files
                  set tDate to (current date)
                  if nFiles is not {} then
                        reveal nFiles
                        my selectionfullScreen(currFolder, count nFiles)
                        set b to true
                  end if
            else
                  exit repeat -- quit the script, the current Folder is closed
            end if
      end tell
      if not b then delay 5 -- no recent files, wait 5 seconds
end repeat
on selectionfullScreen(tName, n)
      tell application "System Events"
            tell process "Finder"
                  set frontmost to true
                  keystroke "y" using {command down, option down}
                  repeat (15 * n) times
                        tell window 1 to if (exists) and (its title is tName) then return -- the user close QuickLook
                        delay 1
                  end repeat
                  tell window 1 to if (exists) and (its title is not tName) then key code 53 -- close QuickLook after (15 seconds X (number of images))
            end tell
      end tell
end selectionfullScreen

Similar Messages

  • Did the most recent update and now my TB Display turns off randomly on both my air and mini. I running  TB Firmware Version:     23.6

    did the most recent update and now my TB Display turns off randomly on both my air and mini. I running  TB Firmware Version:
    23.6

    When did you get this firmware version?  My TBD is at 22.2 and the TBD bus is at 23.4.  I thought I had the latest firmware.

  • When I sort by date added in Column View in Finder, how can I make the most recent files appear at the top of the list?(Mavericks)

    In 10.8, when I sorted Finder by date added or date created in column view, the most recent files would appear at the top of the list. Currently, this happens as it should in every single view mode EXCEPT column view (which is pretty much the only view I ever use). Currently, I have a folder with over 2000 files in it that date back to 2011, so now I have to scroll for like ten minutes just te get to files that were most recently added. Who in their right mind would want to sort by last modified with the oldest result listed FIRST? Ridiculous. I can't figure this out. Any help?

    Thanks for the reply leroydouglas! Unfurtunately this doesn't cause the column to be ordered correctly either. After selecting this option, the files seem to be ordered by label, and the most recently added file is somewhere in the middle of the list. I'd like it to be at the top, and have other files/folders descend in retrochronological order by their add date.
    Any other input from the community would be greatly appreciated, even if it's just confirming that this is/is not expected behavior. I'd be super bummed to find out that this IS expected behavior, as it's really counterintuitive and extremely inconvenient.
    Thanks again!

  • Full restore from Time Machine - how do I get most recent files back???

    Hi all,
    I've had some major problems with my hard-disk today (Disk Utility complaining about all sorts of things and not being able to repair them) so I thought I'll just wipe my disk and restore from back-up.
    But: when I was asked to choose a backup the most recent one was from 7th November. It said that only full backups are shown (and incremental backups are not shown...). Well, since I had no choice anymore, I selected the most recent one and hoped I could get things back again later. But I'm now struggling to find a decent way of doing this:
    All the more recent versions are on the time machine disk - I can see the files in the different folders. But in Time Machine itself, I cannot select any of the back-ups from between 7th November and now - they are shown to exist, but they are greyed out.
    Is there any way to return to my most recent state other than restoring the whole thing one-by-one from dozens of different folders?
    Any help would be greatly appreciated
    Thanks in advance!
    Sebastian

    Sebastian Hoffmann wrote:
    But: when I was asked to choose a backup the most recent one was from 7th November. It said that only full backups are shown (and incremental backups are not shown...).
    No, incomplete backups are not shown, including backups that failed, were cancelled, or were made with System files excluded. Other than that, all TM backups are, in effect, full ones.
    All the more recent versions are on the time machine disk - I can see the files in the different folders. But in Time Machine itself, I cannot select any of the back-ups from between 7th November and now - they are shown to exist, but they are greyed out.
    Is there any way to return to my most recent state other than restoring the whole thing one-by-one from dozens of different folders?
    Could you have renamed your internal HD on or about November 7? That's one possible explanation for what you're seeing. If so, TM would treat it as a separate disk: there would have been two disks listed in the pop-up menu above the list of available backups (item e. in the green box in #14 of the Frequently Asked Questions *User Tip* at the top of this forum).
    If that's a possibility, boot up from your SL Install disc again, and go through the process that far. If you find two disk names listed there, select the other one and see what dates are available. If you find your recent backups, do the restore again from one of them.
    If not, reboot normally, then try the +*Browse . . .+* Option, per #17 in the Frequently Asked Questions *User Tip* at the top of this forum.
    Restore what you need from the latest backup you can find that way. That will get the most recent version of everything. You can't restore your home folder that way, but you can restore each sub-folder and it's contents that way.

  • I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?

    I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?
    Attachments:
    try2.txt ‏2 KB
    read_array.vi ‏21 KB

    The problem is in the delimiters in your text file. By default, Read From Spreadsheet File.vi expects a tab delimited file. You can specify a delimiter (like a space), but Read From Spreadsheet File.vi has a problem with repeated delimiters: if you specify a single space as a delimiter and Read From Spreadsheet File.vi finds two spaces back-to-back, it stops reading that line. Your file (as I got it from your earlier post) is delimited by 4 spaces.
    Here are some of your choices to fix your problem.
    1. Change the source file to a tab delimited file. Your VI will then run as is.
    2. Change the source file to be delimited by a single space (rather than 4), then wire a string constant containing one space to the delimiter input of Read From Spreadsheet File.vi.
    3. Wire a string constant containing 4 spaces to the delimiter input of Read From Spreadsheet File.vi. Then your text file will run as is.
    Depending on where your text file comes from (see more comments below), I'd vote for choice 1: a tab delimited text file. It's the most common text output of spreadsheet programs.
    Comments for choices 1 and 2: Where does the text file come from? Is it automatically generated or manually generated? Will it be generated multiple times or just once? If it's manually generated or generated just once, you can use any text editor to change 4 spaces to a tab or to a single space. Note: if you want to change it to a tab delimited file, you can't enter a tab directly into a box in the search & replace dialog of many programs like notepad, but you can do a cut and paste. Before you start your search and replace (just in the text window of the editor), press tab. A tab character will be entered. Press Shift-LeftArrow (not Backspace) to highlight the tab character. Press Ctrl-X to cut the tab character. Start your search and replace (Ctrl-H in notepad in Windows 2000). Click into the Find What box. Enter four spaces. Click into the Replace With box. Press Ctrl-V to paste the tab character. And another thing: older versions of notepad don't have search and replace. Use any editor or word processor that does.

  • Cannot see most recent files when attaching

    I've had this problem for a while. Currently using OS X Mavericks, 10.9.4 (latest version) and Mail 7.3 (also latest build).  Saved a file to Documents, then opened Mail and attempted to attach it. Finder window opens, but my most recent files viewed are "last 7 days," with "today" being completely missing. I can open the Finder independently, the files show, I can open the files, send the file as an attachment from the Finder itself. But for quite some time, I don't see my most recent files (like today's files) in Finder when first opening Mail and attempting to attach something from a new message or message reply. Very frustrating.
    Anyone know what's going on here? I've experienced this before, but this is the first I realized that it seems as if it only happens when I am searching for a file to attach, and not when I open the Finder directly. I know there are workarounds, but I would just like to be able to do this simple thing, and for the life of me, I cannot do it. Not sure how long this has been going on, but I think it was happening in Mavericks all along, I just didn't connect the dots.
    Thanks.

    I can't duplicate the issue. What type of file is it? Is it saved locally, in the cloud, external drive?

  • SSRS 2008 R2 is extremely slow. The query runs in less than a second in the dataset designer but if you try to view the report it takes over 10 minutes. I have read this is a bug in SSRS 2008 R2. We installed the most recent patches and service packs.

    SSRS 2008 R2 is extremely slow.  The query runs in less than a second in the dataset designer but if you try to view the report it takes over 10 minutes.  I have read this is a bug in SSRS 2008 R2.  We installed the most recent patches and
    service packs.  Nothing we've done so far has fixed it and I see that I'm not the only person with this problem.  However I don't see any answers either.

    Hi Kim Sharp,
    According to your description that when you view the report it is extremely slow in SSRS 2008 R2 but it is very fast when execute the query in dataset designer, right?
    I have tested on my local environment and can‘t reproduce the issue. Obviously, it is the performance issue, rendering performance can be affected by a combination of factors that include hardware, number of concurrent users accessing reports, the amount
    of data in a report, design of the report, and output format. If you have parameters in your report which contains many values in the list, the bad performance as you mentioned is an known issue on 2008 R2 and already have the hotfix:
    http://support.microsoft.com/kb/2276203
    Any issue after applying the update, I recommend you that submit a feedback at https://connect.microsoft.com/SQLServer/ 
    If you don’t have, you can do some action to improve the performance when designing the report. Because how you create and update reports affects how fast the report renders.
    Actually, the Report Server ExecutionLog2  view contains reports performance data. You could make use of below query to see where the report processing time is being spent:
    After you determine whether the delay time is in data retrieval, report processing, or report rendering:
    use ReportServer
    SELECT TOP 10 ReportPath,parameters,
    TimeDataRetrieval + TimeProcessing + TimeRendering as [total time],
    TimeDataRetrieval, TimeProcessing, TimeRendering,
    ByteCount, [RowCount],Source, AdditionalInfo
    FROM ExecutionLog2
    ORDER BY Timestart DESC
    Use below methods to help troubleshoot issues according to the above query result :
    Troubleshooting Reports: Report Performance
    Besides this, you could also follow these articles for more information about this issue:
    Report Server Catalog Best Practices
    Performance, Snapshots, Caching (Reporting Services)
    Similar thread for your reference:
    SSRS slow
    Any problem, please feel free to ask
    Regards
    Vicky Liu

  • Select "most recent" records in abap

    Hi
    how can I select the most recent records in a table by using the abap select statement.
    Example: The 100 rows with the "highest" (most recent) sequence-numbers in a table with documents.
    somehow like this:
        SELECT "most recent" * FROM draw
        INTO TABLE gt_doklist
        UP TO 100 ROWS
        where ...
    Has anybody an idea?
    Thanks in advance,
    Willi

    Actually I believe that all the answers are wrong.
    I believe that there will never be a single statement. If you need to determine the last 100 records for a special user you first need to determine the highest document number.
    this can be done by
    select max( document_number ) into document_number from table where username = username.
    Any descending sorting order or group by etc. will never make sure that you get the last one. For a simple reason What should the select statement look like that makes sure (in combination of any cursor applied)? Its impossible!
    If you now need the latest 100 records for a single user its the same problem like buffered number ranges. There is no way to perform that task because there is no database routine or sql statement to do so. And 1.5 million records are too much to try out or select everything.
    You could do an assumption that the last 100 for that user have been posted during the last 1000 or last 10.000 records, select them and filter out.
    Alternative you can perform the following select statement for 100 times. Using an index on document number and user might not be such a performance killer if its only done for one user during his online dynpro process:
    data: max_number type char10.
    select max( documentnumber ) into max_number from table
      where username = username into [structure].
    max_number = max_number + 1.
    do 100 times
    select max( documentnumber ) from table intomax_number
      where username = username and docnumber lt max_docnumber.
    select * from [db_table] into [structure] where docnumber = max_number.
    append [structure] to [table].
    enddo.
    Of course that just draft coding... apply if statements and so on...
    Even though its pretty poor, its the only way to do. Any select statement will never garantee what records you will get if you do not restrict accordingly and if the restriction has to be made on document number, but if there is no way to get the max_number - [100 last records of this user], there is no solution using one statement.
    Thats it.
    Edited by: Rob Burbank on Feb 25, 2010 8:52 AM

  • My iPhone 5 is not syncing with my iTunes 11.3, on OSx. I have just completed all of the most recent updates and have looked into completely uninstalling iTunes but I fond my computer won't let me! Any ideas?

    My iPhone 5 is not syncing with my iTunes 11.3, on OSx. I have just completed all of the most recent updates and have looked into completely uninstalling iTunes but I found my computer won't let me! Any ideas?

    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    ~/Library/Application Support/SyncServices
    Right-click or control-click the line and select
              Services ▹ Reveal in Finder (or just Reveal)
    from the contextual menu.* A folder should open with an item selected. Quit the application if it's running. Move the selected item to the Trash. Relaunch the application and test.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination  command-C. In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

  • Let Photoshop automatically load the most recent file

    I have in the task bar icons for the PostScript editor PSAlter and for Photoshop.
    The workflow is always: Edit in PSAlter and interpret in Photoshop.
    Clicking in the task bar on the Photoshop icon should open Photoshop, load
    the most recent file (which is meanwhile modified), confirm last settings by OK
    and start the execution.
    Is it possible to automate this sequence – by just one click on the icon?
    Best regards --Gernot Hoffmann

    I doubt that would work out well.
    One could possibly link a Script to Photoshop being "brought to the foreground" with Script Events Manager but that might not always be the intended process when switching to Photoshop.
    How exactly is the "most recent file" identifiable?
    Do you change the settings often or could they stay fixed?
    Maybe you should also ask over at
    Photoshop Scripting

  • Not Showing Most Recent Files

    I've got a strange one. I've been able to network my imac to a dell laptop and they can see each other's shared directories. Tried to access an Excel file from the laptop and it didn't show the most recent file, but one that was nearly three weeks old. Is the imac caching the files anywhere? I didn't see any windows settings. Still getting used to the Mac world and didn't see any ability to refresh. Any ideas would be appreciated. Thanks in advance.

    Any pattern? Are they the most recently created or modified? Anything in common about how they are named, or in the +dot plus three+ extensions? Are you still seeing the older version of files on the Mac compared to directly in Windows.
    I've not used Windows 7 so I'm not familiar with any sharing filters that are possible. If you are still seeing older versions of files, and the ones you don't see on the Mac happen to be the most recently added to the folder, it still feels to me like you are actually connecting to a different sharepoint than what you believe... maybe one that is in an backup archive or something.
    Sorry I can't be any more helpful. It's a bit mysterious.

  • Include text file and display from text file

    Ok. I'm found the site with the monkey on the the flash thing and all it shows is a name, email and something else and I used it and it works by including a txt file and displaying text from that file as putting down this information
    name.text = this.name;
    and I can't find the site anymore to get help.
    I want to know how to include a PHP script that shows this information like this
    text=something I need&username=My Name&email=[email protected]
    I want to show this stuff on the flash but every time I execute by using it as localhost/test.php, it will show a sentax error.
    This is really stressing me out and I need a lot of help on this stuff.
    Can someone help me?

    ok. let me describe something else.
    there's 3 text boxes that is dynamic text.
    one of them is called name
    the other one is called email
    and last one is called location
    in the text file, it shows this for importing to the flash file
    name=My Name&email=EMAIL&location=My Location
    When viewing the flash file that you created, it shows the name, it shows the email, and it shows location.
    When I do it on my own even with a text file, it keeps on saying that there is an error on line 1.
    I found a site that shows how to do it and it shows what to put in a text file, and it shows the action script. On the FLA file that he shows me has a monkey on the flash file and it has 3 text boxes that I described above. As well as the text file, it is the same. I used the example and it worked but I can't find the example again. I don't know what happened to the website and I don't know what happened to the download I had but it is not downloaded any more. I have adanced systemcare pro so it clears out my recent web searches and my recent downloads so I can't find it. I did a google search on anything about action scripts. I even did a monkey action script search and I couldn't find it.
    It's making me mad and I don't know what to do. This is stressing me out way more than you think.
    UPDATE:
    I did a google search on a file I found in my www folder and I found it. finally.
    Here's the site.
    http://www.kirupa.com/developer/mx/externaldata.htm
    now, I need to figure out how to load it from a PHP file.

  • How to upload the tif file and Display into Iframe

    Hi all,
       My requirement is to upload 'n' number of tif files and display the file name in dropdown.
       If i select the file name, it should display the file in Iframe.
    My problem is i am not able to upload the tif file.
    try{
          byte []by=new byte[wdContext.currentContextElement().getPhotoResource().read(true).available()];
          wdContext.currentContextElement().getPhotoResource().read(true).read(by);
          String ext=wdContext.currentContextElement().getPhotoResource().getResourceType().getFileExtension();
          WDWebResourceType res=wdContext.currentContextElement().getPhotoResource().getResourceType();
          IWDResource resource=null;
          resource=WDResourceFactory.createResource(by,"sample",WDWebResourceType.getWebResourceTypeForFileExtension(ext));
           wdContext.currentContextElement().setPhoto(resource.toString());
              catch(Exception e){
    In the above code Photo is Iframe Context variable.
    If i upload tif file means it directly giving Save and Open options is giving.
    Please how to slove this probelm...........................
    Thanks,
    Suni

    Hi Satya,
    In HTML a TIF file can be displayed as"
    <html>
    <body>
    <object height="100%" width="100%"
    type="image/tiff" data="PO.tif">
    </object>
    </body>
    </html>
    Hope it helps.
    Regards,
    Alka

  • Finding most recent file in a directory

    Hi,
    Is there a simple and easy way in labview to write a program that goes
    into a directory and looks for the most recent file. I can think of one
    way where I use the list directory vi to obtain an array of the file
    names in the directory and then use the file/directory info vi to
    obtain a time stamp for each file in the directory and afterwards sort
    all the time stamps. I'm not sure if this is the simplest way to do
    this, and wanted to ask if anyone on the discussion forums knows of any.
    Thank you

    unclebump wrote:
    Try here. http://zone.ni.com/devzone/cda/epd/p/id/3175
    This example is not that great and a few tweaks can greatly improve it!
    Building the path with string operations inside the loop automatically breaks this VI on anything but windows. There is a reason we have the "build path" function! It should always be used. The "string to path" and "path to string" should only be used for OS specific tasks.
    You probably want to skip files that are actually links. Newer versions of "File/Directory info" tell you if the path points to a link instead of a file with a boolean output.
    WIy do we need to keep an array of all files and maintain the corret index in a shift register. It seems more intuitive and less wasteful to just keep the newest file path in the shift register and not worry about the index.
    The image below shows a quick attempt at improving the example. Modify as needed.
    Message Edited by altenbach on 04-12-2007 02:45 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    find_newest_real_file.png ‏9 KB

  • Email Most Recent File From Directory

    I am using C# to open a Spreadsheet, change 3 things in the spreadsheet, then save the spreadsheet in a directory, then open the directory.  I was trying to use FileSystemWatcher to capture the most recent file in the directory, but it seems that the
    Watch() event is being triggered before my syntax is able to make the changes and save.
    Is their a better method for this or do I just need to add in a Thread.Sleep() event so that the Watch() event triggers after the save is complete?

    Hi Indigo,
    >>I was trying to use FileSystemWatcher to capture the most recent file in the directory,
    but it seems that the Watch() event is being triggered before my syntax is able to make the changes and save.
    I have tested your code on my side, I supposed that you can add one button, when you
    change and save xls file successfully, try to trigger Watch() event by manual.
    I changed a little code with yours.
    Watch for changes in LastAccess and LastWrite times, and  the renaming of files or directories.
    Add all event handlers.
    Use messageBox to show something instead
    Here is my test reslut:
     Do I miss something? If so, please feel free to post here.
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    filewatcher();
    private void filewatcher()
    using (Process pRun = new Process())
    pRun.StartInfo.FileName = "D:\\Test\\test.xlsx";
    pRun.StartInfo.UseShellExecute = true;
    pRun.Start();
    string openPath = "D:\\Test\\";
    Process pRC = new Process();
    pRC.StartInfo.FileName = openPath;
    pRC.Start();
    private void Watch()
    FileSystemWatcher watcher = new FileSystemWatcher();
    watcher.Path = "D:\\Test";
    watcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite
    | NotifyFilters.FileName | NotifyFilters.DirectoryName;
    watcher.Filter = "*.xlsx";
    // Add event handlers.
    watcher.Changed += new FileSystemEventHandler(OnChanged);
    watcher.Created += new FileSystemEventHandler(OnChanged);
    watcher.Deleted += new FileSystemEventHandler(OnChanged);
    watcher.EnableRaisingEvents = true;
    private void OnChanged(object source, FileSystemEventArgs e)
    WatcherChangeTypes changeTypes = e.ChangeType;
    String filename = e.Name.ToString();
    MessageBox.Show("Hello");
    private void button1_Click(object sender, EventArgs e)
    Watch();
    MessageBox.Show("DOne");
    //private void sendMail(string filename)
    // using (MailMessage mail = new MailMessage())
    // mail.From = new MailAddress("");
    // mail.To.Add("");
    // string fileDirectory = path;
    // string fileFullPath = Path.Combine(filesDirectory, filename);
    // if (!File.Exists(fileFullPath))
    // return;
    // using (var xlsx1 = new Attachment(fileFullPath))
    // mail.Subject = "Test";
    // mail.Attachments.Add(xlsx1);
    // SmtpClient client = new SmtpClient("SMTP.MAIL.COM");
    // client.Send(mail);
    Best Regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • Strange transparency problem trying to print a pdf made in Pages

    Hello, Let me apologize in advance for this one, I think it's probably a doosy. Not having the know-how to efficiently do a layout in InDesign, I have been doing print projects in Pages. It has worked fine in the past to print to Adobe PDF postscript

  • Not able to print cards with design in iphoto any more

    At Christmas I needed some more of the cards I had ordered at short notice so I printed them out on my own printer. It worked really well. I have just created a card and went to print but the card template does not print any more. I assume that this

  • Problems with objects

    Hi all, I am working with JAVA, My questuin is that : Let us say A and B are two classes and in class A i created object for class B with new operator, and we have another class called C in this class i created object for class A, after implementatio

  • How to read ISO characters???

    Hi, I'm trying to read the headers of an email. In the "subject" section I have some words in french, imagine the subject is "Café" (whith the accented e). The content of the subject header is not "Café" instead it is: =?ISO-8859-1?Q?Caf=E9?=. The th

  • Complent for jbo:PostChange in UIX

    Hello I studied the old OnlineOrder Application (BC4J). In this application the primary key for the order entity was created through a trigger on the order table. Before doing a <jbo:commit> there was posted a <jbo:PostChange> to send the rowdata to