iView home page
iView Multimedia Forum Index

FAQ FAQ     SearchSearch     MemberlistMemberlist     UsergroupsUsergroups    RegisterRegister  
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

View Selection Only

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    iView Multimedia Forum Index -> AppleScript
View previous topic :: View next topic  
Author Message
else2244



Joined: 22 Jul 2004
Posts: 3
Location: Peoria, Illinois

PostPosted: Thu Jul 22, 2004 7:50 pm    Post subject: View Selection Only Reply with quote

Hello,

What is the line of AppleScript code that will change my view from Show All to Show Selected? I just want to search for a record, select it and then show only it or whatever records have been selected. Might be more than one. What am I missing in the Dictionary?

Thanks so much,
Else

Code:

tell application "iView MediaPro"
   tell front window
      set y to "31-0478"
      select (media items whose name starts with y)
      set view to thumbnail view
--Show Selected here
   end tell
end tell
Back to top
View user's profile Send private message Send e-mail
Peter_A



Joined: 07 May 2004
Posts: 124
Location: USA

PostPosted: Mon Jul 26, 2004 5:49 pm    Post subject: Reply with quote

I don't think it's in the iView dictionary.
Back to top
View user's profile Send private message Visit poster's website AIM Address
else2244



Joined: 22 Jul 2004
Posts: 3
Location: Peoria, Illinois

PostPosted: Mon Jul 26, 2004 6:42 pm    Post subject: Reply with quote

Thank you for getting back to me.
Back to top
View user's profile Send private message Send e-mail
Peter_A



Joined: 07 May 2004
Posts: 124
Location: USA

PostPosted: Mon Jul 26, 2004 7:30 pm    Post subject: Reply with quote

You may be able to script it using this:
http://www.apple.com/applescript/uiscripting/

But I have not had much experience using this yet.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Peter_A



Joined: 07 May 2004
Posts: 124
Location: USA

PostPosted: Wed Jul 28, 2004 1:04 pm    Post subject: Reply with quote

I did a little experimenting with UI scripting and came up with this little script. You must enable access for assistive devices in the Universal Access preference pane in your system preferences for this to work.

--start script

tell application "iView MediaPro" to activate
-- may not need to activate application

tell application "System Events"
if (system attribute "sysv") < 4144 or UI elements enabled then
tell application process "iView MediaPro"
tell menu bar 1
tell menu bar item "Find"
tell menu "Find"
click menu item "Show Selected"
end tell
end tell
end tell
end tell

else
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.universalaccess"
beep
display dialog "GUI Scripting is not enabled." & return & return & "Check \"Enable access for assistive devices\" in the Universal Access preference pane (authentication is required), then run this script again." with icon stop buttons {"OK"} default button "OK"
end tell
end if
end tell

--end script
Back to top
View user's profile Send private message Visit poster's website AIM Address
Daniel



Joined: 01 May 2004
Posts: 119
Location: France

PostPosted: Wed Jul 28, 2004 3:13 pm    Post subject: Reply with quote

I have already experimented this:
--
tell application "System Events"
tell application process "iView MediaPro" to tell front menu bar
click menu item "Show Selected" of menu "Find"
end tell
end tell
tell application "iView MediaPro" to activate
--
But after running it is necessary to click the menu bar of MediaPro to be effective.
Did you observe the same problem?
Back to top
View user's profile Send private message Visit poster's website
Peter_A



Joined: 07 May 2004
Posts: 124
Location: USA

PostPosted: Wed Jul 28, 2004 3:53 pm    Post subject: Reply with quote

The reason your having a problem is iView must be the front most application at the time. If you run the script from the script editor you must have the "tell application "iView MediaPro" to activate" first.
If you copy and paste the script from my previous post into the script editor it should work.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Daniel



Joined: 01 May 2004
Posts: 119
Location: France

PostPosted: Thu Jul 29, 2004 8:54 am    Post subject: Reply with quote

Now it works from script editor but launched from script menu of mediapro one obtains an error message:
"NSReceiverEvaliationScriptEditor: 4" on command
click menu item "Show Selected"

However It works in all case if I replace this line by this one:
keystroke "E" using {command down, shift down}
Back to top
View user's profile Send private message Visit poster's website
Peter_A



Joined: 07 May 2004
Posts: 124
Location: USA

PostPosted: Thu Jul 29, 2004 11:23 am    Post subject: Reply with quote

Thats cool I was wondering how to pass a keyboard combination instead of doing it the menu way.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Daniel



Joined: 01 May 2004
Posts: 119
Location: France

PostPosted: Thu Jul 29, 2004 10:01 pm    Post subject: Reply with quote

to finish while waiting better.
Universal script
Code:

set GUIS to UIscript_check()

if GUIS then
   tell application "iView MediaPro" to activate
   tell application "System Events"
      tell application process "iView MediaPro"
         keystroke "E" using {command down, shift down} -- show selected
      end tell
   end tell
end if

on UIscript_check() -- check if  Graphic User Interface Scripting enabled
   set the OS_version to system attribute "sysv" -- get the system version
   if OS_version < 4144 then -- 4144 = 10.3.0
      beep
      display dialog "This script requires the installation of Mac OS 10.3 or higher." buttons "OK" default button 1 with icon stop
      return false
   end if
   -- check to see if assistive devices is enabled
   tell application "System Events" to set UI_enabled to UI elements enabled
   if UI_enabled then return true
   beep
   set dialog_message to "This script utilizes the built-in Graphic User Interface Scripting architecture of Mac OS X which is currently disabled." & return & return & "You can activate GUI Scripting by selecting the checkbox “Enable access for assistive devices” in the “Universal Access” preference pane."
   
   display dialog dialog_message buttons "OK" default button 1 with icon stop
   tell application "System Preferences"
      activate
      set current pane to pane "com.apple.preference.universalaccess"
   end tell
   return false
end UIscript_check
Back to top
View user's profile Send private message Visit poster's website
Richard Buckle



Joined: 18 Mar 2004
Posts: 163
Location: London

PostPosted: Tue Aug 10, 2004 3:27 pm    Post subject: Reply with quote

FYI this will be fixed in the forthcoming version 2.6.

Richard.
Back to top
View user's profile Send private message
johnw



Joined: 21 Aug 2005
Posts: 11

PostPosted: Mon Aug 22, 2005 5:51 am    Post subject: A similar question Reply with quote

Sometimes when I have a catalog set selected (where it will show only members of that catalog set), I want iView to change so that it's displaying the exact same set of images, but not constrained. This means, for example, that if I remove one of those items from the set, it won't subsequently disappear from view.

This is easily done with the following script, except that I have to shift key focus to the list/thumbnail/media view for it to work. That is, if I click on the catalog set and then try it, it won't work. But if I click on a catalog set, then at least one of the images in the thumbnail view, then it will work. Is there a way to set the window *focus* to the thumbnail view?

Also, why is "select media items" about 50 times slower than emulating Cmd-A?

This script also requires that Universal Scripting be enabled.

Code:

tell application "iView MediaPro" to activate
tell application "System Events"
   tell process "iView MediaPro"
      tell menu bar 1
         tell menu bar item "Edit"
            tell menu "Edit"
               click menu item "Select All"
            end tell
         end tell
         tell menu bar item "Find"
            tell menu "Find"
               click menu item "Show All"
               click menu item "Show Selected"
            end tell
         end tell
         tell menu bar item "Edit"
            tell menu "Edit"
               click menu item "Deselect All"
            end tell
         end tell
      end tell
   end tell
end tell
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    iView Multimedia Forum Index -> AppleScript All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



  © iView Multimedia Ltd. | All Rights Reserved Privacy Policy | Copyright | Site Map