Re: Filename/pathname length issues
Re: Filename/pathname length issues
- Subject: Re: Filename/pathname length issues
- From: Brian Johnson <email@hidden>
- Date: Wed, 5 Dec 2007 08:39:16 -0800 (PST)
Hi Marc,
I have bumped into this same problem in one of my scripts. There used to
be a 31- or 32-character length limits in the OS. While names can be
longer in the OS, I'm not sure Thorsten has changed GC to take advantage
of this. Prompted by your question, I just tweaked my own script by saving
from GC to a short 'tmpName' ("a.jpg") and then immediately telling the
Finder to rename that to the desired 'theName'...
tell application "GraphicConverter"
-- other stuff --
save window 1 in (destFldr & tmpName & ".jpg") as JPEG with wwwready
end tell
tell application "Finder"
set the name of file (destFldr & tmpName & ".jpg") to (theName & ".jpg")
end tell
This workaround works for me (tested on names >50 characters). YMMV.
-brian johnson, dept of architecture, university of washington, seattle
On Wed, 5 Dec 2007, Marc Glasgow wrote:
Greetings Scripters!
I've ran into two filename/path length ceilings while using a standard call
in GraphicConverter (v6.0.2) that has me slightly perplexed; I can't
determine if the issue is unique to the app's AS implimentation, or if it's
an AS issue independent of GC because aside from stand-alone (non-application
dependent scripts), GC is about the only thing I script...
The first issue (the more critical of the two for the workflow) is a 31
character filename limit on saving files via applescript.
-- where OurNewFileNameGIF is the path/filename for the save and window 1 is
a PSD file.
try
save window 1 in OurNewFileNameGIF as GIF with makeCopy and wwwready
without transparency
on error
display dialog "Unable to save resulting GIF file! (Possible
Duplicate)" & return & "(more likely too long a path name)" buttons
{"Continue", "Cancel"} default button 2
end try
If OurNewFileNameGIF has a filename in the finder that exceeds 31 characters,
the resulting saved file comes out with a filename that is a seven digit
number (example: 1225171) that bears zero resemblance to the name fed to the
save call and omits the filename extension as well.
Similarly, if the enclosing folder name (or any folder it's nested in)
exceeds 31 characters, or the full-path name exceeds 255 characters, the
output is nothing (no new file created).
I wanted to see if someone else could shed any light on the issues.
Cheers
=-= Marc Glasgow
_______________________________________________
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
_______________________________________________
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