How can I continuously auto-save and auto-name the JPEG files with a controlled time interval
Hi,
I am newly involved in some Labview projects that out of my knowledge. I am trying to save multiple JPEG images from a live imaging task to a folder in the computer hard disk every certain minutes. I'd like to name these files with the date and time (eg. Img_06012011_1635. jpg).Then, after hours long image capturing, I can have all the image files in a neat order.
My goal is to have the jpg files auto saved and auto-named with the data and time at that moment. I also need to control this waiting time between each savings.
Could you please show me some hints about this? See the vi attached, I know I need to do something on the "write path" part on the up right corner. Thanks!
Solved!
Go to Solution.
Attachments:
capture.vi 28 KB
Thanks, Steve. When I built up a path with the date and time info and send them to the WriteJPEG File.vi like you mentioned, it stopped saving any files into the folder. Do you think this is the problem from my while loop?Could you show me if there is any other secret functions that restrains the file saving?
I am planning to save the image files every 30 secs,for example, and then I can have a bunch of jpg files with their unique names after hours long image acquisition.
I appreciate you kindly help!
Attachments:
capture(updated).vi 29 KB
Similar Messages
-
Would a 347 MB file be slow? Auto save and auto type turn off?
I am doing an art inventory and add jpegs of the art. I don't resize them they range from 750k to 3MB. I guess if it is slowing the program down i should? It currently is 267 rows by about 18 columns.
Thanks in advance.
Oh can I turn off auto save and auto type? That may help. How do I do that?Done.
Enter Scrip Editor
paste the posted script
File > Save > as Script on the Desktop
Move the script to the folder :
Macintosh HD:Library:Scripts:Folder Action Scripts:
CAUTION, you will be asked to enter your pasword.
Create a folder to do the job. I named mine Normalized. I created mine on the Desktop where it's easy to reach.
Go to :
Macintosh HD:Library:Scripts:Folder Actions:
Double click the alias : Configure Folder Actions
Below the left column, click
navigate to select your new folder
Below the right column, click
select the script image - normalize400.scpt
After that, drag and drop a picture file onto your folder.
The original will be move in the folder Originals (isn’t it original ?)
and a reduced copy 400 x height will be stored in the folder Normalized images.
And now, here is the script :
--{code}
Image - Normalize
This Folder Action handler is triggered whenever items are added to the attached folder.
The script rotates the image counter-clockwise (left).
Copyright © 2002–2007 Apple Inc.
You may incorporate this Apple sample code into your program(s) without
restriction. This Apple sample code has been provided "AS IS" and the
responsibility for its operation is yours. You are not permitted to
redistribute this Apple sample code as "Apple sample code" after having
made changes. If you're going to redistribute the code, we require
that you make it clear that the code was descended from Apple sample
code, but that you've made changes.
modified by Yvan KOENIG (VALLAURIS, France)
2011/12/08
This version normalize pictures so that
(1) the greater dimension become the width one (rotate left if needed)
(2) this greater dimension is ruled by the property maxWidth defined below.
property maxWidth : 400
-- set it to fit your needs
property done_foldername : "Normalized Images"
property originals_foldername : "Original Images"
property newimage_extension : "jpg"
-- the list of file types which will be processed
-- eg: {"PICT", "JPEG", "TIFF", "GIFf"}
property type_list : {"TIFF", "GIFf", "PNGf", "PICT", "JPEG"}
-- since file types are optional in Mac OS X,
-- check the name extension if there is no file type
-- NOTE: do not use periods (.) with the items in the name extensions list
-- eg: {"txt", "text", "jpg", "jpeg"}, NOT: {".txt", ".text", ".jpg", ".jpeg"}
property extension_list : {"tif", "tiff", "gif", "png", "pict", "pct", "jpeg", "jpg"}
on adding folder items to this_folder after receiving these_items
tell application "Finder"
if not (exists folder done_foldername of this_folder) then
make new folder at this_folder with properties {name:done_foldername}
end if
set the results_folder to (folder done_foldername of this_folder) as alias
if not (exists folder originals_foldername of this_folder) then
make new folder at this_folder with properties {name:originals_foldername}
set current view of container window of this_folder to list view
end if
set the originals_folder to folder originals_foldername of this_folder
end tell
try
repeat with i from 1 to number of items in these_items
set this_item to item i of these_items
set the item_info to the info for this_item
if (alias of the item_info is false and the file type of the item_info is in the type_list) or (the name extension of the item_info is in the extension_list) then
tell application "Finder"
--set name of this_item to "YK#" & (text -4 thru -1 of ("0000" & i))
my resolve_conflicts(this_item, originals_folder, "")
set the new_name to my resolve_conflicts(this_item, results_folder, newimage_extension)
set the source_file to (move this_item to the originals_folder with replacing) as alias
end tell
process_item(source_file, new_name, results_folder)
end if
end repeat
on error error_message number error_number
if the error_number is not -128 then
tell application "Finder"
activate
display dialog error_message buttons {"Cancel"} default button 1 giving up after 120
end tell
end if
end try
end adding folder items to
on resolve_conflicts(this_item, target_folder, new_extension)
tell application "Finder"
set the file_name to the name of this_item
set file_extension to the name extension of this_item
if the file_extension is "" then
set the trimmed_name to the file_name
else
set the trimmed_name to text 1 thru -((length of file_extension) + 2) of the file_name
end if
if the new_extension is "" then
set target_name to file_name
set target_extension to file_extension
else
set target_extension to new_extension
set target_name to (the trimmed_name & "." & target_extension) as string
end if
if (exists document file target_name of target_folder) then
set the name_increment to 1
repeat
set the new_name to (the trimmed_name & "." & (name_increment as string) & "." & target_extension) as string
if not (exists document file new_name of the target_folder) then
-- rename to conflicting file
set the name of document file target_name of the target_folder to the new_name
exit repeat
else
set the name_increment to the name_increment + 1
end if
end repeat
end if
end tell
return the target_name
end resolve_conflicts
-- this sub-routine processes files
on process_item(source_file, new_name, results_folder)
-- NOTE that the variable this_item is a file reference in alias format
-- FILE PROCESSING STATEMENTS GOES HERE
try
-- the target path is the destination folder and the new file name
set the target_path to ((results_folder as string) & new_name) as string
with timeout of 900 seconds
tell application "Image Events"
launch -- always use with Folder Actions
set this_image to open file (source_file as string)
set {oldW, oldH} to dimensions of this_image
if oldH > oldW then
set {oldW, oldH} to {oldH, oldW}
rotate this_image to angle 270.0
end if
set |échelle| to maxWidth / oldW
if |échelle| < 1 then scale this_image by factor |échelle|
save this_image as JPEG in file target_path with icon
close this_image
end tell
end timeout
on error error_message
tell application "Finder"
activate
display dialog error_message buttons {"Cancel"} default button 1 giving up after 120
end tell
end try
end process_item
--{code}
Yvan KOENIG (VALLAURIS, France) jeudi 8 décembre 2011 21:25:33
iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
My iDisk is : <http://public.me.com/koenigyvan>
Please : Search for questions similar to your own before submitting them to the community -
How can I buy Photoshop CC and not rent the software? [was: buy]
HOW CAN I BUY
PHOTOSHOP CC AND NOT RENT THE SOFT WAREYou can't. You can, however, buy Photoshop CS6.
http://www.adobe.com/products/catalog/cs6._sl_id-contentfilter_sl_catalog_sl_software_sl_c reativesuite6.html
By the way, your caps lock is stuck on. -
I try to open I photo and I get the message, your iPhoto library is damaged...please restore from backup. But i din't made backup copy. How can i delete previous library and work wrom the new one?
Try this (assuming you're using iPhoto 12): make a temporary, duplicate copy of the library and try the three fixes below in order as needed:
Fix #1
delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your Home/Library/Preferences folder.
delete iPhoto's cache files that are located in your Home/Library/Caches/com.apple.iPhoto folder.
reboot, launch iPhoto and try again.
NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding the the Option key. You'll also have to reset the iPhoto's various preferences.
Fix #2
Launch iPhoto with the Command+Option keys depressed and follow the instructions to rebuild the library.
Select options #1, #2 and #6.
Fix #3
Rebuild the library using iPhoto Library Manager as follows:
Using iPhoto Library Manager to Rebuild Your iPhoto Library
Download iPhoto Library Manager and launch.
Click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option
In the next window name the new library and select the location you want it to be placed.
Click on the Create button.
Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments but not books, calendars or slideshows. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
OT -
How can I restore iPhoto titles and captions to iPhoto JPEGs sent to, and opened in, Aperture 3?
Thank you very much, Kirby. Your suggestion was exactly what I needed. It proved to be a big help even to my One-to-One Aperture trainer at the Naperville IL Apple store. My slideshow text, caption, and music attributes also were carried over intact to the new Aperture 3 environment. - A.Z.
-
I dont use the credit card i have in my account any more and I dont want to put in a new one, how can i delete that information and just download the free apps?
Changing Account Information
http://support.apple.com/kb/HT1918 -
How can I enable FTP on the DMP and How can I FTP to it and then remove the files that were deployed to the DMP flash? My platform of DMS is 5.2.2
Hi Temur, ok. I do the above procedure and it worked fine
Now, I have other question?
How can I reproduce any file (for example: a video, an url page, an image), that is in the flash of DMP?
Índice de ftp://172.17.15.22/tmp/ftproot/tmp/ftproot/tmp/ftproot/usb_1/
Subir al directorio superior.
Nombre Tamaño Última modificación
Sample Videos.lnk
1 KB
17/06/2011
06:25:00 a.m.
deployment
29/06/2010
04:14:00 a.m.
lost+found
25/02/2010
12:00:00 a.m.
video futbol en la playa.mp4
1390 KB
29/06/2010
01:08:00 a.m.
videofutbol.mp4
1390 KB
29/06/2010
01:38:00 a.m.
I like, that el DMP when loss conectivity with DMM, It display at the LCD screen, the video named videofutbol.mp4, this video As I show in the picture above, already in the flash of DMP.
I appreciate your early response.
Thanks -
What is NetAuthAgent and how can I get it to stop looking for the unnamed file?
Since the last Mountain Lion update on my MacBook Pro, I get this error message every few minutes:
2013-12-16 1:19:04.338 PM NetAuthAgent[1739]:
inErrorInfo = {
AuthType = Server;
ErrorNumber = 45;
ErrorType = 4;
Scheme = file;
How can I get it to stop looking for the unnamed file?
Kat NagelIf streaming music when connected to your carrier's cellular network, it uses cellular data.
Only the music you purchased from the iTunes Store can be streamed unless you have purchased iTunes Match.
If there is a slow down at the server where the music is stored or high traffic, steaming can be paused. You can also download a song from the iTunes Store cloud to your iPhone so it doesn't need to be steamed. -
My MS outlook on the PC is sending two invites in the icloud calandar. How can I stop this? I ony want the email send with my email address not the apple email.
My phone is the 4. Not the 4s. And I went there but it's nowhere the option to delete from server.
I only see: ask before deleting and it's on. -
Why can I not buy music and movies from the SA site with my SA credit card???
Why can I not buy music and movies from the SA site with my SA credit card???
I'll answer myself after reading the threads, now I am so sorry I bought the dam thing!!
-
I hope the is a differnence between auto-save (as listed in you document properties) and Auto-Recovery (as set in Prefs). I would like some "protection" but I don't want flash saving over my file unless I tell it to save. I got burn last night while "experimenting" and and did a "revert" only to find that flash had saved over my file, what a pain. I went to find the "recovery" file only to not find one anywhere. My search on the net are conflicted with wheather or not these 2 features are the same. In my case both items where checked and both set to 10min (the default). soooo....
Please tell me that Auto-Recovery is different, is that it doesn't save over my file, ie it keeps a real back-up someplace, AND where i can find this "recovery" file. ?
This feature seems strange, why not do a std auto back-up to a user selected number of versions in a user selected location ?
Thanks
JoelThanks. After poking around for a while I kinda figured this out. I was just glad to find out I could get some kind of "back-up" function from Auto Recovery, because "Auto Save" is a nightmare. I can't understand where anyone would want to use this feature at all. Anything that saves over what your working on before your ask for the file to be saved is looking for trouble. I found it out the hard way. I had "auto Save" on and after messing around trying a few different things, none of which worked or I liked, I thought I would simply close and re-open the original file only to find "auto save" had saved over my original file. I can't see any place where this feature would be anything but a pitb. If they want a auto save feature it should be saving versions of the original (up to a user specified number of instances) in the seperate folder. Never under any curcumstances should the original file be saved over unless the users presses SAVE. Auto recovery would be more useful if it didn't erase everytime you restarted the app. Flash needs to look at the back-up and versioning systems that AE and PPro use.
It's one of those things that bother you about the whole "suite" concept. Adobe owns all these apps and while some of them do play well together to an extent, for the most part it is still a collection of indiviuals. While there have been some changes to get the "look" of the apps to be close, the actual functioning of the UI in the differnt apps isn't where it needs to be. There needs to be a Suite "czar" that makes all the apps do std UI things the same using the same keys etc. for example AE, PPro, Flash, Photoshop, fireworks, all use different keys to zoom in/out or of your image/stage/comp/viewer/monitor window ie main workspace or to enable the mouse "wheel" for zooming. PPro still refuses to use the spacebar to toggle the hand tool like every other "suite app". anyway. a std system for back-up and versioning is need across the suite.
thanks
Joel -
How can I create a scene and move 3D models in INSIGHT with Labview?
Hi!
I need some help in doing a LabView application. What i have to do is controlling a 3D model represented in Insight with Labview. Something similar like the six-axis-robot example. I follow the insight configuration wizard, but nothing moves. Comparing the ".cis" files in my program and the one from the six-axis-robot, i found that in the six-axis-robot file contains something called localsystem and the one made by me, doesn't. Can be this the problem? How can I make it work? I would need some kind of step-by-step response, because i'am a beginner with Insight and 3D models. Thanks in advance!
Regards!
JuanThanks for the advice!
I'm actually finding the next problem. Although in my VRML file the objects are defined separately in a jerarchy tree, I can't move(rotate, translate) each object individually. I have noticed that when i define a new local system and asign it the points of the object i want move in the way you explain (right click, and then dragging the points to the new local axis), the movement of this object is dependent of the other local systems i have defined for other objects , specially if the slave nodes of the .cis file has a lower numeration than the object i want to move. The fact is, the movements assigned , for example to the nodes 1 to 100, will affect to the rest of the nodes if i also define for the rest of the nodes other movements. How can i solve this? I send you my .cis file, just in case my explanation is not enough clear. In this file you can see that movements assigned to nodes 1 to 4078, will also affect to nodes 4079 to 7168, and what i would like to do is define a movement for each obeject independently.
Thanks again!
Attachments:
ring.zip 2 KB -
how can i get FIND button and hotmail button to the toolbar, and how do i update firefox i dont want to update automatically
Thanx 4 your "you're welcome" cor-el. It's now 4p.m. E.S.T. in Melbourne, Victoria, Australia on Thu. 29/9/2011 and my page tells me u sent this message 21Hrs. ago. To elaborate a bit on my prev. message: I soon realized that after R clicking in the 'Downloads' screen and then on the 2nd. in the drop down menu I could click and drag and drop the icon of the wanted download into the open file or memory device as required. I would take up the offer I see in this e-mail to participate in helping like you and others do but I won't as I feel I'm not experienced enough yet. Nevertheless u keep up the good work. Yours, james1.51.
P.S. I used Google Chrome for this not Mozilla but it's still me! -
How can I spot quickly dublicated and copies of my original files?
Hi,
I am running out of space and cant seem to see why the little number of files that I assume that I have takes so much space!
I do suspect that I have dublicated files and several copies of original files (the file/s and folder/s names might be differing somehow, but most likely the content is the same or differ only slightly.
Is there a very fast and smart way to locate such dublicated and copied files of my original files anywhere on my Macbook?
I have applied some of the suggestions made in the forums on these topics, but non-was useful till now!Thank you for your support, and suggestions.
On the side may I ask you, considering a good cloud services compared to your suggested kind of HDD, which one would you end up suggesting more decisively incl. value for money / security / reliability / usefulness / user-orienttion?
As to my case, I have discovered many files, on my HDD that I "download" through opening the same emails with attachments several times - unknowingly! They were download each time without me being aware of this! I said without being aware as I didnt save them I just opened them to view as far as I am aware. The file names seem to change either at the beginning or end. Thats why I wasnt able to locate them quickly, and ended up with many dublicates, with small sized files its not an issues but if they are multimedia files and large ones they do take much space!
Is there a way to avoid this, while opening email attachments to view, what the stuff is all about before either deciding to save or skip after viewing? -
How can I attribute my edits before aperture to the raw files as versions?
Hi,
I am in the middle of importing all my files (approx 100,000) into aperture. I have previously made edits of my best images and in some cases have several edits for one 'master' file. How can I attribute or link the edits to the master files? I have followed a simple nomenclature, where the camera raw file was say bfes1001.tif, I would name the files bfes1001e1.psd or bfes10001e1-small.jpg, bfes1001e1-epson7600.psd. So my question is really two parts, first is there a way to link my old edits to the master raw files, and secondly is there a way to import photoshop files without flattening them? I can't image throwing away all that time making masks etc. If there is no way to import a layered photoshop file then is there a way to make an association to the files if I leave them outside of Aperture (althought that seems to defeat a big part of Aperture)?
Thanks,
EricThis is not a method suited to automation, but what you can do is:
1) Import original RAW into Aperture.
2) Edit in external editor - it creates a new version based on PSD or TIFF (you choose in options).
3) Kill external editor, replace created TIFF file with your new "master" tiff (or PSD). To do this just open the Aperture Library package using "Show Package Contents" in finder, do the same for the Project package held within the library, and finding the new TIFF version of your file. You could either replace the TIFF file before you return to Aperture form the editor or replace all the TIFF files with Aperture closed. The name must be identical. If you have a TIFF or PSD not in RGB mode Aperture will not like you much and probably crash whenever you go to view the picture.
That seems the most space-efficient way to me and keeps Aperture understanding that your edited TIFFS are versions of a particular master.
Maybe you are looking for
-
hi, have a iphone/macbook itunes prob. i connected my phone to mac to add songs, and it wiped 99% of music from my phone. on the mac it still lists the songs on my phone but they are greyed out. can anyone help? very frustrated and want my music back
-
I run windows 7. When I open a folder in Explorer that contains pdf's. Acrord32 starts up for each pdf previewed and does not close when leaving a preview or when closing explorer. eventually I run out of memory as each instance leaves 10meg open, an
-
Mixing sound files into one sound file. Urgent
Hi, I want to mix different sound files into one sound file but I don't have any idea of how to do this. Can anybody tell me how or just point me to the right tutorial. I do not want to do this through an applet. Thanks all in advance.
-
UI and Application Code?
I've been exposed to Java but without GUI. I've just started to learn swing and event handling. Normally in developing an application, the GUI code and the application code is preferrably separated. Now my question is, how do the application code and
-
Mouse behaving uncontrollable in Photoshop
I had a weird problem pop up suddenly in Photoshop only. When I try to use a tool such as clone or brush- the curser jumps around uncontrollably? Earlier, I changed the aspect ratio of a file to square, and I also cannot seem to reset it. Are these t