Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript-Users Digest, Vol 3, Issue 640



Hello

At first read there is a simple problem: you forgot that you coerced sourceFolder into a string.
In the handler conVert, count of sourcefolder is the nR of charater in the string sourceFolder, not the nbr of files.


So I made some changes (I didn't tested them because I don't own Illustrator but it seems that there is the same kind of error in the process handlers.

on conVert(sourceFolder) -- Here, sourceFolder is a string!
set sourceFolder to sourceFolder as alias
tell application "Finder" to set nbFiles to count of sourceFolder
	try
		set counter to 0
repeat with i from 1 to nbFiles
tell application "Finder" to set this_item to (item i of sourceFolder)
my display(this_item) -- here this_item is a Finder's reference

set item_info to the info for this_item
my display(item_info)

if (folder of the item_info is true) and ¬
(alias of the item_info is true) then


process_folder(this_item)

else if (alias of the item_info is false) then

process_item(this_item)

end if
end repeat
tell application "Finder"
activate
display dialog (the counter as string) & " items have been converted to Illustrator AIs." buttons {"Gracias!"} default button 1
end tell
on error msg
my showError("Something happened during conVert")
end try
end conVert


Yvan KOENIG (from FRANCE vendredi 26 janvier 2007 19:27:33) _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >RE: AppleScript-Users Digest, Vol 3, Issue 640 (From: "Grove, Brian" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.