• 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: Re 10.3 applescripts in 10.4
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re 10.3 applescripts in 10.4


  • Subject: Re: Re 10.3 applescripts in 10.4
  • From: Francisco T Seeto <email@hidden>
  • Date: Sat, 24 Feb 2007 22:40:16 +1100
  • Thread-topic: Re 10.3 applescripts in 10.4

Title: Re: Re 10.3 applescripts in 10.4
Hi Peter,

No these arent for the sites we service but for our production area where we have Macs that are on 10.3.8 and are being re imaged with 10.4.8. AppleScripts that we use to automate some of our Job functions as artists arent working they get up to where you can choose either “new” or Existing and it falls over.

See attached Script

if UDAC = 2 then
                   if (count of PStyles) is greater than 1 then
                       if item 2 of PStyles is "LN" then set SubUdac to "Trade"
                    else
                       set SubUdac to "TMH"
                    end if
                   
                    
                    -- This part is true for all IC ads. Declared outside the "If Trade" string so the variables are declared for the primary block always, Secondary block is only built and declared if ad is trade. Although will need a seperate handle for TMH's as these are trades but have no listed info only the Brand name
                   set bottie to ad height of sizeOfAd
                   set wyde to (ad width of sizeOfAd) - 6.0
                    if SubUdac is "trade" then set wyde to ad width of sizeOfAd
                   
                    display dialog "Is this ad a new or existing IC ad" buttons {"New", "Existing"} default button 2
                    if the button returned of the result is "New" then
                       set valueNew to true
                   else
                       set valueNew to false
                   end if
                   
                    tell document 1
                        
                        tell last text flow
                           set MYID to ID
                           set PrimaryElementID to MYID - 1
                            set name to "textBox" & MYID
                           set mainBlockTB to name
                       end tell
                   end tell
                   --if SubUdac is not equal to "TMH" then
                   tell document 1
                        tell text flow id MYID
                           select line 1
                            cut
                       end tell
                   end tell
                   --end if
                   
                    make new text flow at beginning of document 1 with properties {create block with bounds:{top:-25.0, left:-153.0, bottom:54.0, right:197.0}}
                    set name of last text flow of document 1 to "textBox"
                    tell document 1
                        tell (text flows where name is "textBox")
                            set ElementHolder to ID
                           set name to "textbox" & ElementHolder as string
                           set secondBlockTB to name
                           set SecondaryElementID to ElementHolder - 1
                        end tell
                   end tell
                   paste
                   tell document 1
                        if SubUdac is not "TMH" then
                           tell (text flows where name is "textbox" & ElementHolder)
                                delete last character of line 1
                            end tell
                       end if
                       
                        
                        if valueNew is true then
                           
                            tell rectangle element id SecondaryElementID of spread 1
                                resize bounds {top:0.5, left:0.0, bottom:bottie, right:(wyde + 6.0)}
                                fit to text
                           end tell
                       else
                           
                            tell rectangle element id SecondaryElementID of spread 1
                                resize bounds {top:0.5, left:0.0, bottom:bottie, right:(wyde + 6.0)}
                                fit to text
                               set tempBounds to bounds --of rectangle element id SecondaryElementID of spread 1
                               set BoxDeep to bottom of tempBounds
                               set toppie to (-2.0 - BoxDeep)
                                set bottie to -2.0
                                resize bounds {top:toppie, left:0.0, bottom:bottie, right:(wyde + 6.0)}
                                fit to text
                           end tell
                           
                            
                        end if
                   end tell
               else
                   if SubUdac is "TMH" then
                       if valueNew is true then
                           tell document 1
                                tell rectangle element id PrimaryElementID of spread 1
                                    resize bounds {top:0.5, left:0.0, bottom:bottie, right:(wyde + 6.0)}
                                    fit to text
                               end tell
                           end tell
                       else
                           
                            tell rectangle element id PrimaryElementID of spread 1
                                resize bounds {top:0.5, left:0.0, bottom:bottie, right:(wyde + 6.0)}
                                fit to text
                               set tempBounds to bounds --of rectangle element id SecondaryElementID of spread 1
                               set BoxDeep to bottom of tempBounds
                               set toppie to (-2.0 - BoxDeep)
                                set bottie to -2.0
                                set wyde to right of tempBounds
                               resize bounds {top:toppie, left:0.0, bottom:bottie, right:(wyde + 6.0)}
                                fit to text
                           end tell
                           
                            
                        end if
                       
                        
                    end if
                   
                end if
               if UDAC is 2 then
                   if SubUdac is not "TMH" then
                       if valueNew is true then
                           tell document 1
                                tell rectangle element id PrimaryElementID of spread 1
                                    resize bounds {top:0.5, left:6.0, bottom:bottie, right:(wyde + 6.0)}
                                    fit to text
                                   align using bottoms to page
                               end tell
                           end tell
                       else
                           set toppie to ad height of sizeOfAd
                           set toppie to (toppie + 6.0)
                            set bottie to ad height of sizeOfAd
                           set bottie to bottie + bottie
                           tell document 1
                                tell rectangle element id PrimaryElementID of spread 1
                                    resize bounds {top:toppie, left:6.0, bottom:bottie, right:wyde}
                                    fit to text
                                   --align using bottoms to page
                               end tell
                           end tell
                       end if
                   else
                       delete rectangle element id PrimaryElementID of spread 1 of document 1
                        
                    end if
                   
                end if
               
                (*
   tell document 1
            tell spread 1
                tell (rectangle elements where locked is false)
                    fit to text
                end tell
            end tell
        end tell
    
*)
                --end tell
               
                
                
            end if


Kind Regards
 
Francisco Seeto  

From: Peter Baxter <email@hidden>
Date: Sat, 24 Feb 2007 21:38:28 +1100
To: Francisco T Seeto <email@hidden>, Applescript Users <email@hidden>
Subject: Re: Re 10.3 applescripts in 10.4

Hi Francisco,

Does this mean that you are serving the sites you listed using applescripts or are they for other work?

Your scripts should work OK except for shellscript instructions.  Have a look at 
http://developer.apple.com/technotes/tn2002/tn2065.html  for some help in this area.


Peter


On 24/02/2007, at 8:48 PM, Francisco T Seeto wrote:


Hi Guys,

Can someone help me. We are deploying a new OS that happens to be 10.4 but
have found our scripts arent working as they did in 10.3. Is there a quick
fix for this? Or do we need to change our scripts completely to suit 10.4.

I am not a professional scripter so it is taking me a while to figure out.
Any help would be appreciated.

Thanks

Kind Regards

Francisco Seeto  




Peter Baxter
email@hidden


iChat email@hidden

 


Sensis. Australia's leading information resource.
Making complex lives simpler by helping you find, buy and sell.

www.about.sensis.com.au
www.sensis.com.au
www.yellow.com.au
www.whitepages.com.au
www.citysearch.com.au
www.whereis.com.au
www.gostay.com.au
www.smallbusiness.sensis.com.au
www.justlisted.com.au
www.linkme.com.au
www.telstra.com.au
www.tradingpost.com.au
www.universalpublishers.com.au
www.invizage.com.au

Sensis cares for the environment - think before you print.

This email and any attachments are intended only for the use of the recipient and may be confidential and/or legally privileged.
Sensis Pty Ltd disclaims liability for any errors, omissions, viruses, loss and/or damage arising from using, opening or transmitting this email.
If you are not the intended recipient you must not use, interfere with, disclose, copy or retain this email and you should notify the sender immediately by return email or by contacting Sensis Pty Ltd by telephone on [+61 3 8653 5000]
 _______________________________________________
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

References: 
 >Re: Re 10.3 applescripts in 10.4 (From: Peter Baxter <email@hidden>)

  • Prev by Date: Applescript errors
  • Next by Date: Return character after sed
  • Previous by thread: Re: Re 10.3 applescripts in 10.4
  • Next by thread: Applescript errors
  • Index(es):
    • Date
    • Thread