Find Jobs
Hire Freelancers

Applescript Help Assistance - add IF statement

$10-30 USD

Closed
Posted over 2 years ago

$10-30 USD

Paid on delivery
I have put together this applescript that when a file is added to an action folder, it makes a new directory based on the first portion of the file name, makes a directory called 'images' inside, and then Moves the input file to the 'images' folder inside the newly created folder. This all works GREAT, UNTIL. .dun-dun-dun.. The directory exists already!! (oh no) . So I tried adding some If statements and it still is running the rest of the script fine (which adds in some other files and moves the completed folder set to another folder on my hard drive), but I can not get the file with the same first portion of the name to Move or copy over.. It needs to add an IF Folder exists somewhere and trying to figure it out, but can not get this to work. Any help appreciated. Here is the code: tell application "Finder" activate set target of Finder window 1 to folder "MAKER" of folder "Desktop" of folder "nathan" of folder "Users" of startup disk make new folder at folder "MAKER" of folder "Desktop" of folder "nathan" of folder "Users" of startup disk with properties {name:fileName} set target of Finder window 1 to folder fileName of folder "MAKER" of folder "Desktop" of folder "nathan" of folder "Users" of startup disk make new folder at folder fileName of folder "MAKER" of folder "Desktop" of folder "nathan" of folder "Users" of startup disk with properties {name:"images"} set source_folder to folder "new-actiontester" of folder "Desktop" of folder "nathan" of folder "Users" of startup disk set source_folder_list to folder "img-list" of folder "Desktop" of folder "nathan" of folder "Users" of startup disk set source_files to every file in source_folder set source_files_list to every file in source_folder_list set target_folder to folder "images" of folder fileName of folder "MAKER" of folder "Desktop" of folder "nathan" of folder "Users" of startup disk set target_Go to folder "GO" of folder "Desktop" of folder "nathan" of folder "Users" of startup disk set folder_Number to folder fileName of folder "MAKER" of folder "Desktop" of folder "nathan" of folder "Users" of startup disk set target_folder_list to folder fileName of folder "MAKER" of folder "Desktop" of folder "nathan" of folder "Users" of startup disk repeat with i from 1 to number of items in source_files set source_file to (item i of source_files) move source_file to (target_folder) -- use "copy source_file to folder (target_folder as alias)" to copy the files end repeat repeat with i from 1 to number of items in source_files_list set source_file_list to (item i of source_files_list) copy source_file_list to folder (target_folder_list as alias) -- use "copy source_file to folder (target_folder_list as alias)" to copy the files end repeat copy folder_Number to folder (target_Go as alias) -- use "copy source_file to folder (target_folder_list as alias)" to copy the files end tell
Project ID: 32372218

About the project

1 proposal
Remote project
Active 2 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
1 freelancer is bidding on average $35 USD for this job
User Avatar
I can quickly fix your Applescript code (in a couple of hours) for just $35. All I need to start is your current script as a separate file (formatting here is broken). Roman
$35 USD in 1 day
4.9 (33 reviews)
5.3
5.3

About the client

Flag of UNITED STATES
Ypsilanti, United States
5.0
3
Payment method verified
Member since Mar 3, 2016

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.