Colortron Posted July 29, 2013 Share Posted July 29, 2013 I am new in programing and looking for an action on folder for PC. I need a folder when you load a CIP3 .ppf file call an application and save in another folder with the default format. thanks in advance. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 29, 2013 Moderators Share Posted July 29, 2013 Colortron,Welcome to the AutoIt forum. But please pay attention to where you post - the "Examples" section where you started this thread is clearly marked: "This is NOT a general support forum!". I have moved the thread for you, but would ask you to be more careful in future. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Colortron Posted July 29, 2013 Author Share Posted July 29, 2013 Colortron, Welcome to the AutoIt forum. But please pay attention to where you post - the "Examples" section where you started this thread is clearly marked: "This is NOT a general support forum!". I have moved the thread for you, but would ask you to be more careful in future. M23 I am sorry this is my firts post, i will take care in the future. Thanks Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 29, 2013 Moderators Share Posted July 29, 2013 I am new in programing and looking for an action on folder for PC. I need a folder when you load a CIP3 .ppf file call an application and save in another folder with the default format. thanks in advance. Hi, Colortron, welcome to the forum. Unfortunately, you could not have provided less information if you'd tried. Can you please tell us: What do you mean "load a CIP3.ppf file? Drag and drop on a GUI? Browse to it from a File Open Dialog? Prompt the user to type in a path? When you say "call an application"? What application? What is tha path to the application? Are you just opening the application, or do you need to pass parameters? When you say "save in another folder with the default format"? What folder are you saving to? Is the default format different from what it starts out as (.ppf)? As you can see, your post leaves a lot to be desired. Please fill in some of the blanks, and help us help you "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Colortron Posted July 29, 2013 Author Share Posted July 29, 2013 Load a CIP3 file. We use an 2007 RIP (Raster Image Procesor) that let save a CIP3 file anywhere. The printing machine dont understand this kind of file so we have to open CipConv.exe to covert the CIp3 file (.ppf) to a .hip file that´s the format the machine interpret. The idea is that the prepress worker save the cip3 file in a monitored folder in the machine operator pc and this one only have to load this .hip file. Thank you for your patience Hi, Colortron, welcome to the forum. Unfortunately, you could not have provided less information if you'd tried. Can you please tell us: What do you mean "load a CIP3.ppf file? Drag and drop on a GUI? Browse to it from a File Open Dialog? Prompt the user to type in a path? When you say "call an application"? What application? What is tha path to the application? Are you just opening the application, or do you need to pass parameters? When you say "save in another folder with the default format"? What folder are you saving to? Is the default format different from what it starts out as (.ppf)? As you can see, your post leaves a lot to be desired. Please fill in some of the blanks, and help us help you ;)We use a Rase Link to comment Share on other sites More sharing options...
MarkRobbins Posted July 30, 2013 Share Posted July 30, 2013 (edited) Heres a framework for you: expandcollapse popup#include <File.au3> #include <Array.au3> Global $exe_converter='<fullpath to exe>' ; be sure to used dot Global $file_ext_to_monitor='.cip3' Global $file_ext_new='.hip' ;watch this path for files of $file_ext_to_monitor: Global $path_to_monitor='C:\some\path' ;files of $file_ext_to_monitor will be moved to: Global $output_path_src='C:\some\other\path' ;files of $file_ext_new will be moved to: Global $output_path_new='C:\some\other2\path' ;Change to false to get it to work Global $testing=True ; if your program allows you to specify a full output path, use way 0, otherwise this program will move it Global $call_way=0 ;template for the call, YOU MAY HAVE TO MODIFY TO SUIT Global $call_mask If False Then ElseIf $call_way==0 Then ; use this way ; if you can specify FULLPATH FULLPATH $call_mask='"%exe_converter%" "%in_src_file%" "%in_new_file%"' ElseIf $call_way==1 Then ; use this way ; if you can specify FULLPATH and the file is created in current dir $call_mask='"%exe_converter%" "%in_src_file%"' EndIf ; in test mode we will only do one file Global $check_every_seconds=60 ; filling in your specification from above for the exe Global $call=StringReplace($call_mask,'%exe_converter%',$exe_converter) Local $a ; do it forever, the script can be terminated from its tray icon ; but if we are testing only simulate one file While True ;_FileListToArray($sPath [, $sFilter = "*" [, $iFlag = 0]]) $a=_FileListToArray($path_to_monitor, '*'&$file_ext_to_monitor,1); 1= get only files If $testing Then _ArrayDisplay($a,'Candidate Files in '&$path_to_monitor) EndIf Local $x,$end=$a[0],$i Local $c Local $out_src_file Local $out_new_file Local $in_src_file Local $in_new_file For $x=1 To $end $i=$a[$x] $out_src_file=getSrcOutFilePath($i) $in_src_file=getSrcOutFilePath($i) ; $out_new_file=getNewOutFilePath($i) $in_new_file=getNewInFilePath($i) ; If $testing Then MsgBox(0,'Files are:', _ '$in_src_file:'&$in_src_file&@CRLF _ &'$out_src_file:'&$out_src_file&@CRLF _ &'$out_new_file:'&$in_new_file&@CRLF _ &'$in_new_file:'&$in_new_file&@CRLF _ ) EndIf $c=StringReplace($call,'%in_src_file%',$in_src_file) If $call_way==1 Then $c=StringReplace($c,'%in_new_file%',$in_new_file) EndIf ; If $testing Then MsgBox(0,'The following command would be run:',$c&@CRLF&'In Directory:'&$path_to_monitor) Else RunWait($c,$path_to_monitor); EndIf ; If $testing Then MsgBox(0,'Source File Moved','from:'&$in_src_file&@CRLF&'To:'&$out_src_file) Else FileMove($in_src_file,$out_src_file);move it so it doesnt happen again EndIf ; If $call_way==1 Then If $testing Then MsgBox(0,'Call way is 1, so New File Moved','from:'&$in_new_file&@CRLF&'To:'&$out_new_file) Else FileMove($in_new_file,$out_new_file);move the output EndIf EndIf ; If $testing Then Exit EndIf Next Sleep($check_every_seconds*1000) WEnd Func getNewOutFilePath($i) Local $szDrive, $szDir, $szFName, $szExt _PathSplit($i,$szDrive, $szDir, $szFName, $szExt) Return $output_path_new&'\'&$szFName&$file_ext_new EndFunc Func getNewInFilePath($i) Local $szDrive, $szDir, $szFName, $szExt _PathSplit($i,$szDrive, $szDir, $szFName, $szExt) Return $path_to_monitor&'\'&$szFName&$file_ext_new EndFunc Func getSrcOutFilePath($i) Local $szDrive, $szDir, $szFName, $szExt _PathSplit($i,$szDrive, $szDir, $szFName, $szExt) Return $output_path_src&'\'&$szFName&$szExt EndFunc Func getSrcInFilePath($i) Local $szDrive, $szDir, $szFName, $szExt _PathSplit($i,$szDrive, $szDir, $szFName, $szExt) Return $path_to_monitor&'\'&$szFName&$szExt EndFunc Edited July 30, 2013 by MarkRobbins Link to comment Share on other sites More sharing options...
Colortron Posted July 30, 2013 Author Share Posted July 30, 2013 Heres a framework for you: expandcollapse popup#include <File.au3> #include <Array.au3> Global $exe_converter='<fullpath to exe>' ; be sure to used dot Global $file_ext_to_monitor='.cip3' Global $file_ext_new='.hip' ;watch this path for files of $file_ext_to_monitor: Global $path_to_monitor='C:\some\path' ;files of $file_ext_to_monitor will be moved to: Global $output_path_src='C:\some\other\path' ;files of $file_ext_new will be moved to: Global $output_path_new='C:\some\other2\path' ;Change to false to get it to work Global $testing=True ; if your program allows you to specify a full output path, use way 0, otherwise this program will move it Global $call_way=0 ;template for the call, YOU MAY HAVE TO MODIFY TO SUIT Global $call_mask If False Then ElseIf $call_way==0 Then ; use this way ; if you can specify FULLPATH FULLPATH $call_mask='"%exe_converter%" "%in_src_file%" "%in_new_file%"' ElseIf $call_way==1 Then ; use this way ; if you can specify FULLPATH and the file is created in current dir $call_mask='"%exe_converter%" "%in_src_file%"' EndIf ; in test mode we will only do one file Global $check_every_seconds=60 ; filling in your specification from above for the exe Global $call=StringReplace($call_mask,'%exe_converter%',$exe_converter) Local $a ; do it forever, the script can be terminated from its tray icon ; but if we are testing only simulate one file While True ;_FileListToArray($sPath [, $sFilter = "*" [, $iFlag = 0]]) $a=_FileListToArray($path_to_monitor, '*'&$file_ext_to_monitor,1); 1= get only files If $testing Then _ArrayDisplay($a,'Candidate Files in '&$path_to_monitor) EndIf Local $x,$end=$a[0],$i Local $c Local $out_src_file Local $out_new_file Local $in_src_file Local $in_new_file For $x=1 To $end $i=$a[$x] $out_src_file=getSrcOutFilePath($i) $in_src_file=getSrcOutFilePath($i) ; $out_new_file=getNewOutFilePath($i) $in_new_file=getNewInFilePath($i) ; If $testing Then MsgBox(0,'Files are:', _ '$in_src_file:'&$in_src_file&@CRLF _ &'$out_src_file:'&$out_src_file&@CRLF _ &'$out_new_file:'&$in_new_file&@CRLF _ &'$in_new_file:'&$in_new_file&@CRLF _ ) EndIf $c=StringReplace($call,'%in_src_file%',$in_src_file) If $call_way==1 Then $c=StringReplace($c,'%in_new_file%',$in_new_file) EndIf ; If $testing Then MsgBox(0,'The following command would be run:',$c&@CRLF&'In Directory:'&$path_to_monitor) Else RunWait($c,$path_to_monitor); EndIf ; If $testing Then MsgBox(0,'Source File Moved','from:'&$in_src_file&@CRLF&'To:'&$out_src_file) Else FileMove($in_src_file,$out_src_file);move it so it doesnt happen again EndIf ; If $call_way==1 Then If $testing Then MsgBox(0,'Call way is 1, so New File Moved','from:'&$in_new_file&@CRLF&'To:'&$out_new_file) Else FileMove($in_new_file,$out_new_file);move the output EndIf EndIf ; If $testing Then Exit EndIf Next Sleep($check_every_seconds*1000) WEnd Func getNewOutFilePath($i) Local $szDrive, $szDir, $szFName, $szExt _PathSplit($i,$szDrive, $szDir, $szFName, $szExt) Return $output_path_new&'\'&$szFName&$file_ext_new EndFunc Func getNewInFilePath($i) Local $szDrive, $szDir, $szFName, $szExt _PathSplit($i,$szDrive, $szDir, $szFName, $szExt) Return $path_to_monitor&'\'&$szFName&$file_ext_new EndFunc Func getSrcOutFilePath($i) Local $szDrive, $szDir, $szFName, $szExt _PathSplit($i,$szDrive, $szDir, $szFName, $szExt) Return $output_path_src&'\'&$szFName&$szExt EndFunc Func getSrcInFilePath($i) Local $szDrive, $szDir, $szFName, $szExt _PathSplit($i,$szDrive, $szDir, $szFName, $szExt) Return $path_to_monitor&'\'&$szFName&$szExt EndFunc thank you very much Mark, i will probe it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now