Need someone to program Sikuli to perform some tasks for me - relatively easy for any programer

Asked by Oh No

Maybe I can figure this out with enough time, but I really don't have the time as I'm facing a number of fast approaching deadlines.

Here's what I'd like to achieve, and of course I'm willing to pay for someone to put together the code for me. I have many different students for who I need to put together some videos for using Windows Movie Maker. I will

I have a master folder, for the sake of simplicity we will call this student's master folder using her English name - "HAPPY" In this master folder there are master pictures with assorted names, for example "listen," "teacher," "important," "school," "goodbye" and so on.

Currently I need to create 65 new folders for each student numbered 1 through 65. In each of these folders need to copy some of the pictures from the master folder and rename those pictures.

For example in folder 1(one) I need to copy the files "listen," "school," "important," and "teacher"

Some important notes - there will only be one source file for each picture in the master folder, however, in almost every case there need to be multiple copies of the same picture in the created sub-folders. Eg. "listen" in folder one should be copied 6 times, each instance with a different name.

The names of these files are incredibly important and need to follow my exact template. Therefore they cannot just be a simple numbered sequence. Again in my folder 1(one) example the names for the listen files would need to be "22_listen", "27_listen", "50_listen", "57_listen - Copy", "60_listen - Copy - Copy" and finally "66_listen"

This is stage one of the project and for now might actually be sufficient.

Ideally though there are two other stages. The second stage would then be to copy the pictures from these 65 folders into other folders on my computer, where they will replace existing pictures. From my limited understanding the second two stages should actually be relatively straightforward,and in fact to achieve them I think I'd just need to know how to copy the contents of one folder to another in the quickest way possible. I think using commands would be much more efficient than making use of graphical interfaces so that's how I'd like to achieve this stage when possible.

I've managed to complete the third stage on my own... maybe... so no need to go into the details for now.

Hopefully this all makes sense, but if not I'd be happy to do my best to explain my case until someone understands! Thanks!

Question information

Language:
English Edit question
Status:
Expired
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

First of all, you have to create a simple text file, that contains line by line the following:

(items on a line should be comma separated, no need to use apostrophes)

line 1:
all image names in master folder

line 2 and following:
the filename of the respective subfolder and the list of image names to be contained in that folder

Then we can create a simple Python script, that reads the above file and:
1. interprets the master folder (first line) and checks it
2. reads line by line and creates the subfolders while copying and naming the respective images accordingly

No need to do that visually: Python has all instruments, to evaluate and create directories and copy files while renaming them.
The rest is some intelligent string handling (might be using regular expressions)

Come back with the above text file and I will help you to get on the road.

If you want we can talk directly using my mail at https://launchpad.net/~raimund-hocke

Revision history for this message
Rafiq Mohammed (rcholayil) said :
#2

If you are using windows, you can create an .bat file to execute all the commands that you need. Here's how you create a .bat file:

1. Open Notepad
2. List all the commands sequentially (one command in each line). Ensure that you hit enter after each command.
For example:
md c:\1
copy c:\happy\listen.jpg c:\1\22_listen.jpg
copy c:\happy\listen.jpg c:\1\27_listen.jpg
...

3. Save the file with the extension .bat
4. Double click the .bat file to execute all the commands in the file.

If you are using any other operating system, you will have some similar mechanism to execute commands.

Hope this helps.

Regards,
Rafiq

Revision history for this message
Oh No (123stw) said :
#3

@Raiman, I didn't know how to attach files here, so I emailed you instead.

@Rafiq, thanks as well for the suggestions. I just tried some rudimentary experimenting with .bat files, but for some reason the code won't execute. I'll eventually look into it further... really need to learn python - yet another thing on my worry plate :)

Revision history for this message
RaiMan (raimund-hocke) said :
#4

Got it. communicating offline now.

Revision history for this message
Oh No (123stw) said :
#5

I'm not sure whether I should start a new thread or just post my questions here.

I need to create many videos using movie maker. I've successfully setup sikuli to do this, but currently I rely too heavily on pictures/GUI rather than direct commands. This is error prone, not to mention slower, so I'm trying to eliminate my reliance on GUI wherever possible.

First a brief description of what I am trying to achieve.
Create folders and pictures for students. (done)
Copy these folders and their contents to student directories.
Also copy pictures to video directories
Create videos (either all, or some specified subset) -- (done, but sometimes returns an error)

More about the videos (well, picture slideshow) - there are about 65 videos, and each is contained in a separate folder. Let's say there are a group of 10 different students. To create each student's videos, I first need to copy their individual files(pictures) according to the specific video and overwrite them in the video folder. Then need to open Windows Movie Maker and save the video to a certain sub-directory of that student's folder. The name of the saved file should also include the student's name. For example video 2-JAS.mp4, will become 2-JAS-"student's name".mp4. the final result for that student should be about 65 videos in a sub-directory of the student's folder, all with their name appended to the video name. This part I can achieve using sikuli's GUI capabilities, but sometimes get errors. Because saving the videos can sometimes take quite some time depending on the total number of videos, I'd also like to automate the process to create, say, videos 1 to 65 for the first student, then for the second, third, fourth and so on until all the students have their videos. This I really have no idea how to accomplish unless some programming is involved. Any guidance on this would be greatly appreciated.

Notes: Sometimes Windows Movie Maker will return an error message - I've gotten around this by using if exists and then closing out the error message before proceeding. Also every now and then a notification urging me to update will pop up and might interfere with the saving process. This is also dealt with using if exists…

As usual, I can provide more details where necessary - and given my current sleep deprived state if someone can clearly understand my incoherent descriptions of this project I'll be surprised. Really shouldn't attempt to multi-task so often, and especially when getting by on such little sleep.

Revision history for this message
RaiMan (raimund-hocke) said :
#6

The same approach as I already setup for you for the copying of the master files to the student folders can be applied to all other mentioned steps as well:
Just setup the workflow for one student generally and then use an option file, that defines the specifics for each student, to be used as values for the variables when looping through the students.

Revision history for this message
Oh No (123stw) said :
#7

Is anyone still willing to work on the project outlined in post #5?

Thanks! Hope it's not against the rules/guidelines to resurrect such an old thread.

Revision history for this message
RaiMan (raimund-hocke) said :
#8

ok, I remember your case.

what is your current state?

you might again contact me privately.

Revision history for this message
Oh No (123stw) said :
#9

I was unable to work on this without your help, so the project came to a complete halt, but I'd really like to finish it.

I have sent you an email, thanks!

Revision history for this message
Oh No (123stw) said :
#10

How's everything going? How's the Windows MovieMaker workflow setup going?

Please give me an update when it's convenient.

Thanks!

Revision history for this message
RaiMan (raimund-hocke) said :
#11

sorry, but no progress the next 2 weeks: vacation.

Revision history for this message
Oh No (123stw) said :
#12

Vacation is quite understandable. Hope you had a relaxing time :)

If you need anything else, please let me know. I'm really looking forward to the final result.

Revision history for this message
Oh No (123stw) said :
#13

Is anyone still working on this, please? :(

Revision history for this message
Launchpad Janitor (janitor) said :
#14

This question was expired because it remained in the 'Open' state without activity for the last 15 days.