Applescript to get file name of current image in slideshow?

This area contains the messages from the old Yahoo gcmac group after the port.
Steve
Posts: 0
Joined: Sat Mar 03, 2007 2:56 pm

Applescript to get file name of current image in slideshow?

Post by Steve »

I'm being stupid: how can I get the file name of the currently-displayed image in slideshow using AppleScript? Thanks!
Steve
Posts: 0
Joined: Sat Mar 03, 2007 2:56 pm

Re: Applescript to get file name of current image in slideshow?

Post by Steve »

Using UIElementInspector I can see what I'm after in AXValue:Can anyone help me with accessing it in an AppleScript?  Thanks.
Christopher Stone
Posts: 0
Joined: Sat Jun 19, 2004 11:47 pm

Re: Applescript to get file name of current image in slideshow?

Post by Christopher Stone »

On Jun 02, 2012, at 16:20, Steve wrote: Using UIElementInspector I can see what I'm after in AXValue:______________________________________________________________________Hey Steve,Please explain more precisely what you want to accomplish, so we can better help you.--Best Regards,Chris
Steve
Posts: 0
Joined: Sat Mar 03, 2007 2:56 pm

Re: Applescript to get file name of current image in slideshow?

Post by Steve »

Chris, I'd like to write a simple AppleScript (I'm a AS n00b) that makes the file of the currently-displayed image empty (I want the file name to remain) and move to the next image in the slide show. This would help me sort through folders with a lot of images. Thanks!
Christopher Stone
Posts: 0
Joined: Sat Jun 19, 2004 11:47 pm

Re: Applescript to get file name of current image in slideshow?

Post by Christopher Stone »

On Jun 03, 2012, at 10:56, Steve wrote: > I'd like to write a simple AppleScript (I'm a AS n00b) that makes the file of the currently-displayed image empty (I want the file name to remain) and move to the next image in the slide show. This would help me sort through folders with a lot of images. ______________________________________________________________________ Hey Steve, I'm still unclear on this. You're starting from a normal picture window? Or the browser? Or the slideshow? You want to open a new file in the current window? -- Best Regards, Chris
Steve
Posts: 0
Joined: Sat Mar 03, 2007 2:56 pm

Re: Applescript to get file name of current image in slideshow?

Post by Steve »

Chris, Sorry for the confusion. I have a slideshow going and I want to make the current image file zero-sized. I don't want to open a new image, just make the current one zero-sized and move to the next image. I am thinking AS is the best way to go about this. I can bind a script to a key so I can run it as GC is showing a slideshow. I realize it's a bit odd what I want to do, but that's me for ya :-) Thanks!
Christopher Stone
Posts: 0
Joined: Sat Jun 19, 2004 11:47 pm

Re: Applescript to get file name of current image in slideshow?

Post by Christopher Stone »

Hey Steve,On Jun 04, 2012, at 10:01, Steve wrote: Sorry for the confusion.  I have a slideshow going and I want to make the current image file zero-sized.This still doesn't make sense.  You want to delete the image?I don't want to open a new image, just make the current one zero-sized and move to the next image.If all you want to do is move to the next image then there are already keyboard shortcuts for that.Are you wanting to process the current image in some way?The problem in the slideshow is that there are very few Applescript commands available for it, and UI-Scripting doesn't see much in the slideshow window.--Best Regards,Chris
Steve
Posts: 0
Joined: Sat Mar 03, 2007 2:56 pm

Re: Applescript to get file name of current image in slideshow?

Post by Steve »

Hey Chris, Thanks for hanging with me on this. --- In gcmac@yahoogroups.com, Christopher Stone <listmeister@...> wrote: > This still doesn't make sense. You want to delete the image? Almost, but not quite. I want the file to remain, just be zero-sized. "rm file; touch file" is a way to think of it, and that's easy in AS if I can just get the file name. I want this because the folder is mirrored and I don't want to re-fetch the file with a program like wget. > The problem in the slideshow is that there are very few Applescript commands available for it, and UI-Scripting doesn't see much in the slideshow window. Agreed. And if I'm barking up the wrong tree with my thinking, let me know. Thanks!
Christopher Stone
Posts: 0
Joined: Sat Jun 19, 2004 11:47 pm

Re: Applescript to get file name of current image in slideshow?

Post by Christopher Stone »

On Jun 04, 2012, at 12:46, Steve wrote: Almost, but not quite.  I want the file to remain, just be zero-sized.  "rm file; touch file" is a way to think of it, and that's easy in AS if I can just get the file name.  I want this because the folder is mirrored and I don't want to re-fetch the file with a program like wget.______________________________________________________________________Hey Steve,Aha.  Now I understand.The problem in the slideshow is that there are very few Applescript commands available for it, and UI-Scripting doesn't see much in the slideshow window.Agreed.  And if I'm barking up the wrong tree with my thinking, let me know.I think you're SOL with the slideshow, however if you can use a browser window with the image preview then you can make it work.Personally I would use Keyboard Maestro or QuicKeys to run the script and emulate the right-arrow keystroke and leave System Events out of the loop.--Best Regards,Chris------------------------------------------------------------------------------------------------on write_to_file_overwriting(someText, targetFile) try set resultNumber to open for access targetFile ¬ with write permission set eof of resultNumber to 0 write someText to resultNumber close access resultNumber on error errMsg number errNum try close access resultNumber on error errMsg number errNum beep display dialog "Error: " & errMsg & return & "Error Number: " & errNum end try end tryend write_to_file_overwriting------------------------------------------------------------------------------------------------tell application "GraphicConverter" set sel to selection of front windowend tellif length of sel = 1 then set sel to item 1 of sel if class of sel = «class furl» then write_to_file_overwriting("0", sel) end if tell application "System Events" keystroke (get ASCII character 29) end tellend if------------------------------------------------------------------------------------------------
Fred Lotte
Posts: 0
Joined: Sun Jun 03, 2012 9:49 am

Re: Applescript to get file name of current image in slideshow?

Post by Fred Lotte »

Once you 'rm <file>' there is nothing left to touch. Do you want the file to be 0 sized or just the displayed image? What do you mean by 0 sized? Anticipating that you are looking for a blank screen- When I'm using GC for presentations and want a blank screen, I make a blank image, the same color as the background, and put it in the sequence. On Jun 4,12, at 13:46, Steve wrote: > Hey Chris, > > Thanks for hanging with me on this. > > --- In gcmac@yahoogroups.com, Christopher Stone <listmeister@...> > wrote: > > This still doesn't make sense. You want to delete the image? > > Almost, but not quite. I want the file to remain, just be zero- > sized. "rm file; touch file" is a way to think of it, and that's > easy in AS if I can just get the file name. I want this because the > folder is mirrored and I don't want to re-fetch the file with a > program like wget. > > > The problem in the slideshow is that there are very few > Applescript commands available for it, and UI-Scripting doesn't see > much in the slideshow window. > > Agreed. And if I'm barking up the wrong tree with my thinking, let > me know. > > Thanks!
Post Reply