Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 16, 2009, 08:05 AM   #1
rkyve
macrumors newbie
 
Join Date: Dec 2007
Script to create multiple apps

Hi

I need to create over 300 apps using applescript editor.

Each App will have the following:

tell application "Finder" to open file "File_Name-1.pdf" of folder "fscommand" of disk "DISKNAME"

The File_Name-1.pdf (including the extension) will change from an app to another.

Then this script needs to be saved as an application with ONLY RUN option and named filename1pdf.app - so I am changing all to lower case and stripping the "-", "_" and "."

Is their a way to automate this process without creating every single script and saving + renaming individually?

Any help will be much appreciated.
rkyve is offline   0 Reply With Quote
Old Jul 16, 2009, 08:14 AM   #2
sammich
macrumors 601
 
sammich's Avatar
 
Join Date: Sep 2006
Location: Sarcasmville.
There's a nice app called Automator.
__________________
Official MR IRC
Look at me, I'm own a bunch of things and everyone must know about every single one.
sammich is offline   0 Reply With Quote
Old Jul 16, 2009, 08:16 AM   #3
rkyve
Thread Starter
macrumors newbie
 
Join Date: Dec 2007
Thank you Sammich... I am aware Automator can save my day but I have no clue what to do.

This is why I am asking for assistance.
rkyve is offline   0 Reply With Quote
Old Jul 16, 2009, 08:19 AM   #4
sammich
macrumors 601
 
sammich's Avatar
 
Join Date: Sep 2006
Location: Sarcasmville.
Quote:
Originally Posted by rkyve View Post
Thank you Sammich... I am aware Automator can save my day but I have no clue what to do.

This is why I am asking for assistance.
Sorry, I was assuming that since you were dabbling in Applescript, you were familiar with Automator.

Okay. Fire up automator and you'll be asked to 'choose a starting point'. Select 'Files & Folders'. It'll ask you to select your files, you can do so now, or you can select/drag it into the list later (under 'Get Specified Finder Items'). Now, in the leftmost column you'll see a list of programs. Click on Files & Folders. In the second column find and drag 'Rename Finder Items' into the larger area on the right, under the existing list. It'll ask if you want to put something extra to copy the files. That's up to you. You'll need to drag 2 more below since you're doing three changes to the file name. These times select 'Don't Add'.

You'll see options for renaming: you're looking for 'Change Case' and 'Replace Text'. Change case is trivial, just choose Full name and lower case as options. Replace Text you need to put "-" in 'Find' and leave 'Replace' blank. The third rename is for your replace "_" with a blank.

Hope this makes sense.

I can also make this 'workflow' and send it to you as well. Download this, it will open in Automator. Have a look at it then run it.
Attached Files
File Type: zip remove_dashes_hyphens.zip (50.5 KB, 6 views)
__________________
Official MR IRC
Look at me, I'm own a bunch of things and everyone must know about every single one.

Last edited by sammich; Jul 16, 2009 at 08:39 AM.
sammich is offline   0 Reply With Quote
Old Jul 16, 2009, 08:43 AM   #5
rkyve
Thread Starter
macrumors newbie
 
Join Date: Dec 2007
Thanks a lot buddy but it seems I completely confused you

I already have the file names and the names of the .app i need to create:

10secrethidingplacepptx - 10SecretHidingPlace.pptx
10timeforschoolpptx - 10TimeForSchool.pptx
1tableswhatsmyquestionpptx - 1TablesWhatsMyQuestion.pptx
1whatamiwearingpptx- 1WhatAmIWearing.pptx
1whatsmywordpptx - 1WhatsMyWord.pptx
2coolcollectivenounspptx - 2CoolCollectiveNouns.pptx
2coordinatesmppptx - 2CoordinatesMP.pptx

etc.....


I actually need to automate the creation of the .APPs in the Script Editor.

Sorry for the confusion again - apologies!
rkyve is offline   0 Reply With Quote
Old Jul 16, 2009, 09:28 AM   #6
sammich
macrumors 601
 
sammich's Avatar
 
Join Date: Sep 2006
Location: Sarcasmville.
Well, it appears I'm a victim of my own skim reading

Okay, give me a minute now lol

Almost seems like you could've done this already without my help...
__________________
Official MR IRC
Look at me, I'm own a bunch of things and everyone must know about every single one.

Last edited by sammich; Jul 16, 2009 at 09:34 AM.
sammich is offline   0 Reply With Quote
Old Jul 16, 2009, 09:40 AM   #7
rkyve
Thread Starter
macrumors newbie
 
Join Date: Dec 2007
Quote:
Originally Posted by sammich View Post
Well, it appears I'm a victim of my own skim reading

Okay, give me a minute now lol

Almost seems like you could've done this already without my help...
Thank you for your help - highly appreciated!

I am manually creating the Apps in the Script Editor at the mo because I got to deliver today - can't risk it! - however this will take me hours ....hope you will come up with a solution that will save me individually creating the remaining 253 Apps!
rkyve is offline   0 Reply With Quote
Old Jul 16, 2009, 10:26 AM   #8
sammich
macrumors 601
 
sammich's Avatar
 
Join Date: Sep 2006
Location: Sarcasmville.
Check your Private messages
__________________
Official MR IRC
Look at me, I'm own a bunch of things and everyone must know about every single one.
sammich is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
HELP- Want to learn how to code ios apps /create iphone apps jaalle iPhone/iPad Programming 12 Jan 28, 2014 12:35 AM
Create script to log malicious actions Cecil888 Mac Basics and Help 0 Jan 8, 2014 12:33 AM
Auto-login Multiple users who then launch a script RobQuads Mac OS X Server, Xserve, and Networking 6 Oct 9, 2013 08:11 PM
How to create a shell script and run it? Killwin98 Mac Programming 3 Mar 18, 2013 07:39 PM
Cannot create multiple buttons Baddicus iPhone/iPad Programming 5 Sep 6, 2012 10:05 AM

Forum Jump

All times are GMT -5. The time now is 08:18 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC