• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
applescript running slow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

applescript running slow


  • Subject: applescript running slow
  • From: "mailing list" <email@hidden>
  • Date: Thu, 09 May 2002 14:41:55 -0500

Hello everyone,

I have an applescript that runs when I drag images on top of it. It opens
them in photoshop that resizes them and saves them to 3 different
locations, zips each file and uploads them to our web server, uploads a
thumbnail version of each file into a filemaker product database. It
works fine except that it pauses for about 3-5 seconds at times during the
script. I am running OS9.2.2 Applescript 1.7. I even tried going back to
Applescript 1.6 but it still is pausing during the script.

Thanks,

Adrian

Here is my syntax:


on open
tell application "Finder"
activate

set selectFiles to selection

set list_count to count of items in selectFiles
repeat with x from 1 to list_count
set eachFile to item x of selectFiles

tell application "Adobe. Photoshop. 5.5"
activate
open eachFile as alias
do script "b&f_to_server"
end tell

end repeat

end tell

--select all print files that are not zipped
tell application "Finder"
activate

set zipPrint to (every file in folder "Server HD:WebSTAR Server Suite
4.2:Domains:BNF:FILEWEB:all_images:transfer:print_files" whose name ends
with ".jpg")

set p_list_count to count of items in zipPrint
repeat with x from 1 to p_list_count
set zipPrintFile to item x of zipPrint
tell application "DropZip"
activate
open zipPrintFile as alias
end tell
end repeat

set zipWeb to (every file in folder "Server HD:WebSTAR Server Suite
4.2:Domains:BNF:FILEWEB:all_images:transfer:web_files" whose name ends
with ".jpg")

set w_list_count to count of items in zipWeb
repeat with x from 1 to w_list_count
set zipWebFile to item x of zipWeb
tell application "DropZip"
activate
open zipWebFile as alias
end tell
end repeat

end tell

tell application "Finder"
activate

--move print zip files
set movePrint to (every file in folder "Server HD:WebSTAR Server Suite
4.2:Domains:BNF:FILEWEB:all_images:transfer:print_files" whose name ends
with ".zip")
move movePrint to folder "Server HD:WebSTAR Server Suite
4.2:Domains:BNF:FILEWEB:all_images:print_files" with replacing

--move web zip files
set moveWeb to (every file in folder "Server HD:WebSTAR Server Suite
4.2:Domains:BNF:FILEWEB:all_images:transfer:web_files" whose name ends
with ".zip")
move moveWeb to folder "Server HD:WebSTAR Server Suite
4.2:Domains:BNF:FILEWEB:all_images:web_files" with replacing



end tell

--delete print_files from transfer folder
tell application "Finder"

delete zipPrint
empty trash

delete zipWeb
empty trash

end tell


--import images into filemaker pro

tell application "Finder"
activate

set file_list to (every file in folder "Server HD:WebSTAR Server Suite
4.2:Domains:BNF:FILEWEB:all_images:transfer:filemaker")
--set list_count to count of items in file_list

set list_count to count of items in file_list

set search_string to ".jpg"
set replacement_string to ""

repeat with i from 1 to list_count
set item_name to the name of item i of file_list
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of the item_name
set AppleScript's text item delimiters to the replacement_string
set the new_item_name to the item_list as string
set AppleScript's text item delimiters to ""
set filemaker_item to new_item_name

tell application "FileMaker Pro"
activate
tell database "catalog database.fp5"

show every record
show (every record whose cell "product number" = filemaker_item)

set recCount to count of records
if recCount = 0 then
show every record
end if

do script "get_thumbnail_single"

end tell
end tell



end repeat

end tell

tell application "FileMaker Pro"
activate
tell database "catalog database.fp5"

do script "display_ok"

end tell
end tell



end open
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: how to separate every suite of an Osax
  • Next by Date: Re: Reversing the lines in a file
  • Previous by thread: Re: how to separate every suite of an Osax
  • Next by thread: Re: applescript running slow
  • Index(es):
    • Date
    • Thread