• 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: if statement
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: if statement


  • Subject: RE: if statement
  • From: "Ruby Madraswala" <email@hidden>
  • Date: Wed, 26 Nov 2003 13:24:56 -0500
  • Thread-topic: if statement

That's was baffled me , I have few more if statements similar that works, except the one with "id", I was wondering if "id" was some kind of a keyword.

Ruby
-----Original Message-----
From: email@hidden [mailto:email@hidden] On Behalf Of Michael Grant
Sent: Wednesday, November 26, 2003 12:43 PM
To: AppleScript-Users list
Subject: Re: if statement

On Nov 26, 2003, at 11:03 AM, Ruby Madraswala wrote:

> Can anyone tell me why the second if statement does not work, while
> the third if statement works.

'characters 6 thru 7' returns a list, not a string. The surprising part
is that the third statement works--are you sure there's not something
else going on?

Michael


> Property hotfolder: "Data"
> Property errorfolder: "Data:deadfiles:";
> Tell application "Finder"
> Set flist to every file in folder hotfolder
> Repeat with curfile in flist
> Set nm to name of curfile as string
> (1) If nm contains "id" --- works
> Move file (hotfolder & nm) to folder errorfolder with replacing
> End if
> (2) If characters 6 thru 7 of nm = "id" - doesn't work, no error
> message, script exits and does not process remaining files in the
> folder.
> Move file (hotfolder & nm) to folder errorfolder with replacing
> End if
> (3) If characters 6 thru 7 of nm = "gs" - works
> Move file (hotfolder & nm) to folder errorfolder with replacing
> End if
> End tell
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Embedding AppleScript in HTML
  • Next by Date: RE: if statement
  • Previous by thread: Re: if statement
  • Next by thread: RE: if statement
  • Index(es):
    • Date
    • Thread