Author Topic: q8as: Suppress All Warnings- code help  (Read 3291 times)

0 Members and 1 Guest are viewing this topic.

Offline 4610036

  • Jr. Member
  • **
  • Posts: 50
  • Karma: 0
  • Gender: Female
q8as: Suppress All Warnings- code help
« on: May 10, 2009, 11:58:32 AM »
hi everyone.
can anyone help me with code for ignoring warnings when you open a file.  you know when it says, "this document was created with blah blah xtensions that are no longer available" or similar.

its tripping up my very fragile "collect" script. (which i'm pleased to report is now working, albeit, only in optimum weather conditions... by which i mean this current "open" issue would be considered a small thunder-storm. )

001   tell application "Finder"
002      select (every document file of front Finder window whose kind is "QuarkXPress Project File" or name extension is in {"qxd", "qxp"} and name starts with "k")      
003      tell application "QuarkXPress"
004         open file with Suppress All Warnings true
      
originally i had line 002 as "open (every document ...)
but then i wanted to add the "suppress all warnings" part,  which doesnt seem to be part of the "Finder" functionality.  i cant figure out how to merge the two statements. i have the path folder (":Volumes:CLIENTS:" & jobnum) but the job file is not always predictable. it could be "jobnum xxxxx.qxd" or "jobnum.qxd"

thanks as always for your help. i love having P-S people to go to for help, since no one in my non-virtual world knows or uses apple script.
:-) m./

 

Offline Jean-Marie Schwartz

  • Sr. Member
  • ****
  • Posts: 436
  • Karma: 6
  • Gender: Male
Re: q8as: Suppress All Warnings- code help
« Reply #1 on: May 12, 2009, 07:11:14 AM »
Hi there!
Just some few things I can see at the first glance: you should "put" all the selected files in a list; the you must at least tell Quark what file to open (that would be in a repeat loop like repeat with aFile in SelectedFiles -where SelectedFiles is the list of the selected files from the Finder); also, depending on what the user is supposed to do, you can prompt him/her to choose the files from a dialog box like "set SelectedFiles to choose file with prompt "What files do you want to process?" with multiple selections allowed"); and if the files are always in the same folder but you never know its name, you can target the folder and open only Quark documents testing its type or creator.
Hope this helps!
Jean-Marie Schwartz
May the Schwartz be with you :-)

= Mac Pro Quad-Core Intel 2.8 GHz 10 Go 1066 MHz DDR3 Mac OS 10.8.5 QuarkXPress 9.5.4.1 Adobe CS5 =

Offline 4610036

  • Jr. Member
  • **
  • Posts: 50
  • Karma: 0
  • Gender: Female
Re: q8as: Suppress All Warnings- code help
« Reply #2 on: May 12, 2009, 07:22:18 AM »
yes yes. i think i know what you mean. that does help. thank you jean-marie. (again!). sometimes i just need to get out of the mental loop i'm stuck in and look at things differently. :-) i will try to put into practice today, and let you know.
m./

Offline Jean-Marie Schwartz

  • Sr. Member
  • ****
  • Posts: 436
  • Karma: 6
  • Gender: Male
Re: q8as: Suppress All Warnings- code help
« Reply #3 on: May 12, 2009, 07:48:49 AM »
sometimes i just need to get out of the mental loop i'm stuck in and look at things differently. :-)
I must admit I'm like you  ;)
Jean-Marie Schwartz
May the Schwartz be with you :-)

= Mac Pro Quad-Core Intel 2.8 GHz 10 Go 1066 MHz DDR3 Mac OS 10.8.5 QuarkXPress 9.5.4.1 Adobe CS5 =

Offline 4610036

  • Jr. Member
  • **
  • Posts: 50
  • Karma: 0
  • Gender: Female
Re: q8as: Suppress All Warnings- code help
« Reply #4 on: May 12, 2009, 04:12:10 PM »
yay. it worked. it is perhaps not the most eloquent code (i tend to go the long way about things still), but it works.
thank you so much! did not need user-input for path. just needed a way to "suppress warnings".  i may add a repeat, as you suggested, for if there are multiple quark files in the folder (tho in general there is not).
thanks! (no more looping today.  :) )
m./

on open_jobfile()
   set openfilepath to ("VOLUMES:CLIENTS:" & jobnum & ":")
   tell application "Finder"
      make new alias file at desktop to folder jobnum of disk "CLIENTS" of application "Finder"
      open result
      get name of (every document file of front Finder window whose kind is "QuarkXPress Project File" or name extension is in {"qxd", "qxp"} and name starts with "k")
      set filea to result as string
      set fileapath to (openfilepath & filea) as string
   end tell
   
   tell application "QuarkXPress"
      open file fileapath with Suppress All Warnings


Offline 4610036

  • Jr. Member
  • **
  • Posts: 50
  • Karma: 0
  • Gender: Female
Re: q8as: Suppress All Warnings- code help
« Reply #5 on: June 11, 2009, 12:37:24 PM »
Hi everyone. 

"Suppress All Warnings" doesnt seem to work on the warning:

"This project was created with an xtensions module that is no longer available."

   tell application "QuarkXPress"
      activate
      open m_file with Suppress All Warnings

is it the code, or is it the file?

We are pretty sure its the old Blacklining Xtension from a previous version of Quark. The only way to strip it out is to copy paste and create a new document.  Does anyone know how to remove the reference to the xtension without creating a new file? or how to make it a Suppressable warning??

Any help would be appreciated. Thanks.  :)
M./

Offline Jean-Marie Schwartz

  • Sr. Member
  • ****
  • Posts: 436
  • Karma: 6
  • Gender: Male
Re: q8as: Suppress All Warnings- code help
« Reply #6 on: June 12, 2009, 06:08:35 AM »
Haven't you contacted the extension developper? One never knows, maybe they have a free sort of BlackLining killer.
If not, I'm not sure such alerts can be deleted from AS? But well I'm not an ace at scripting  :)
Jean-Marie Schwartz
May the Schwartz be with you :-)

= Mac Pro Quad-Core Intel 2.8 GHz 10 Go 1066 MHz DDR3 Mac OS 10.8.5 QuarkXPress 9.5.4.1 Adobe CS5 =

Offline 4610036

  • Jr. Member
  • **
  • Posts: 50
  • Karma: 0
  • Gender: Female
Re: q8as: Suppress All Warnings- code help
« Reply #7 on: June 12, 2009, 09:59:36 AM »
hi jean-marie. good idea! i'll look into it. wouldnt have thought of going outside the world of my own computer.  the plugin doesnt work with versn 8, so its just not recognized at all. 

it does seem to me that the "suppress all warnings" should work on this tho.  but AS sometimes throws an error with that particular command (suppress all warnings) when i'm compiling it.  or if i'm typing it new.  somethings definitely screwy. hmmm.

now, whats this with you not being an "ace at scripting"? teehee. you seem very clever to me ;-)

nice to hear from you again and thanks for the idea. i'll let u know how it goes.

m./

Offline larsen67

  • Sr. Member
  • ****
  • Posts: 459
  • Karma: 10
  • Gender: Male
Re: q8as: Suppress All Warnings- code help
« Reply #8 on: June 13, 2009, 05:56:00 AM »
There was a method of cleaning up documents in newer versions of Quark than what I have (6.51) where you used the 'append' feature now this is pure speculation but you could look this up try it in the app GUI if it works for you? then see if the same method can be done via script I don't have this like I say so Im unable to help any further than that. Else do you get dialogs that allow you to dismiss 'OK' then continue if so then you could have system events look for a dialog after opening a doc with a time out if exists click 'OK' do the rest of your stuff.

Offline 4610036

  • Jr. Member
  • **
  • Posts: 50
  • Karma: 0
  • Gender: Female
Re: q8as: Suppress All Warnings- code help
« Reply #9 on: June 15, 2009, 01:40:10 AM »
hi larsen
i am not sure the append feature covers this sort of thing - tho i did take a pretty good look at it.  a system event would probably work, but i have found them to be somewhat unreliable -- of course it could be my bad code -- but how it is now, requires that i put in excessive delays to allow for server slowness, or just a bigger file size taking longer to open.    if i cant come up with anything else i may resort your suggestion. 

as to jean-marie's idea about going back to the extension developer... i have discovered there are several blacklining extentions out there, so will have to contact the client and find out which was used.

at this time, my best bet might be to create a script that gets all the layout properties, copies the content, creates a new document, pastes the contents in place, and asks user to choose folder and save... actually thinking about it, that really may be the best option.

thanks for your help.  :-) talking about it with you guys always helps!!  jean-marie, i will let you know if i can find a blacklining killer (which really sounds waaaay cooler than it is right! heee.)
--margaret