![]() |
Launchd would probably work, but Windows would screw up the path for any files whose path was greater than 255, so the script would fail.
|
well, solving one problem, I've discovered it's actually very easy to identify files whose paths will be too long. the following applescript (which takes a normal file system alias for theItem) should do it:
Code:
set theItemPath to POSIX path of theItem |
I'm not sure what to think of this discussion. Again, I wouldn't know what to do with any of that coding. I don't want the server to have to do anything.
I want to do a quick character check on certain files before I throw them in my backup folder on the server. So far, it seems like my primitive method of using the triple column view and estimating character count based on 1" is approx 13-15 characters is the quickest and least complicated. agreed? thanks everyone. |
Quote:
|
* Is this just for your personal use, or is it for the use of a number of people who all use macs?
- 4 designers, we see the server shortcut on our macs. We drop files there. We want to check if the file path character count is more than 250 characters. on our macs, before transferring. * would you prefer to drag your files to a droplet, use a menu item to select them, run an application? - just drag and drop the files in a design folder we have on the server. * do you want the script to upload the files, or just check to see if it will work? - count the file path characters. * what do you want the script do if it finds a file that will be too long? skip it, skip the whole move, rename the file? - nothing. we'll fix them ourselves if they're too long. thanks for the help. |
ok, well you can't just drop the files on the server folder - once you start the transfer to the windows machine, the process is out of the Mac's hands. what you'll need to do instead is drop the files on a droplet which checks their lengths. so do this:
Code:
property serverBasePath : "E:" |
Thanks tw.
So, I pasted the code into script editor, saved it as an application on my desktop. Dragged a working folder that I want to upload (one that has less than 255 character paths for sure) and this pops up: http://i426.photobucket.com/albums/p...eroliver/1.jpg I click OK, then this pops up: http://i426.photobucket.com/albums/p...eroliver/2.jpg I click "OK" and nothing happens. So I tried it again and clicked "edit", it opened the app in script editor. So, I assumed this meant the character length was <255 characters. (I didn't see any indication it was less or more but I knew this particular folder path was <255 characters.) Next, I created an extremely long file path with definitely more than 255 characters and I got the exact same pop ups: http://i426.photobucket.com/albums/p...eroliver/3.jpg I tried just clicking the script editor created application as well and I got this: http://i426.photobucket.com/albums/p...r/Picture5.png I don't understsand this. I didn't select any folder, it never gave me a chance to select any particular folder. If I select "move files" I get this: http://i426.photobucket.com/albums/p...r/Picture6.png I don't need the script to move the files anywhere. I'll copy them over once I know there isn't any file paths in the folder that exceed 255 characters. |
that's because I left a debugging line in the script - 10 lines from the bottom, says display dialog theItem. you can delete that line (moderators, if you see this, please remove that line from the code above - I can't edit it for some reason). sorry, always doing things like that.
if you don't even want the option to move stuff, then change this section: Code:
display alert "Path Length Warning" message "This transfer should work correctly. Move files to server?" as informational buttons {"Quit", "Move Files"} default button 2Code:
display alert "Path Length Warning" message "This transfer should work correctly." as informational |
I altered both sections of the code you mentioned, however I get exactly the same messages except for the move files option. :S
|
is this machine running Tiger or Leopard?
|
ah, never mind. change this bit of code (about 9 lines from the bottom):
Code:
tell application "System Events"Code:
tell application "System Events" |
sweeeeet. Works perfect. thanks a lot tw.
|
| All times are GMT -5. The time now is 07:26 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.