• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How do you test if a property is empty
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do you test if a property is empty


  • Subject: Re: How do you test if a property is empty
  • From: Luther Fuller <email@hidden>
  • Date: Mon, 19 Jan 2009 11:23:12 -0600

On Jan 19, 2009, at 10:17 AM, Paul Taylor wrote:

Hi how do you test if a property is empty, Im trying to copy a value from one object to another but its fail if the property has not been set in the original object , Ive tried variuos checks such as is empty, !=, is missing and none of them have worked
(or compiled in most cases)

if(played date of orig_track is not empty)
set played_date_val to played date  of orig_track
set played date  of new_track to played_date_va;
end if

This is a read-only script. In other words, I don't recommend running it "as is".
It will change the 'played date' of a track, if you click "Yes".

tell application "iTunes"
set trackCount to (count tracks)
repeat with i from 1 to trackCount
set theDate to (get played date of track i)
if (class of theDate) is date then --<1> this is the test for valid date
display dialog (i as text) & return & "Date = " & theDate
else --<2> there is no date
display dialog (i as text) & return & "Set to today's date?" buttons {"Cancel", "Yes", "No"} default button 3
if (button returned of the result) = "Yes" then
set played date of track i to (current date) --<3> writes a date to 'played date'
end if
end if
end repeat
end tell

I think (hope) it will answer your questions.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >How do you test if a property is empty (From: Paul Taylor <email@hidden>)

  • Prev by Date: Re: How do you test if a property is empty
  • Next by Date: Creating, modifying and formatting a pivot table with AS in Excel 2008
  • Previous by thread: Re: How do you test if a property is empty
  • Next by thread: RE: How do you test if a property is empty
  • Index(es):
    • Date
    • Thread