MACSCRPT Archives

August 2011

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
SUBSCRIBE MACSCRPT Inyo55 <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 23 Aug 2011 17:09:43 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (38 lines)
Whoever can solve this will have my regard as being a Genius:

Here is the first part of my script.  It is a script to rename files.  The files are dropped onto the script to start it:

----------------------------------------------------

	tell application "Finder"
			
			try
				set jFolder to folder of item 1 of filelist --path of folder files were dropped from
				set jpath to folder of item 1 of filelist as text --make it a string to use.
				set AppleScript's text item delimiters to ":"
				set PMName to (text item 1 of jpath) & ":" & (text item 2 of jpath) & ":" & (text item 3 of jpath) & ":" as string 
				set afolder to (text item 1 of jpath) & ":" & (text item 2 of jpath) & ":" & (text item 3 of jpath) & 
":HotFolders:DestFolder
				set jobname to text item 3 of jpath
				set AppleScript's text item delimiters to {}
				if jpath does not end with "To Be Renamed:" then
					beep
					display dialog "Files must be in the 'To Be Renamed' folder of " & jobname & "." with icon stop buttons 
{"Cancel"} default button 1
				end if
				
			on error errmsg
				display dialog errmsg
			end try
		end tell

-----------------------------------

In the above script, text item 1 of jpath should be "CF10_O".  Yet, if I ask the script to return jpath as a string, the volume name becomes 
"CF10_O-4" which is not right.  I have no idea where the "-4" is coming from, it is not in the Mac Share name on the server.  Since the 
volume name is not as it should be, the script cannot set afolder and errors out.

The server is using a util called Extremez-IP for Mac Shares; I don't know if that affects the name of volume shares.  Any ideas?
thanks,
Bob R.

ATOM RSS1 RSS2