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 

Splitting Capture Date

 
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
briandhowell



Joined: 29 Sep 2005
Posts: 2

PostPosted: Fri Jul 21, 2006 5:28 am    Post subject: Splitting Capture Date Reply with quote

The Capture Date EXIF data field includes the date and the time. Is there a way to split this information to separate custom fields?

Brian
Back to top
View user's profile Send private message
Peter_A



Joined: 07 May 2004
Posts: 124
Location: USA

PostPosted: Tue Sep 19, 2006 1:07 am    Post subject: Reply with quote

try the code below. The script expects custom fields already created called "The Date" and "The Time". You need to modify it to fit your needs.
I've only done minimal testing on it so try it on a test catalog first.
Pete

Code:

try
   set selectedItems to GetSelection()
   
   tell window 1 of application "iView MediaPro"
      repeat with theItem in selectedItems
         set theDate to the capture date of theItem as string
         set old_delimiters to AppleScript's text item delimiters
         set AppleScript's text item delimiters to " "
         set cDate to items 1 through 24 of theDate as string
         set cTime to items 26 through 36 of theDate as string
         --return cTime
         if (exists (custom field "The Date")) then
            set custom field "The Date" of theItem to cDate
            if (exists (custom field "The Time")) then
               set custom field "The Time" of theItem to cTime
            end if
         end if
      end repeat
   end tell
on error the error_message number the error_number
   beep
   display dialog "Error: " & the error_number & ". " & the error_message buttons {"Cancel"} default button 1 with icon stop
end try

on GetSelection()
   set selectedItems to {}
   tell application "iView MediaPro"
      if catalog 1 exists then set selectedItems to the selection of catalog 1
   end tell
   if number of items in selectedItems is 0 then
      display dialog
         "You need to select at least one media item in the front catalog in order to use this script." buttons {"OK"} default button
         "OK" with icon note giving up after 10
      error number -128
   end if
   return selectedItems
end GetSelection
Back to top
View user's profile Send private message Visit poster's website AIM Address
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