|
#9
| |||
| |||
|
awesome thank you so much! I'm just curious, but how would I configure the file to duplicate itself to other folders? |
|
#10
| |||
| |||
|
Actually, instead of bugging you repeatedly for this information, do you know where I can find a guide to the script language in layman's terms? Thanks! |
|
#11
| ||||
| ||||
|
Most scriptable applications contain some built-in documentation of their scripting features. In Script Editor, go to File > Open Dictionary, and then choose the application you want to script. In this case it would be the Finder, which is located at /System/Library/CoreServices/Finder.app On a related note, I wrote an AppleScript to make opening the Finder's scripting dictionary (which is something frequently need) easier: Code: tell application "Script Editor" activate open POSIX file "/System/Library/CoreServices/Finder.app" end tell Apple's AppleScript Language Guide is useful, but it's not a tutorial or a quick start guide. It's really about the more arcane aspects of AppleScript. Your best bet is probably to look through the scripting dictionaries of the apps you're interested it and Google around for examples and tutorials when you get stuck. |
| The Following User Says Thank You to Mikuro For This Useful Post: | ||
macbri (February 22nd, 2009) | ||
|
#12
| |||
| |||
|
Great! Thanks for the shortcut script. I'll be looking into that In the meantime, I was wondering if it is possible to embed photos, icons, etc. into the application for exporting via email? I know that this might take some java programming as well, but is it possible to bundle some photos with the app so that the script can access it on a different computer? Thanks |
|
#13
| ||||
| ||||
|
Sure, put all the images in a folder, along with the script, then send the whole folder out as a package. Zip it up to safe some bandwidth. If you want to create a single, double-clickable application that has all the resources include (images, icons, etc.), then I believe you're looking at creating a native Mac OS X application with XCode. I do not believe AppleScript has this capability, though I'm not experienced enough with it to say definitely one way or another.
__________________ Mac mini 2.0GHz 10.6.2 • 4GB • 320GB • Superdrive • 4 x 1TB USB 2.0 • LED Cinema Display MacBook 2.0GHz Core 2 Duo - White 10.6.2 • 4GB • 250GB • CD-RW/DVD-ROM iPhone 3G 8GB • iPod Touch 8GB • iPod Photo 60GB • iPod nano 1GB • AT&T U-Verse 18Mb/2Mb http://www.jeffhoppe.com |
|
#14
| |||
| |||
|
Hi, Thanks for the tip! I guess that makes sense, since scripts are designed to work with files and applications already present on the computer. Thanks to Miruko, My friends and I did some experimenting with the code provided earlier that duplicates the application some number of times when opened. However, we found that it wasn't annoying enough, since it only occupies one process for every open copy of itself. Therefore, we figured that if we somehow made the program so that it could select and open the copies of itself ONLY after a given amount of time, it can lag up more disk space (again, this is just for fun, not for malicious purposes). I figured that the modification should involve adding a timeout clause and repeat clause to make the application select after a certain number of copies is made, e.g. 5. For example, this is what I want to happen after the script runs click on app. app duplicates itself 5 times app selects itself and all 5 copies app opens all selected programs repeats Thanks for helping me- I'm really a computer noob D: tell application "Finder" repeat with i from 1 to 100 duplicate (the path to me) delay 1 end repeat end tell |
|
#15
| |||
| |||
|
Hi, I have spent the last week doing some research on my script: I think it works pretty well: What it does is it enables GUI modifying, dims the screen, mutes the audio, and then proceeds to duplicate itself. As for the duplicating process, this is what I have. tell application "Finder" tell application "Finder" repeat with i from 1 to 5 repeat with i from 1 to 5 duplicate (the path to me) end repeat *(code for selecting the copies of itself need to go here) open the selection end repeat end tell I'm not sure how to specifically target those new files. Once again, sorry for my incompetence. |
|
#16
| ||||
| ||||
|
The duplicate command returns a reference to the new copy. So you just need to store it somewhere. Try this: Code: tell application "Finder"
set file_list to {the path to me}
repeat with i from 1 to 5
set file_list to file_list & {(duplicate file_list)}
end repeat
end tell
The result is 32 copies of the script, since it doubles the number 5 times over (2^5=32). |
![]() |
| Bookmarks |
| Tags |
| applescript, duplicate, finder, script, timestamp |
| Thread Tools | |
|
|