Sponsored Content
Full Discussion: Help with blobbing
Operating Systems OS X (Apple) Help with blobbing Post 302850243 by kailasgurung on Wednesday 4th of September 2013 10:29:45 AM
Old 09-04-2013
Apple Help with blobbing

I am pretty new to scripting and i was wondering if anyone could help me out.

Here is the situation. I am trying to make an action folder that when an image is saved to it, the image is automatically moved to a folder based upon the first 4 or 5 integers of the name.

image names come in a few variations for example:

1000.jpg
10000.jpg
10000-v1.jpg
10000-v1 copy.jpg

any of the first 4 or 5 integers can be from 0-9.

this is the code i came up with so far.

Code:
tell application "Finder"

   do shell script " if [ -f ~/Desktop/filing/1[0-9][0-9][0-9][!0-9]*.jpg ]
then
scp ~/Desktop/filing/1[0-9][0-9][0-9][!0-9]*.jpg ~/Desktop/filed/1000/
fi"
   
   do shell script "if [ -f ~/Desktop/filing/1[0-9][0-9][0-9][0-9][!0-9]*.jpg ]
then
scp ~/Desktop/filing/1[0-9][0-9][0-9][0-9][!0-9]*.jpg ~/Desktop/filed/13000/
fi"

end tell

the trouble with this code is the wildcard [!0-9] wont work if the image is just 1000.jpg or 10000.jpg as having the [!0-9] means that it is excluding 0-9 range but expecting a character of some sort.

Anyway if anyone could shed some light on a solution to this that would be great.

Kai
 
Tk_DeleteImage(3TK)					       Tk Library Procedures					       Tk_DeleteImage(3TK)

__________________________________________________________________________________________________________________________________________________

NAME
Tk_DeleteImage - Destroy an image. SYNOPSIS
#include <tk.h> Tk_DeleteImage(interp, name) ARGUMENTS
Tcl_Interp *interp (in) Interpreter for which the image was created. CONST char *name (in) Name of the image. _________________________________________________________________ DESCRIPTION
Tk_DeleteImage deletes the image given by interp and name, if there is one. All instances of that image will redisplay as empty regions. If the given image does not exist then the procedure has no effect. KEYWORDS
delete image, image manager ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWTk | +--------------------+-----------------+ |Interface Stability | Uncommitted | +--------------------+-----------------+ NOTES
Source for Tk is available on http://opensolaris.org. Tk 4.0 Tk_DeleteImage(3TK)
All times are GMT -4. The time now is 08:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy