AppleScript - creat a folder, subfolders and fill it with the sample image
Please help me to achieve this goal, no doubt, simple goal.
I did only a very small amount of applescripting before and always slaughtered other scripts of resources available online but am having hard to identify ways to achieve this.
I would like to use applescript to automate the creation of a simple folder NewFolder and newSubFolders structure in a destination that the user can choose and the number of subfolders (subCount), selected using the command prompt:
subCount value to text returned of (display dialog "how subfolders?" by default of answer 85)
The NewFolder will always be in a format of date backwards for example 160202 for 2 February 2016.
The sub folder names end with 3 numeric characters, leading 0s to whole number less than 100:
160202_001, 160202_002, 160202_003 etc etc.
With all these responses need the user to select an image file and duplicated it or should that be copied to all of the subfolders created by this script.
All I got so far is to create a script that creates the folder with subfolders structure, but does not work how do the names of the end of records with 3 numeric characters or find out how copy/duplicate a file for each subfolder created by the script.
Here's my starting point:
the value JobName to text returned of (display dialog "Please enter Date reference:" default of '160411' response)
loc to choose a folder with guest "choose the Parent folder location:
say application 'Finder '.
targetFolder value to create a new folder in loc with properties {name: JobName}
end say
Repeat
subCount value to text returned of (display dialog "how subfolders?" by default of answer 85)
Try
If subCount ≠ "" then
whole subCount
output Repeat
end if
end try
end Repeat
Repeat with I have from 1 to subCount
display the dialog box "my variable:"& I ".
say application "Finder" to create a new folder to targetFolder with properties {name: JobName & "_" & I}
end Repeat
filetoCopy to Choose file with prompt "choose the image file to be copied."
display the dialog box "my variable:" & filetoCopy ".
It does not really matter I order in which the script should occur, i.e. the image file to be copied can be selected first before the creation of the all the subfolders etc... as long as the end result is the same structure.
I had a look by adding leading 0s to a name of folder but don't really understand how I could do within the repetition that exists in my script.
Any help much appreciated.
Mike
Although this still needs a lot of storage (including the addition of error checking) I managed to get working folders creating and copying a file to the set of folders.
I'd appreciate it again any help in renaming with 000 leader after the _in, folder names.
Here's where I'm up to:
the value JobName to text returned of (display dialog "Please enter Date reference:" default of '160411' response)
loc to choose a folder with guest "choose the Parent folder location:
say application 'Finder '.
targetFolder value to create a new folder in loc with properties {name: JobName}
end say
Repeat
subCount value to text returned of (display dialog "how subfolders?" by default of answer 85)
Try
If subCount ≠ "" then
whole subCount
output Repeat
end if
end try
end Repeat
Repeat with I have from 1 to subCount
say application "Finder" to create a new folder to targetFolder with properties {name: JobName & "_" & I}
end Repeat
say application 'Finder '.
_destination to choose a folder with guest from "choose the main folder created above:
filetoCopy to Choose file with guest "choose image file copy:
display the dialog box "my variable:" & filetoCopy ".
the value _listOfDest to (each of _destination folder ) as alias list
Repeat with CurrentNumber from 1 to (count _listOfDest)
duplicate filetoCopy file to the file (article of _listOfDest CurrentNumber)
end Repeat
end say
Tags: Mac OS & System Software
Similar Questions
-
I need to draw a shape irregular, closed, which is a series of joined lines and fill it with the color, etc., I can only see square, polygon, etc...
Any suggestions?
You can set the polygon tool to 3 sides, or use the pen tool.
-
How to measure and fill it with the same transparency?
for example the creation of a fill using Edit > fill with a random color and opacity in the fill dialog box, then later without the original on the color and opacity information but just the file, how can I do exactly the same fill and opacity again?
If you have a partially transparent layer and then use "layer > Layer Mask > transparency" to convert the full opacity layer and a mask.
This will give you the color of each pixel and the opacity of each pixel grayscale representation.
-
* Original title: printer print only symbols
Hello world
When I print a MS Word document my printer prints symbols but when I create a new document and try to print the new document of his impression. If my old document is damaged to corrupt so how do I fix it
Old documents are probably corrupt. Check out these links:
How to troubleshoot print failures in Word: https://support.microsoft.com/en-us/kb/826845
How to troubleshoot printing problems in Word: https://support.microsoft.com/en-us/kb/826862
Troubleshooting damaged in Word documents: https://support.microsoft.com/en-us/kb/918429
And this announcement in Office/Word groups is a better idea. This may very well be a FAQ here.
-
My Lightroom went completely wonky. 'Fit' and 'Fill' overthrew. The central panel stretches images. The panels are blacking out and endangered. Keyboard shortcuts do not work. I can't scroll through images. Photoshop is now malfunction also. Everybody runs into this and what should I do?
Hi jodyd25200366,
Could you please confirm the version of Lightroom, also the side panels are completely black and also if you can attach a screenshot.
Kind regards
Tanuj
-
I tried to create a Table version of the-Tablet command line just below the horizontal menu, but it creates a blank page and no content of the version of office without worrying. I cleared the table and tried several times but no result.
Just look closely at the opoins:
Here is no option to copy the content of a page
-
I exported my Premium Pro movie to a .m2v file. When I try to open a new project so that I can create a DVD file and I can choose the .m2v file, it is grayed out. Also, if I double click on the .m2v file, it opens, but will not play and seems to be locked or frozen. What can I do?
Again, you use "import as" assets or timeline?
-
quickly create with filter-date and initialize it with the current date
Oracle BI 11 g
Hello!
I need to create guest of dashboard with filter-date and initialize it with the current date. How can I do?
I tried to create the repository initialization block and add a variable. But I don't know what should I write to DataSource? I tried using the Current_Date, Now(), sysdate functions (for example, SELECT Now() FROM tbl_Calendar) but without results - when I pressed the button "Test"... "I have errors - something like 'Now() is unknown function' or 'incorrect syntax near keyword Current_Date.
After that, I made to use presentation Variable in the command prompt, but also without success (())
Please, help me.Use "Server Variable.
-
On oracle cloud virtual, image I was able to create the database using DBCA (virtual image) oracle cloud. I understand with the virtual image, we won't have a lot of tools like on DAAS cloud. But could please at least use us dbconsole?
I tried to start dbconsole, and it did not work:[oracle@ltutest ~] $ emctl start dbconsole
OC4J Configuration problem. /U01/app/Oracle/product/11.2.0/dbhome_1/OC4J/J2EE/OC4J_DBConsole_ltutest.compute-aulatrobeu83140.oraclecloud.internal_ORCL not found.
According to the oracle help doc center - "creating a database on an instance of virtual image service" (http://docs.oracle.com/cloud/latest/dbcs_dbaas/CSDBI/GUID-29290A81-8798-4988-848E-77A1BE0CF08A.htm#GUID-4851560B-D4B6-42...)
database was created with the option as:
emConfiguration - NONE - storageType FS
I guess we have to manually configure the em console, but when I tried to create it, he told me that "' Dbcontrol repository already exists." "
When I try to start it, it exports the error
[Oracle@ltutest ~] $ emctl start dbconsole
OC4J Configuration problem. /U01/app/Oracle/product/11.2.0/dbhome_1/OC4J/J2EE/OC4J_DBConsole_ltutest.compute-aulatrobeu83140.oraclecloud.internal_ORCL not found.
Could someone could give me help with this problem?
Thanks Brian. I tried your command, and it works. Now I've encountered another problem, how can I browse the URL?
I created the access rule for access remote on port 1521 and 1158. but when I try to browse the EM console URL, it does not work. all the configurations that I need to do?
-
I have Acrobat Pro on my computer and I work with the drawing that have been digitized in PDF format. The scanners are not aligned or place because of the poor scanning process. Is there anyway to align the document even if it requires me to crop or lose some on the edges?
Hi brad.
Yes. You can use the analysis tools to straighten and crop your document. Here is a link to a new tutorial. The key to activate the sliding options recovery is to choose the option of the camera Image in the drop to Enhance, and gives you tools to set the correct page for smoothing areas.
Donna.
-
I have a Nikon D 810 camera and Photoshop CS5. I downloaded camera 8.8 Raw and DNG converter. I can't open the raw (.nef) files, and treat them with the DNG Converter. What's not? Thank you!
As I said earlier, the DNG Converter works ONLY on files, not on files.
Do not target the individual files. Target Of THE FOLDER that contains them.
Make sure that said FILE DO NOT contain any other files , you have already settled before, or your settings will be eliminated when re-converted to DNG.
No need to write long explanations. More messages are, the more chances you have of receiving relevant responses.
-
Started MacBook and not charging with the charger connected. Charger works. Keyboard does not not except the power button / stop. Restarted ex drive no available help hoping that it was a matter of SW. SW and the operating system works very well. Read some info online. Tried to reset the SMC. Now, the MacBook does not start. Can U help me please. Thanks in advance.
MacBook, 2010, Mac OS X 10.6.8
Hi Veronica Steward,.
I understand that you have turned into a series of questions about your MacBook and want help getting the computer to turn on. Here is an article that can help you through the steps to fix this problem:
If your Mac will not turn on - Apple Support
Let us know how it goes and thanks for coming to Apple Support communities.
See you soon.
-
I have an imac 27 "... on power there is no signal to startap, usb ports are not working and its deadlock with the logo of the Apple with the circle of rotation... Help, please
Wake the computer to your Apple store or Apple authorized service for the service provider. He probably suffered a hardware failure.
-
Portege M400: Is it possible to receive and make calls with the SIM card
Is it possible to receive and make calls with the card SIM module in the Portege M400?
I know that you can send and receive sms messeges, which, according to me, the software is not all good because you can't hold much, and you can't send to ems or mms.
But there may be other software here?
Hello
What software do you mean exactly?
As far as I know that the MobiLink was preinstalled on some units Portege M400.
This software supports these features:
Send and receive SMS, composition and read TEXT messages in several languages, compose and send to multiple recipients, the mobile contacts address book support, Rich edit for the launch of URL and Email using embedded addresses.As you can see that you can not use this software to make calls!
And unfortunately other software does not know me :(With regard to the MobiLink Communications Software Suite;
The details can be verified here:
http://www.novatelwireless.com/products/solutions/MobiLink.htmlGreetings
-
Satellite Pro M10 will not start again and comes up with the error message
My laptop Toshiba Satellite Pro M10 will not start again and comes up with the error message "load error" when I press the power button.
The arised problem after installation of the 'symantec system works' and try to restart windows XP Professional to make the installed executable program.What can I do to get the notbook again reboot?
Hello
Seems that there are problems with the files of GoBack.
Try to boot in safe mode and remove the Norton System works from your laptop ;)
If this does not help, you will need to recover the laptop with the recovery CD Toshiba delivered!Also I recommend to visit the Symantec support site and to check the solutions to the problem with the Norton System Works programs
Good luck
Maybe you are looking for
-
Latest Firefox does not display google adds on my pages.
Www.alternativa.hr do not show Google Ads and Facebook and Google extensions + does not work as well... On other browsers and older versions of Firefox, not such a problem - everything works fine.Can you help me here?
-
VGN-NW275f Factory Reset &; possibly keep some programs?
Hello community of Sony, my laptop is a VGN-NW275f with Windows 7 Home Premium. I would like to get back to its factory condition and if possible keep some of the market after programs I have purchaced on the laptop. Is this possible? I've heard of a
-
How public cloudworks on other countries?
public cloud is safer after implementation? This is what an algorithm is supported for the exchange of the document for all countries? If security would be how they can group form on resources? In the mobile data sharing through computer Internet is
-
my Start menu is missing. I do not see the bar of tasks or clock or my Start button.
-
Hi, it's so simple, but I just forgot... I opened my laptop and the diagnosis came on your wireless network is not activated by saying... use of the buttons, which I don't have on the front or the side, or use the keyboard to turn on... I forgot is c