• 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
Re: Fwd: Network volume considerations when working with files?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: Network volume considerations when working with files?


  • Subject: Re: Fwd: Network volume considerations when working with files?
  • From: Brett Conlon <email@hidden>
  • Date: Thu, 2 Aug 2007 11:52:54 +1100


This has been a blindingly hectic project so I haven't been able to much troubleshooting but with this script it simply wouldn't produce any results on volumes mounted over the network. If the script was run locally it would successfully find items.

The other script I have is my AutoPrint to PDF script which creates a PDF on the desktop then moves it to the job's Dispatch folder. Whenever someone runs it on a Quark file they have opened up from someone's Mac mounted on the desktop the script has trouble moving it to the job's Dispatch folder and ditches out of the try statement to return my error statement "Sorry, I had troubles moving your PDF. It's still on the desktop...." and so on.

From these two scripts I know I have gaps in my understanding of how to deal with files over network volumes and I know I still need to learn more about working with aliases etc.

Ta muchly,

Coj

ps. my apologies for sending the below email to the list again... I didn't see that you forwarded it to the list (THANKS!) It's just so hectic here at the mo, I can't tell my ass from my face, but, hey, neither can anyone else. ;-D



"Mark J. Reed" <email@hidden>
Sent by: applescript-users-bounces+brett.conlon=email@hidden

01/08/07 11:46 PM

To
"Applescript Users" <email@hidden>
cc
Subject
Fwd: Network volume considerations when working with files?





Brett sent this only to me instead of to the list... I can't look at it right now but maybe Ed or someone else can.  

Brett: the text of the error messages would also be helpful.

---------- Forwarded message ----------
From: Brett Conlon <
email@hidden >
Date: Aug 1, 2007 1:01 AM
Subject: Re: Network volume considerations when working with files?

Here's the script... thanks to the recent thread about spotlight searching I was able to write the below script. It scanned 67GB of PDF files to find 1500 jobs containing specific catalogue numbers inside them - all in one swift go! I estimated that it saved us almost 42 hours worth of locating, moving and naming the files manually - Go AppleScript!!!!


I've deleted the Pashua dialog handle but here's the script - plz go easy on me... I still feel like I should be in AppleScript nappies (Oz for diapers).


on
run
       
set ThisSearch to ""
       
DoThis(ThisSearch )
end
run

on
open ThisSearch
       
if class of ThisSearch is not folder then
               
display dialog "Only drop FOLDERS you wish to search onto this script." buttons {"Sorry"} default button 1 with icon stop
       
else
               
DoThis(ThisSearch)
       
end if
end
open


on
DoThis(ThisSearch)
       
       
set pashuaResult to my pashua_run(ThisSearch)
       
set ThisSearch to ThisSearch of pashuaResult
       
set TheDestination to TheDestination of pashuaResult
       
set TheDestination to POSIX file TheDestination
       --
set SearchElements to SearchElements of pashuaResult (*this is commented out coz I couldn't get Pashua to return more than the first value from a whole column of values copied & pasted from an Excel spreadsheet, so I had to resort to the below AppleScript dialog*)
       
set SearchElements to paragraphs of text returned of (display dialog ¬
               "Enter text to search. Note: separated multiple items by a return:"
default answer return)
       
set CopyMove to CopyMove of pashuaResult
       
       
set POSIXSearch to quoted form of POSIX path of ThisSearch
       
       
tell me to activate
       
repeat with anElement in SearchElements
               
try
                       
set FoundFile to (do shell script "mdfind -onlyin " & POSIXSearch & " \"kMDItemTextContent == '" & anElement & "'\"") as Unicode text
                       
set AppleScript's text item delimiters to return --this helps split up multiple found items
                       
set myItems to text items of FoundFile
                       
set AppleScript's text item delimiters to ""
                       
repeat with i in myItems
                               
set i to POSIX file i
                               
tell application "Finder"
                                       
set iName to name of i
                                       
if CopyMove is "Move" then
                                               
set IMoved to move i to TheDestination
                                       
else
                                               
set IMoved to duplicate i to TheDestination
                                       
end if
                                       
set the name of IMoved to anElement & " " & iName
                               
end tell
                       
end repeat
               
on error
                       ""

               
end try
       
end repeat
       
tell application "Finder"
               
open TheDestination
               
activate
               
beep 2
               
display dialog "The search is complete."
       
end tell
end
DoThis




--
Mark J. Reed <
email@hidden> _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Fwd: Network volume considerations when working with files?
      • From: Axel Luttgens <email@hidden>
References: 
 >Fwd: Network volume considerations when working with files? (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Network volume considerations when working with files?
  • Next by Date: Re: Help with find text command
  • Previous by thread: Fwd: Network volume considerations when working with files?
  • Next by thread: Re: Fwd: Network volume considerations when working with files?
  • Index(es):
    • Date
    • Thread