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 

Searching with multiple arguments

 
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
paulskinner



Joined: 24 Apr 2006
Posts: 7

PostPosted: Wed Jan 17, 2007 8:43 pm    Post subject: Searching with multiple arguments Reply with quote

Ok, this is as wonky as any implementation I have ever seen! Unbeliveable!

So, maybe I am just plain wrong, but it appears to me that if I want to find (via script) every asset that contains "bingo" and "lucky" and "dog" that I have to do a dance that goes like this...

Code:

set arg to {"bingo", "lucky", "dog"}
searchiView(arg)


on searchiView(arg)
   my viewAll()
   tell application "iView MediaPro"
      tell catalog 1
         set selection to {}
         repeat with i from 1 to length of arg
            set currArg to item i of arg
            select (every media item whose name contains currArg)
            my viewSelected()
         end repeat
      end tell
   end tell
end searchiView



on viewAll()
   tell application "iView MediaPro"
      activate
      tell application "System Events" to keystroke "e" using command down
   end tell
end viewAll


on viewSelected()
   tell application "iView MediaPro"
      activate
      tell application "System Events" to keystroke "e" using {command down, shift down}
   end tell
end viewSelected


Someone out there please slam me to the mat with your most excellent solution to the fact that iView simply did not implement building a query and passing it to the app.
Back to top
View user's profile Send private message
Daniel



Joined: 01 May 2004
Posts: 119
Location: France

PostPosted: Wed Jan 17, 2007 11:24 pm    Post subject: Reply with quote

Try this routine:
Code:
on searchiView(arg)
   tell window 1 of application "iView MediaPro"
      set TheCode to "tell window 1 of application \"iView MediaPro\" to get media items whose "
      repeat with i from 1 to length of arg
         set currArg to item i of arg
         set TheCode to TheCode & "name contains \"" & currArg & "\" and "
      end repeat
      set TheCode to (text 1 thru -6 of TheCode) as string -- remove last and
      set OkItems to run script
      select OkItems
      my viewSelected()
   end tell
end searchiView

_________________
G4 MDD 2x1 GHz, 2 Go (Mac OS 10.4.11) ; PB G4 15" 1,67 GHz, 1 Go (Mac OS 10.5.2)
Back to top
View user's profile Send private message Visit poster's website
roberte



Joined: 18 Jun 2004
Posts: 2147
Location: Sydney, Australia

PostPosted: Thu Jan 18, 2007 12:38 am    Post subject: Reply with quote

Hi Daniel,

I was saddened to read your support for the French version of iView will soon end. Apple users have benefited greatly from your Applescripts and generous help.

All the best!
_________________
-- Robert
Expression Media 2 / Windows 8 / Mac OS X 10.10
Back to top
View user's profile Send private message Visit poster's website
paulskinner



Joined: 24 Apr 2006
Posts: 7

PostPosted: Thu Jan 18, 2007 3:13 pm    Post subject: Reply with quote

Daniel wrote:
Try this routine:
Code:
_SNIP!_
              set OkItems to run script TheCode
      select OkItems
      my viewSelected()
   end tell
end searchiView


Thanks for the routine Daniel, I assumed you meant to run script 'TheCode' in the bit above, and it worked well. I took the run script tip and made the following handler that can do compound arguments against a given field.

Code:
set arg to {"name", {"fred", "animal"}}
searchiView(arg)


on searchiView(arg)
   set fieldName to item 1 of arg
   set terms to item 2 of arg
   set query to "tell window 1 of application \"iView MediaPro\" to get media items whose " & fieldName & " contains \""
   repeat with i from 1 to length of terms
      if i > 1 then set query to query & " and " & fieldName & " contains \""
      set query to query & item i of terms & "\""
   end repeat
   
   tell application "iView MediaPro"
      tell catalog 1
         my viewAll()
         set selection to {}
         select (run script query)
      end tell
   end tell
end searchiView


This is still incredibly hackish. I can't believe that an actual hook to the query structure wasn't implemented.

I only realized yesterday that iView had been purchased by microsoft! <sarcasm>I'm sure those guys will put their expertiese in applescript implementation behid this app with the same adroitness that they handles excel's AS implementation. </sarcasm>

In other words, I'm off to find a new app.
Back to top
View user's profile Send private message
Daniel



Joined: 01 May 2004
Posts: 119
Location: France

PostPosted: Thu Jan 18, 2007 11:09 pm    Post subject: Reply with quote

Robert:
Quote:
I was saddened to read your support for the French version of iView will soon end
It's true but where did you read this?
I'll occasionally continue to help the users insofar as the product is not denatured ;-)
Microsoft has excellent programmers (when they want to look elsewhere than the stock exchange).
As long as the iView team will continue to rock her baby there is no concern to have.
As in much of companies the calamity it is the marketing. Apple does not escape from that (c.f. Aperture fastening so that it runs only on the new computers).
Merci, you are a great helper for english people.

Paul:
You can go in France here and make your market:
http://iview.free.fr/products/mediapro3/scripts_iview.html
_________________
G4 MDD 2x1 GHz, 2 Go (Mac OS 10.4.11) ; PB G4 15" 1,67 GHz, 1 Go (Mac OS 10.5.2)
Back to top
View user's profile Send private message Visit poster's website
roberte



Joined: 18 Jun 2004
Posts: 2147
Location: Sydney, Australia

PostPosted: Sun Jan 21, 2007 10:39 pm    Post subject: Reply with quote

Hi Daniel,

Daniel wrote:
Robert:
Quote:
I was saddened to read your support for the French version of iView will soon end
It's true but where did you read this?


On your website.
_________________
-- Robert
Expression Media 2 / Windows 8 / Mac OS X 10.10
Back to top
View user's profile Send private message Visit poster's website
Daniel



Joined: 01 May 2004
Posts: 119
Location: France

PostPosted: Mon Jan 22, 2007 10:19 am    Post subject: Reply with quote

Yes, I see you: 0.10% Australie
Back to top
View user's profile Send private message Visit poster's website
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